summaryrefslogtreecommitdiff
path: root/cogl
Commit message (Collapse)AuthorAgeFilesLines
* Change all g_memdup() to g_memdup2()Jonas Ådahl2021-02-041-9/+9
| | | | | | | | Using g_memdup() is dangerous due to the type of the size argument. See https://gitlab.gnome.org/GNOME/glib/-/issues/2319 and https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1926 for details. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1708>
* cogl/gl-framebuffer: Remove hard coding type nameJonas Ådahl2021-01-302-2/+2
| | | | | | | Either "onscreen" or "offscreen" was logged as the type; replace this with the actual type name. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1514>
* cogl: Use 'is_y_flipped()' instead of instance-of checkingJonas Ådahl2021-01-303-7/+7
| | | | | | | This is what it was effectively used for in these places, so use the appropriate API instead. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1514>
* cogl/gl-framebuffer: Check Y-flipped-ness instead of framebuffer typeJonas Ådahl2021-01-303-15/+17
| | | | | | | | In a few places coordinates were flipped if driven framebuffer was or wasn't a CoglOffscreen. Change this to use the existing Y-flipped-ness class vfunc. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1514>
* cogl/gl-framebuffer: Move stereo mode state flushing to backendJonas Ådahl2021-01-304-33/+63
| | | | | | | | | | It's currently only handled by a surface backend framebuffer (assuming the right GLX extensions are available). While it's theoretically possible to do the same with the offcreen by having multiple textures, it's not supported, so leave the FBO variant with a single warning if we end up there. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1514>
* cogl/gl-framebuffer: GObject:ify helper functionsJonas Ådahl2021-01-301-19/+38
| | | | | | | | The object was still pretending to be CoglFramebuffer itself, by using naming and calling conventions making it seem like that. Fix that by passing around the driver instead of the framebuffer. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1514>
* cogl/framebuffer: Move read_pixels_into_bitmap() to driver classJonas Ådahl2021-01-3013-132/+58
| | | | | | | This was the last driver vfunc used specifically to implement the CoglFramebuffer driver. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1514>
* cogl/framebuffer: Move attribute drawing to driver classJonas Ådahl2021-01-3012-134/+158
| | | | Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1514>
* cogl/framebuffer: Move discard_buffers() to driver sub typesJonas Ådahl2021-01-3014-61/+78
| | | | | | | It was implemented slightly different depending on whether it was for a surface or FBO, so move it to their corresponding GL driver types. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1514>
* cogl/framebuffer: Move flush() and finish() to driver classJonas Ådahl2021-01-3012-44/+48
| | | | Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1514>
* cogl/framebuffer: Move clear() to CoglFramebufferDriverJonas Ådahl2021-01-3012-49/+71
| | | | Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1514>
* cogl/onscreen: Move buffer age getter vfunc to classJonas Ådahl2021-01-309-21/+11
| | | | Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1514>
* cogl: Add CoglX11Onscreen interfaceJonas Ådahl2021-01-3013-61/+128
| | | | | | | | | | | Mutter needs to fetch the X11 Window ID from the onscreen and did that by using an X11 specific API on the CoglOnscreen, where the X11 type was "expanded" (Window -> uint32_t). Change this by introducing an interface called CoglX11Onscreen, implemented by both the Xlib and GLX onscreen implementations, that keeps the right type (Window), while avoiding X11 specific API for CoglOnscreen. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1514>
* cogl/onscreen: Remove explicit 'resizable':nessJonas Ådahl2021-01-3010-399/+1
| | | | | | | | Mutter didn't use the APIs for resizeability of CoglOnscreens but managed the size itself. For the native backend we don't ever resize onscreens. Thus, remove this unused functionality. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1514>
* cogl/onscreen: Remove show()/hide()Jonas Ådahl2021-01-308-79/+0
| | | | | | Not used, and not relevant. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1514>
* cogl/test-utils: Skip "showing" the onscreenJonas Ådahl2021-01-301-3/+0
| | | | | | Tests pass anyway. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1514>
* cogl/onscreen: Move direct scanout to CoglOnscreen classJonas Ådahl2021-01-303-16/+22
| | | | Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1514>
* cogl/onscreen: Move binding to onscreen classJonas Ådahl2021-01-3011-28/+20
| | | | Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1514>
* cogl/onscreen: Make swap_buffer/region CoglOnscreen class vfuncsJonas Ådahl2021-01-309-87/+61
| | | | | | No need to go via the "winsys" vtable. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1514>
* cogl/gl-framebuffer: Split up into FBO and back driversJonas Ådahl2021-01-3023-743/+1160
| | | | | | | One is for when we're painting to the back buffer (onscreen), and the other when we're painting to an FBO (offscreen). Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1514>
* cogl: Add 'framebuffer' debug topicJonas Ådahl2021-01-302-0/+2
| | | | Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1514>
* cogl: Init framebuffer driver up frontJonas Ådahl2021-01-3017-162/+250
| | | | | | | | The framebuffer driver was lazilly initialized on demand in some cases (onscreen), and up front other (offscreen). Replace this with a more predictable up front initialization, done at framebuffer allocation. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1514>
* cogl/offscreen: Move struct to C fileJonas Ådahl2021-01-304-33/+47
| | | | Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1514>
* cogl/gl-framebuffer: Move struct fields into privateJonas Ådahl2021-01-301-30/+45
| | | | | | This makes it possible to make type derivable. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1514>
* cogl: Move "flush framebuffers" under the context scopeJonas Ådahl2021-01-3017-207/+248
| | | | | | | | It was namespaced as a CoglFramebuffer function, but was passed two framebuffers, and operated on state kept in CoglContext. Move and rename accordingly. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1514>
* cogl: Add CoglFramebufferDriver base typeJonas Ådahl2021-01-305-4/+183
| | | | Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1514>
* cogl/offscreen: Pass ColgOffscreenFlag when allocatingJonas Ådahl2021-01-306-14/+21
| | | | | | | So that the allocation functions don't need to peek at the cached flag struct field. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1514>
* cogl/gl-framebuffer: Fix allocate flag variable nameJonas Ådahl2021-01-301-9/+9
| | | | | | | It was called 'flags' which would conflict with a variable containing a CoglOffscreenFlag that will be added later. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1514>
* cogl/offscreen: Remove alloation_flags struct fieldJonas Ådahl2021-01-302-7/+0
| | | | | | Was unused. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1514>
* cogl/offscreen: Remove depth buffer texture fieldJonas Ådahl2021-01-303-73/+0
| | | | | | It was never set, so it was just some dead code. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1514>
* cogl/offscreen: Move CoglGlFbo struct to GL driverJonas Ådahl2021-01-302-14/+26
| | | | | | It was only used there, so put it in the driver private struct. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1514>
* cogl/offscreen: Move CoglOffscreen code to its own fileJonas Ådahl2021-01-308-185/+248
| | | | | | Moving the external direct struct access will come later. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1514>
* cogl/gl-framebuffer: Rename CoglGLFramebuffer CoglGlFboJonas Ådahl2021-01-302-23/+23
| | | | | | | | The CoglGLFramebuffer (not CoglGlFramebuffer) is a private struct for keeping track of the framebuffer object. To avoid confusing with CoglGlFramebuffer, rename it CoglGlFbo. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1514>
* cogl/gl-framebuffer: Make it a GObjectJonas Ådahl2021-01-302-4/+24
| | | | | | | | This way we can have separate types per modes of operation (e.g. if it's backed by an EGLSurface or single texture), instead of being dependent on a certain type (onscreen vs offscreen). Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1514>
* cogl/framebuffer-gl: Rename from CoglFramebufferGl to CoglGlFramebufferJonas Ådahl2021-01-301-34/+34
| | | | | | | | This is to follow the convention [ParentName][ChildName] representing inheritance. As this does not inherit CoglFramebuffer, rename it CoglGlFramebuffer. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1514>
* cogl/onscreen: Use CoglFramebufferClass::allocate() to initJonas Ådahl2021-01-3011-216/+191
| | | | | | | | Instead of calling "init_onscreen()" on two different separate vtables from the allocate() funtion, just have the CoglOnscreen sub types themself implement allocate() and initialize in there. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1514>
* Make all CoglOnscreen sub types inherit CoglOnscreenJonas Ådahl2021-01-3011-203/+224
| | | | | | | | | | | | | | | | Thins means that e.g. MetaOnscreenNative now inherits CoglOnscreenEgl, which inherits CoglOnscreen which inherits CoglFramebuffer, all being the same GObject instance. This makes it necessary to the one creating the onscreen to know what it wants to create. For the X11 backend, the type of renderer (Xlib EGL or GLX) determines the type, and for the native backend, it's currently always MetaOnscreenNative. The "winsys" vfunc entries related to onscreens hasn't been moved yet, that will come later. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1514>
* cogl/onscreen/egl: Move struct fields to instance privateJonas Ådahl2021-01-301-23/+62
| | | | | | This is so a derivable type can be declared later. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1514>
* cogl/onscreen: Change to follow mutters naming conventionJonas Ådahl2021-01-305-158/+158
| | | | | | | | | | | | | | | | | The mutter naming convention for types and their instance variables is: Type name: [Namespace][BaseName][SubType] Instance name: [base_name]_[sub_type] This means that e.g. CoglOnscreenGLX is renamed CoglOnscreenGlx, and glx_onscreen is renamed onscreen_glx. This is in preparation for GObjectification. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1514>
* cogl/xlib: Move EGL XLIB onscreen to separate fileJonas Ådahl2021-01-305-292/+416
| | | | | | | As with the other onscreens, separate it into its own file in preparation for GObjectification. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1514>
* cogl/glx: Move onscreen code to a separate fileJonas Ådahl2021-01-305-1078/+1280
| | | | | | | Mostly in order to untangle it from the rest, preparing turning it into a GObject. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1514>
* cogl/winsys/glx: Merge 'xlib' and 'glx' structsJonas Ådahl2021-01-301-53/+47
| | | | | | | | | The GLX winsys code had split up the GLX onscreen implementation into an Xlib part (with a struct name confusingly enough identical to that of the onscreen in the actual Xlib winsys). To remove some confusion, combine the two. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1514>
* cogl/onscreen/egl: Move struct to C fileJonas Ådahl2021-01-305-17/+89
| | | | | | In praparation for declaring the EGL onscreen part using G_DECLARE*. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1514>
* cogl/onscreen/egl: Move pending_resize_notify to Xlib platformJonas Ådahl2021-01-302-5/+8
| | | | | | It's only used in the Xlib onscreen, so move it there. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1514>
* cogl/winsys/egl: Move out onscreen code to own fileJonas Ådahl2021-01-305-291/+390
| | | | | | | As a preparation turning it into its own type, move the code related to CoglOnscreen to its own file. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1514>
* cogl/onscreen: Move fields from CoglOnscreen struct to privateJonas Ådahl2021-01-301-43/+79
| | | | | | This means we can now make CoglOnscreen derivable using GObject macros. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1514>
* cogl: Move CoglOnscreen struct to C fileJonas Ådahl2021-01-305-71/+122
| | | | | | | That means all sub types need to use helper methods, so make them do that too. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1514>
* cogl: Fix license header in cogl-scanout and cogl-traceJonas Ådahl2021-01-284-40/+78
| | | | | | As with cogl-graphene, the same mistake was made here. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1690>
* cogl/graphene: Fix license headerJonas Ådahl2021-01-282-24/+40
| | | | | | | The intention was for these files to be licensed identically to the other files in cogl, so fix this. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1690>
* kms: Add symbolic page flips and cogl frame infosJonas Ådahl2021-01-223-0/+21
| | | | | | | | This makes it possible to post a symbolic page flip and frame callback, meant to be used by immediate symbolic page flip reply when emulating cursor plane changes using legacy drmMode* functions. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1488>