summaryrefslogtreecommitdiff
path: root/cogl
Commit message (Collapse)AuthorAgeFilesLines
* cogl-texture: refuse downloading textures in cogl_texture_get_data() on GLESGeorge Kiagiadakis2018-02-051-17/+5
| | | | | | | | | | | | | | | | | | | On drivers that do not support glGetTexImage2D (i.e. on GLES), cogl_texture_get_data() has a "feature" that allows it to download texture data by rendering the texture on an intermediate framebuffer object and then reading back the data from there. However, this feature requires the user to have previously set an "active" framebuffer object in the context, which makes this very tricky because it is not clear to the developer that he needs to do that in order for some code to work on GLES (of course it works on desktop GL, so nobody notices...) and additionally the code actually crashes if an active fbo is not set! This patch basically removes this feature in order to prevent the crash and is in line with how this code has evolved in cogl-2.0: https://git.gnome.org/browse/cogl/commit/?id=6d6a277b8e9a63a8268046e5258877ba94a1da5b https://bugzilla.gnome.org/show_bug.cgi?id=789961
* cogl: Add way to pass user data when setting custom renderer winsysJonas Ådahl2017-10-053-2/+6
| | | | | | | | When creating a renderer with a custom winsys (which is always how mutter uses cogl) make it possible to pass a user data with the winsys. Still unused. https://bugzilla.gnome.org/show_bug.cgi?id=785381
* cogl: Only do the swizzling hack for GL contextsMario Sanchez Prada2017-08-211-2/+4
| | | | | | | | | | | The GL_BGRA definition is not available for GLES2 contexts, which use the EXT_texture_format_BGRA8888 instead, causing a build failure when trying to use it in those contexts. Fortunately, this hack is only relevant for GL, so let's guard it to prevent the failure in GLES2, where that extension is used instead. https://bugzilla.gnome.org/show_bug.cgi?id=786568
* cogl: Mark vertex buffers as dynamicCarlos Garnacho2017-05-221-1/+1
| | | | | | | | | Those are cached and reused across runs, which doesn't qualify to mesa as "static" indeed. Properly marking those as dynamic is more true, and brings in slight performance benefits just by avoiding the resulting (and later silenced) mesa warning. https://bugzilla.gnome.org/show_bug.cgi?id=782344
* cogl: Use pixel_format_to_gl_with_target in find_best_gl_get_data_formatCarlos Garnacho2017-05-184-5/+10
| | | | | | | | | Fixes cogl_texture_get_data() resorting to the wrong conversions when extracting the texture data. This notably resulted in RGB/RGBA buffers copied as-is into BGRA buffers, for instance for the fullscreen animation, or single-window screenshots of such buffers. https://bugzilla.gnome.org/show_bug.cgi?id=779234
* Consider the right CONTEXT_LOST token on OpenGL ES contextsMario Sanchez Prada2017-04-171-0/+5
| | | | | | | | | | | | | | | The KHR_robustness extension defined the following token as returned by GetError (see spec at [1]): CONTEXT_LOST 0x0507 As noted in the spec, this token must have a "_KHR" suffix in an OpenGL ES context, which is not being considered here, thus making this type of builds fail. [1] https://www.khronos.org/registry/OpenGL/extensions/KHR/KHR_robustness.txt https://bugzilla.gnome.org/show_bug.cgi?id=781398
* Define new tokens from the ARB_robustness extension if neededMario Sanchez Prada2017-04-171-0/+13
| | | | | | | | | | | | | | | | | The ARB_robustness extension defined the following tokens as returned by GetGraphicsResetStatusARB (see spec at [1]): GUILTY_CONTEXT_RESET_ARB 0x8253 INNOCENT_CONTEXT_RESET_ARB 0x8254 UNKNOWN_CONTEXT_RESET_ARB 0x8255 These tokens might not be defined in some GL implementations, such as Mesa 13's implementation of GLES 2.0, so we need to define them ourselves not to break those builds. [1] https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_robustness.txt https://bugzilla.gnome.org/show_bug.cgi?id=781398
* x11: Use EGL instead of GLX when drawing using GLESJonas Ådahl2017-03-253-7/+9
| | | | | | | When running as a X11 CM we shouldn't use the GLX winsys when the driver doesn't support it, i.e. OpenGL ES drivers. https://bugzilla.gnome.org/show_bug.cgi?id=771636
* cogl: Use pixel_format_to_gl_with_target on bitmap uploading pathsCarlos Garnacho2017-03-071-5/+6
| | | | | | | | | | | | We already do have a texture with an internal format in these paths, so we should check the required format according to it. This fixes CoglAtlasTexture (and CoglPangoRenderer indirectly), as it forces a RGBA format on its texture, but pixel_format_to_gl() anyway assumed swizzling is performed on the texture, while it is not the case. https://bugzilla.gnome.org/show_bug.cgi?id=779234
* cogl: Add pixel_format_to_gl_with_target driver vfuncCarlos Garnacho2017-03-074-11/+52
| | | | | | | | This is used by the GL driver in order to determine whether swizzling actually applies given the bitmap and target texture internal format. If both agree that they store BGRA, then swizzling may apply. https://bugzilla.gnome.org/show_bug.cgi?id=779234
* cogl: Read pixels in the correct 32bit format as per the given bitmapCarlos Garnacho2017-03-011-0/+9
| | | | | | | Fixes the gnome-shell screenshot tool from getting colors with the wrong byte order. https://bugzilla.gnome.org/show_bug.cgi?id=779234
* cogl: Prefer swizzling to convert BGRA buffersCarlos Garnacho2017-02-282-1/+21
| | | | | | | | | | | | | | | | If the GL implementation/hw supports the GL_*_texture_swizzle extension, pretend that BGRA textures shall contain RGBA data, and let the flipping happen when the texture will be used in the rendering pipeline. This avoids rather expensive format conversions when forcing BGRA buffers into RGBA textures, which happens rather often with WL_SHM_FORMAT_ARGB8888 buffers (like gtk+ uses) in little-endian machines. In intel/mesa/wayland, the performance improvement is rather noticeable, CPU% as seen by top decreases from 45-50% to 25-30% when running gtk+/tests/scrolling-performance with a cairo renderer. https://bugzilla.gnome.org/show_bug.cgi?id=779234
* Add cogl_xlib_renderer_set_threaded_swap_wait_enabled()Owen W. Taylor2017-02-214-0/+43
| | | | | | | | | | | Because the threaded-swap-wait functionality requires XInitThreads(), and because it isn't clear that it is a win for all applications, add a API function to conditionally enable it. Fix the cogl-crate example not to just have a hard-coded dependency on libX11. https://bugzilla.gnome.org/show_bug.cgi?id=779039
* For NVIDIA proprietary drivers, implement sync events with a threadOwen W. Taylor2017-02-212-11/+286
| | | | | | | | | | It's a good guess that the buffer swap will occur at the next vblank, so use glXWaitVideoSync in a separate thread to deliver a sync event rather than just letting the client block when frame drawing, which can signficantly change app logic as compared to the INTEL_swap_event case. https://bugzilla.gnome.org/show_bug.cgi?id=779039
* Fix the get_clock_time() without GLX_OML_sync_controlOwen W. Taylor2017-02-211-0/+3
| | | | | | | | When we don't have GLX_OML_sync_control, we still can set the frame presentation time, but we always use the system monotonic time, so return that from get_clock_time(). https://bugzilla.gnome.org/show_bug.cgi?id=779039
* Usability of SGI_video_sync is per-display not per-rendererOwen W. Taylor2017-02-213-26/+31
| | | | | | | | | As previously commented in the code, SGI_video_sync is per-display, rather than per-renderer. The is_direct flag for the renderer was tested before it was initialized (per-display) and that resulted in SGI_video_sync never being used. https://bugzilla.gnome.org/show_bug.cgi?id=779039
* CoglWinsysGLX: factor out some duplicated codeOwen W. Taylor2017-02-211-12/+12
| | | | | | Add a helper function for repeated calls to clock_gettime(CLOCK_MONOTONIC) https://bugzilla.gnome.org/show_bug.cgi?id=779039
* CoglGPUInfo - fix check for NVIDIAOwen W. Taylor2017-02-211-1/+2
| | | | | | | NVIDIA drivers have a vendor of "NVIDIA Corporation" not "NVIDIA". Check for both in case older drivers did use "NVIDIA" https://bugzilla.gnome.org/show_bug.cgi?id=779039
* build: Clean up .pc filesFlorian Müllner2017-02-151-0/+4
|
* cogl: fix get-value-func annotationLionel Landwerlin2017-02-152-2/+2
| | | | | | Found while trying to enable Cogl 2.0 APIs access from JS. https://bugzilla.gnome.org/show_bug.cgi?id=778684
* Make libmutter and friends parallel installableJonas Ådahl2017-02-1412-73/+83
| | | | | | | | | | | | | | | | | | | In order to minimize the amount of breakage, while at the same time making it easier to make backward incompatible changes needed to continue turning libmutter into a capable Wayland compositor, make the libmutter and friends (libmutter-clutter, libmutter-cogl*) parallel installable by adding a version number to the name. This changes various filenames, for example what previously was libmutter.so is now libmutter-0.so (assuming the version for now is 0), and libmutter-clutter-1.0.so is now libmutter-clutter-0.so. The pkg-config filenames and GObject introspection has been renamed to reflect this as well. This enables a downstream compositor rely on a specific version of the libmutter API, while gracefully handling API/ABI changes by having to update to the new version at their own pace. https://bugzilla.gnome.org/show_bug.cgi?id=777317
* Use eglGetPlatformDisplayAdam Jackson2017-02-071-2/+34
| | | | | | | | | | Different libEGL will do different things for eglGetDisplay since it has to guess what kind of display it's been handed. Better to just use the API that makes it explicit. Signed-off-by: Adam Jackson <ajax@redhat.com> https://bugzilla.gnome.org/show_bug.cgi?id=772422
* cogl: Just define the needed GLES2 extension ourselfJonas Ådahl2017-01-031-5/+10
| | | | | | | | | We need a GLES2 extension macro in cogl-texture-2d-gl.c, but we can't include GLES2/gl2ext.h because it will conflict with things in GL/glext.h. We can't rely on cogl including anything for us since it'd only include GLES2/gl2ext.h if OpenGL support was explicitly disabled. https://bugzilla.gnome.org/show_bug.cgi?id=774891
* cogl: Do not include both GLES2 and GL headersFlorian Müllner2016-12-021-2/+7
| | | | | | | | | EGLDevice requires a define from GLES2, even when GL is used instead. As type definitions may conflict between the two, we shouldn't include both at the same time. Instead, provide the missing define explicitly when not using GLES2. https://bugzilla.gnome.org/show_bug.cgi?id=774891
* build: Fix cogl include pathsFlorian Müllner2016-11-231-0/+1
| | | | | | cogl-egl-defines.h is now referenced from a public header, so we need to include its location whenever the header is used (directly or via cogl.h).
* cogl: Add support for creating custom EGL based texturesJonas Ådahl2016-11-189-2/+157
| | | | | | | | | Add API to enable the caller to have a custom method for allocating an external texture. This will enable the possibility for mutter to generate a texture from for example an EGLStream without having to add support for that in Cogl. https://bugzilla.gnome.org/show_bug.cgi?id=773629
* wayland: Make MetaWaylandBuffer handle texture generation itselfJonas Ådahl2016-11-181-1/+1
| | | | | | | | | | | | | Don't rely on the Cogl layer having Wayland specific paths by determining the buffer type and creating the EGLImage ourself, while using the newly exposed CoglTexture from EGLImage API. This changes the API used by MetaWaylandSurface to make the MetaWaylandBuffer API be aware when the buffer is being attached. For SHM and EGL buffers, only the first time it is attached will result in a new texture being allocated, but later for EGLStream's, more logic on every attach is needed. https://bugzilla.gnome.org/show_bug.cgi?id=773629
* cogl: Expose API for creating texture from EGLImageJonas Ådahl2016-11-184-34/+35
| | | | | | Later to be used by mutter to create EGLImage's from Wayland buffers. https://bugzilla.gnome.org/show_bug.cgi?id=773629
* cogl: Make platforms set the EGL_SURFACE_TYPEJonas Ådahl2016-11-182-8/+19
| | | | | | | Cogl has no way to know how to properly set the surface type, so lets outsource that to the platform layer. https://bugzilla.gnome.org/show_bug.cgi?id=773629
* cogl/egl: Fix non-Wayland buildJonas Ådahl2016-09-021-1/+1
| | | | | | | Use #ifdef instead of #if, otherwise it won't compile when Wayland is not available. https://bugzilla.gnome.org/show_bug.cgi?id=770647
* Use _NO_CONTEXT when creating images for EGL_WAYLAND_BUFFER_WLSjoerd Simons2016-08-291-0/+7
| | | | | | | | | | | | The WL_bind_wayland_display spec says that EGL images should be created using EGL_WAYLAND_BUFFER_WL as the target and a NULL context. Mesa seems to be lenient and accept any context, however some other stacks aren't so forgiving and fail if anything apart from EGL_NO_CONTEXT is used. Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk> https://bugzilla.gnome.org/show_bug.cgi?id=769731
* cogl: Fix a few GISCAN warningsJonas Ådahl2016-08-182-5/+5
| | | | | | | We tried to resolve non-introspected types; lets skip those. We didn't have a vfunc scope on a for-each loop; declared it synchronous. https://bugzilla.gnome.org/show_bug.cgi?id=769800
* cogl: fix indentationThomas Hindoe Paaboel Andersen2016-07-222-2/+2
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=769054
* cogl-gles2: Don't leak gles2 types into mutterFlorian Müllner2016-07-211-1/+1
| | | | | | | On i686, the GLsizeiptr typedef in cogl-gles2.h conflicts with the system GL headers, so make sure we don't include both. https://bugzilla.gnome.org/show_bug.cgi?id=769014
* build: Dist cogl-mutter/cogl-clutter headersFlorian Müllner2016-07-201-0/+1
|
* cogl: Let the g-ir-scanner see the type structs typedefsJonas Ådahl2016-07-206-6/+11
| | | | | | | By only showing the g-ir-scanner void typedefs it will make it print warnings. Lets please it by showing the actual typedef. https://bugzilla.gnome.org/show_bug.cgi?id=768977
* cogl: Remove support for not building with glib/gtype supportJonas Ådahl2016-07-2044-187/+1
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=768977
* Remove cogl-1.0 vs cogl-2.0 vs cogl experimental API splitJonas Ådahl2016-07-2041-1149/+57
| | | | | | | | | | | Mutter (and libmutter users) are the only users of this version of cogl, and will more or less only use the cogl-1.0, cogl-2.0 and cogl experimental API variants, and having the possibility of having different API versions of the same API depending on what file includes it is error prone and confusing. Lets just remove the possibility of having different versions of the same API. https://bugzilla.gnome.org/show_bug.cgi?id=768977
* Don't pretend we don't have CoglShaderJonas Ådahl2016-07-201-1/+1
| | | | | | | | We bypass our build configuration to fetch API from a version which isn't the one we actually use. Stop bypassing and just admit that the 1.0 API is still there, but still deprecated. https://bugzilla.gnome.org/show_bug.cgi?id=768977
* cogl: Remove deprecated CoglTexture functionsJonas Ådahl2016-07-204-195/+0
| | | | | | None were used; no reason to keep them. https://bugzilla.gnome.org/show_bug.cgi?id=768977
* cogl: Remove CoglClipStateJonas Ådahl2016-07-204-407/+0
| | | | | | We were not using it anywhere; lets get rid of it. https://bugzilla.gnome.org/show_bug.cgi?id=768977
* cogl: Remove CoglFixedJonas Ådahl2016-07-206-1948/+0
| | | | | | We were no longer using anything from it; lets remove it. https://bugzilla.gnome.org/show_bug.cgi?id=768977
* cogl: Fix a bunch of GISCAN warningsJonas Ådahl2016-07-2015-88/+87
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=768977
* Use signals instead of onscreen framebuffer frame callbacksJonas Ådahl2016-07-204-0/+14
| | | | | | | | | | | | | CoglFrameInfo is a frame info container associated with a single onscreen framebuffer. The clutter stage will eventually support drawing a stage frame with multiple onscreen framebuffers, thus needs its own frame info container. This patch introduces a new stage signal 'presented' and a accompaning ClutterFrameInfo and adapts the stage windows and past onscreen frame callbacks users to use the signal and new info container. https://bugzilla.gnome.org/show_bug.cgi?id=768976
* cogl: Add API to get the texture from an offscreenJonas Ådahl2016-07-202-0/+12
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=768976
* Move cogl KMS winsys into the native backendJonas Ådahl2016-07-2010-1599/+2
| | | | | | | | | | | Move the KMS interaction from cogl into mutter, where most of the other KMS interaction already takes place. This also removes dead code which were only excercised when non-mutter callers used the cogl KMS backend. The cogl KMS API was updated to pass via MetaRendererNative instead of via the different cogl objects. https://bugzilla.gnome.org/show_bug.cgi?id=768976
* Make it possible to include private cogl API from mutterJonas Ådahl2016-07-2012-8/+39
| | | | | | | If we want to put a cogl winsys backend in mutter, that backend need to have access to the internal workings of cogl. https://bugzilla.gnome.org/show_bug.cgi?id=768976
* cogl: Remove some now dead codeJonas Ådahl2016-07-202-51/+1
| | | | | | We require glib and don't support building on win32 any more. https://bugzilla.gnome.org/show_bug.cgi?id=768976
* Update .gitignoreJonas Ådahl2016-07-201-25/+9
| | | | | | | The cogl/clutter merge made the .gitignore files in the respective directories incorrect, due to the using absolute paths. https://bugzilla.gnome.org/show_bug.cgi?id=768976
* cogl: Fix signage miss match warningsJonas Ådahl2016-07-202-2/+2
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=768976