Commit graph

26 commits

Author SHA1 Message Date
Bryce Harrington
8ff3019f51 gl: Add support for OpenGL ES 3.0
This improves the OpenGL ES support to extend it to version 3.0.
A number of new features are available in glesv3 including creation of
multi-sampled renderbuffers.  These renderbuffers can be blitted to
single sample textures (but not the other way around).  Other features
such as PBO for image uploading, are left as followon work.

For this preliminary implementation, glesv3 backends always create
renderbuffers, which can be set as single sample or multisample.  The
renderbuffer's content is blitted to the texture only when used as a
source or a mask.

Images uploaded to a texture stay there until the surface is used as a
rendering target, at which point its painted to the renderbuffer.

This patch is heavily based off of Henry Song's initial GLESv3 patch
6f7f3795 from his cairogles fork of Cairo, and incorporates subsequent
fixes and pertinent refactorings from his trunk and review feedback from
Uli.

This implements the *functional* support for glesv3, excluding the
various optimization work to utilize its features.  Rendering and
performance should not be expected to improve notably from pure glesv2.
As the GL backend for Cairo remains "experimental", these changes should
likewise be considered as such.

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
2017-09-13 15:18:04 -07:00
Bryce Harrington
c7cf0dfd60 Revert "cairo-gl: Fix compiler warning if CAIRO_HAS_*_FUNCTIONS is not defined."
This reverts commit c8b6c6066a.

An undefined macro is evaluated as 0.
The preference is to use #if MACRO_NAME rather than #ifdef.

Conflicts:
	src/cairo-gl.h
2015-07-27 14:15:11 -07:00
Bryce Harrington
06a2696d5f cairo-gl: Still check the value of the macros
Just because they're defined doesn't mean they've been enabled.
2015-07-06 14:11:57 -07:00
Koop Mast
c8b6c6066a cairo-gl: Fix compiler warning if CAIRO_HAS_*_FUNCTIONS is not defined.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=88050

[Updated to also still check the value of the macros]

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
2015-06-27 01:14:22 -07:00
Henry Song
524e6fd3e8 gl: Export query for EGLContext and EGLDisplay from device
Similar to glx, add query for the EGLContext and EGLDisplay to egl-based
cairo devices.
2013-03-08 11:43:39 +00:00
Martin Robinson
5c4087af81 gl: Add a non-thread-aware mode for GL devices
GLX and EGL devices are thread-aware currently. This
is safe, but on certain GPUs can be very expensive. In
this patch, we expose a new API which turns off the
safety feature in cases where performance is a priority.
2012-08-22 13:49:14 -07:00
Andrea Canciani
f717341ab9 doc: Make documentation comments symmetric
Documentation comments should always start with "/**" and end with
"**/". This is not required by gtk-doc, but it makes the
documentations formatting more consistent and simplifies the checking
of documentation comments.

The following Python script tries to enforce this.

from sys import argv
from sre import search

for filename in argv[1:]:
    in_doc = False
    lines = open(filename, "r").read().split("\n")
    for i in range(len(lines)):
        ls = lines[i].strip()
        if ls == "/**":
            in_doc = True
        elif in_doc and ls == "*/":
            lines[i] = " **/"
        if ls.endswith("*/"):
            in_doc = False

    out = open(filename, "w")
    out.write("\n".join(lines))
    out.close()

This fixes most 'documentation comment not closed with **/' warnings
by check-doc-syntax.awk.
2012-03-29 11:03:18 +02:00
Behdad Esfahbod
f5f8915df2 Fix another typo 2012-03-25 15:11:57 -04:00
Nis Martensen
6b2d12e78a doc: do not confuse gtk-doc by @ and double *
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-03-10 10:20:28 +01:00
Alexandros Frantzis
2472ed899c gl: Fix build issues for GLES2
The glReadBuffer/glDrawBuffer functions are not present in GLES2, only
a single buffer is supported.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-05-10 08:35:26 +01:00
Andrea Canciani
7ea7a7714b Fix warning by check-doc-syntax
The check-doc-syntax step of 'make check' reports:

./cairo-gl.h: * cairo_device_t, which represents an GL context created by the user.
Error: some function names in the docs are not followed by parentheses.
Fix this by searching for the following regexp in the above files:
    '^[^:]*:[/ ][*]\(\|[  ].*\)\([^#']\|^\)\<\(cairo_[][<>/0-9a-z_]*\>[^][<>(]\)'
2011-03-21 09:51:01 +01:00
Eric Anholt
2e67809be0 gl: Add a first bit of general documentation on cairo-gl usage.
Since its inception, cairo-gl has been plagued by the "how am I really
supposed to use it?" problem.  This lays down my expectations for how
cairo-gl will interact with other usage of the GL API.
2011-02-21 14:12:47 -08:00
Benjamin Otte
dbb386d3c0 gl: Use unsigned int instead of GLuint
GLuint is not defined in cairo-gl.h. If unsigned int is not compatible
enough to GLuint, we might consider to use #include <GL/gl.h> instead.
2010-07-09 12:49:10 +02:00
Kristian Høgsberg
9e6c151af8 gl: Add new cairo-gl surface constructor to create surface for texture 2010-07-07 18:11:36 -04:00
Zoxc
505a0456d2 gl: Added WGL context and surface. 2010-06-14 12:46:26 +01:00
Benjamin Otte
5223b65423 gl: Get rid of cairo_gl_surface_glfinish() from public API
This is now done explicitly in the boilerplate code. It was not a useful
public API to begin with.
2010-05-05 12:30:01 +02:00
Andrea Canciani
b8a7f8621a Update FSF address
I updated the Free Software Foundation address using the following script.

for i in $(git grep Temple | cut -d: -f1 )
do
  sed -e 's/59 Temple Place[, -]* Suite 330, Boston, MA *02111-1307[, ]* USA/51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA/' -i "$i"
done

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=21356
2010-04-27 11:13:38 +02:00
Benjamin Otte
46ef05c3d7 glx: Add getters for device's Display and GLXContext 2010-04-15 18:31:00 +02:00
Chris Wilson
b101c7dab8 gl: Add EGL interface
Enable the EGL backend for GL.
2010-03-11 01:49:18 +00:00
Chris Wilson
22b5f78c1c gl: Remove eagle support
Eagle is no more, Kristian has superseded it with true EGL support. He
is so happy...
2010-02-11 10:38:51 +00:00
Chris Wilson
ccea7fd7c1 gl: Port to cairo_device_t 2010-01-22 23:01:50 +00:00
Chris Wilson
1ae5942a3a Merge commit 'anholt/gl'
Conflicts:
	boilerplate/Makefile.sources
	boilerplate/cairo-boilerplate.c
	build/configure.ac.features
	src/cairo.h
	util/cairo-script/Makefile.am
2009-07-21 22:28:44 +01:00
Eric Anholt
19bc0f2f1d [gl] Fix check-def.sh for GL surface. 2009-06-01 10:37:37 -07:00
Chris Wilson
87b764908a [gl] Add EGL target
Split the GLX context from the GL surface to enable use of an alternative
EGL interface.
2009-05-20 08:13:45 +01:00
Eric Anholt
fb6937565b [gl] Add interface for creating surfaces from window backbuffers. 2009-02-12 04:10:52 -08:00
Eric Anholt
235de8d7a4 [gl] Add basics for GL surface backend using test-fallback as base. 2009-02-05 09:38:43 -08:00