summaryrefslogtreecommitdiff
path: root/cogl
Commit message (Collapse)AuthorAgeFilesLines
* build: Fix cogl-pango underlinkingCarlos Garnacho2023-03-031-1/+1
| | | | | | | This library is using Pango and PangoCairo. Make it declare them as requirements. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2864>
* cogl: Trap GLX call with error trapCarlos Garnacho2023-03-031-1/+5
| | | | | | | | | | | | This is a X request that may result in errors, so it is better to have covered by an error trap. It is thus far not, explicitly at least, which means other less lenient error traps might not like what happens here. Make the error trap threeway between backend, x11 and cogl happen less by chance here. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2864>
* cogl/scanout: Add 'scanout-failed' signalJonas Ådahl2023-03-012-0/+28
| | | | | | | | This will later be emitted when a scanout failed, e.g. by the not-test commit failing for some reason, or drmModePageFlip() failing even if the pre-conditions for scanout in the simple KMS backend passed. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2854>
* cogl: Remove legacy OpenGL driver supportJonas Ådahl2023-02-217-59/+8
| | | | | | This means the two Cogl drivers left are OpenGL >= 3.1 and GLES >= 2.0. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2672>
* stage-impl: Transform damage region before queuingRobert Mader2023-02-201-0/+3
| | | | | | | | | | | In order to queue the right values for transformed `MetaRendererView`s. While on it ensure we query the framebuffers width/height only once, saving some cpu cycles. Closes https://gitlab.gnome.org/GNOME/mutter/-/issues/2557 Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2860>
* cogl/onscreen: Discard depth/stencil before swapping buffersErico Nunes2023-02-081-10/+8
| | | | | | | | | | | | | | | | | Marking the the depth/stencil as discarded before swapping buffers for the screen signals the GPU that we don't need to keep them around for the future. This helps performance by reducing memory bandwidth usage in some GPUs which may optimize to not write those buffers back to memory at all after rendering, when they would just be cleared right after that anyway. It is not necessary to mark buffers as discarded after swapping buffers. This should have no effect according to the spec (since that is going to be followed by new rendering commands which make the buffer valid again) and removing that has shown no impact in performance tests. Signed-off-by: Erico Nunes <nunes.erico@gmail.com> Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2091>
* cogl/framebuffer: Remove requirement to discard color bufferErico Nunes2023-02-081-2/+0
| | | | | | | | | cogl_framebuffer_discard_buffers required that the color buffer is passed, although users might want to discard e.g. just depth and/or stencil buffers. Signed-off-by: Erico Nunes <nunes.erico@gmail.com> Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2091>
* Use g_clear_fd() instead of open coding the same behaviorJonas Ådahl2023-01-301-2/+2
| | | | Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2806>
* cogl/egl: Also log when we managed to obtain a high priority contextJonas Ådahl2023-01-301-0/+2
| | | | Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2807>
* build: Fix Sysprof interface path with split sysprof packageJan Tojnar2023-01-281-1/+1
| | | | | | | | When sysprof-4 and libsysprof-capture-4 are installed into different prefixes, such as with Nix package manager, the D-Bus interfaces are likely not discoverable from the latter package. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2572>
* cogl/frame: Keep track of target presentation timeJonas Ådahl2023-01-232-0/+15
| | | | | | It's yet to be used for anything, but will later on. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2795>
* cogl/texture: Add support for sized textures with explicit formatNaveen Kumar2022-12-177-11/+74
| | | | | | | Add API that introduce a method to allocate 2d textures given a passed pixel format (e.g. xrgb210101010). Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2461>
* cogl/driver/gles: Handle reading RGBA1010102 tooJonas Ådahl2022-12-171-0/+7
| | | | | | | This means can read without loosing precision, compared to if we read a texture as rgb8. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2461>
* cogl/framebuffer/gl: Move most read restriction to driversJonas Ådahl2022-12-176-20/+54
| | | | | | | | | | OpenGL requires more hand holding in the driver regarding what pixel memory layouts can be written when calling glReadPixels(), compared to GLES2. Lets move the details of this logic to the corresponding backends, so in the future, the GLES2 backend can be adapted to handle more formats, without placing that logic in the generic layer. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2461>
* cogl/driver/gles: Fix RGB10 GL formatsJonas Ådahl2022-12-171-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | COGL_PIXEL_FORMAT_ABGR_2101010 is defined to mean the 2 A bits are placed in a 32 bit unsigned integer on the bits with highest significance, followed by B on the following 10 bits, and so on, until R on the 10 least significant bits. UNSIGNED_INT_2_10_10_10_REV_EXT is defined to represent color channels as ``` 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ------------------------------------------------------------------------------------- | a | b | g | r | ------------------------------------------------------------------------------------- ``` As can be seen, this matches COGL_PIXEL_FORMAT_ABGR_2101010, meaning that's the format we can directly read and write. In Cogl, when finding the GL formats, we get the tuple with the GL format given the format we pass, but we also get returned "required format" (CoglPixelFormat). This required format represents the format that is required when reading actual pixels from GLES. In GLES, the above mentioned format is the only one supported by the EXT_texture_type_2_10_10_10_REV extension, thus for other types, we need to do the CPU side conversion ourselves. To achieve this, correctly return COGL_PIXEL_FORMAT_ABGR_2101010 as the required format. The internal format should also be GL_RGB10_A2, not GL_RGBA. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2461>
* cogl/pipeline: Simplify cogl_pipeline_get_layer_filtersMichel Dänzer2022-12-151-8/+1
| | | | | | By using _cogl_pipeline_layer_get_filters. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2757>
* cogl/pipeline: Rename and export cogl_pipeline_get_layer_filtersMichel Dänzer2022-12-153-10/+20
| | | | | | | | | | | For symmetry with cogl_pipeline_set_layer_filters. Suggested by Jonas Ådahl. v2: * Align function parameters. (Jonas Ådahl) Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2757>
* cogl/pipeline: Remove cogl_pipeline_get_layer_min/mag_filterMichel Dänzer2022-12-152-62/+0
| | | | | | | | | | | | | | | | | | | | | | | | Unused since https://gitlab.gnome.org/GNOME/mutter/merge_requests/932 AFAICT. As a bonus, gets rid of these compiler warnings: ../cogl/cogl/cogl-pipeline-layer-state.c: In function ‘cogl_pipeline_get_layer_min_filter’: ../cogl/cogl/cogl-pipeline-layer-state.c:1279:10: warning: ‘min_filter’ may be used uninitialized [-Wmaybe-uninitialized] 1279 | return min_filter; | ^~~~~~~~~~ ../cogl/cogl/cogl-pipeline-layer-state.c:1274:22: note: ‘min_filter’ was declared here 1274 | CoglPipelineFilter min_filter; | ^~~~~~~~~~ ../cogl/cogl/cogl-pipeline-layer-state.c: In function ‘cogl_pipeline_get_layer_mag_filter’: ../cogl/cogl/cogl-pipeline-layer-state.c:1291:10: warning: ‘mag_filter’ may be used uninitialized [-Wmaybe-uninitialized] 1291 | return mag_filter; | ^~~~~~~~~~ ../cogl/cogl/cogl-pipeline-layer-state.c:1287:22: note: ‘mag_filter’ was declared here 1287 | CoglPipelineFilter mag_filter; | ^~~~~~~~~~ Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2757>
* g-i: Drop unneeded since/stability annotationsBilal Elmoussaoui2022-11-2243-978/+0
| | | | | | They are no longer useful since the merge of cogl inside mutter Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2708>
* docs/cogl-pango: Make use of gi-docgen annotationsBilal Elmoussaoui2022-11-222-19/+11
| | | | Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2708>
* cogl: Set LOD bias to -0.5 for single mipmap modesDaniel van Vugt2022-11-049-0/+56
| | | | | | | | | So that whenever forced to choose between two levels of detail (two mipmaps) we will land on the sharpest looking one (highest resolution). That's the mipmap level equal to the floor of the current level of detail requested. Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5920 Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2644>
* cogl/trace: Don't enable/disable in idle callback if thread matchesJonas Ådahl2022-11-011-13/+28
| | | | | | | This makes it possible to start profiling immediately on startup, during context/backend/display setup, as well as flush during tear down. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2678>
* cogl/texture: Type check introspected callsJonas Ådahl2022-09-201-10/+36
| | | | | | | | | | CoglTexture can be used by e.g. Javascript, and the convention is to be more forgiving regarding passed input so that invalid Javascript calls doesn't cause actual SIGSEGV/SIGABRT. As elsewhere, do this by sprinkeling g_return(_val)_if_fail() on introspected functions. Related: https://bugzilla.redhat.com/show_bug.cgi?id=2124322 Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2616>
* cogl: Don't check glGetError for functions that don't return errorsDaniel van Vugt2022-09-192-3/+3
| | | | | | This will at least make debug builds a tiny bit faster. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2615>
* cogl: Add a quirk on Mali to glFlush before glGenerateMipmapDaniel van Vugt2022-09-193-0/+14
| | | | | | | | | | But only when the texture in question has associated framebuffers that actually need flushing. Workaround for: https://github.com/Xilinx/mali-userspace-binaries/issues/3 Related to: https://gitlab.gnome.org/GNOME/mutter/-/issues/2354 Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2614>
* cogl: Remove the now unused test frameworkJonas Ådahl2022-08-0815-1420/+1
| | | | | | All tests have been moved into src/tests/, so no need for it anymore. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
* cogl/pipeline/vertend/glsl: Move out unit test to its own fileJonas Ådahl2022-08-082-59/+13
| | | | | | Fix a memory leak while at it. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
* cogl/pipeline/glsl: Distinguish between pipeline state typesJonas Ådahl2022-08-082-37/+37
| | | | | | | | | | Both the fragend and vertend shader state was called "CoglPipelineShaderState", which was rather annoying, especially when the type needs to be exposed outside of the .c file as part of moving out unit tests. Make the types unique. This also avoids confusing what type one is looking at. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
* cogl/pipeline/opengl: Move out unit test to separate fileJonas Ådahl2022-08-082-35/+1
| | | | | | | Also rename the suffix to "-glsl" to not confuse OpenGL with GLES2 since this test covers both. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
* cogl/pipeline-state: Move out working unit test to separate fileJonas Ådahl2022-08-081-38/+0
| | | | Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
* cogl/pipeline-state: Move out failing test to its own fileJonas Ådahl2022-08-081-35/+0
| | | | | | | | This test is a known failure, so mark it as such. It's stored in its own file since keeping it in the same as the passing test isn't markable using meson. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
* cogl/pipeline-cache: Move unit test to its own fileJonas Ådahl2022-08-083-93/+50
| | | | Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
* cogl: Move out bitmask unit test to separate fileJonas Ådahl2022-08-082-179/+9
| | | | Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
* tests/cogl: Add unit test frameworkJonas Ådahl2022-08-081-0/+1
| | | | | | | | | | It consists of only a macro and build description logic. Adds a macro for simpler tests that doesn't require a context; unit tests requiring a context should use the same framework as conform tests. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
* cogl: Remove now empty conform test suiteJonas Ådahl2022-08-0813-1476/+0
| | | | | | | | All working tests have already migrated to the test suite using mutter; move the old unported tests over too, and remove the conform test framework, as it is no longer used. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
* tests/cogl: Migrate fence testJonas Ådahl2022-08-084-64/+0
| | | | Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
* tests/cogl: Migrate texture rg testJonas Ådahl2022-08-084-79/+0
| | | | Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
* tests/cogl: Migrate pipeline shader state testJonas Ådahl2022-08-084-98/+0
| | | | Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
* tests/cogl: Migrate texture no allocate testJonas Ådahl2022-08-084-67/+0
| | | | Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
* tests/cogl: Migrate pipeline cache unrefs texture testJonas Ådahl2022-08-084-95/+0
| | | | Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
* tests/cogl: Migrate copy/replace texture testJonas Ådahl2022-08-084-125/+0
| | | | Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
* tests/cogl: Migrate primitive and journal testJonas Ådahl2022-08-084-124/+0
| | | | Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
* tests/cogl: Migrate framebuffer bits testJonas Ådahl2022-08-084-47/+0
| | | | Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
* tests/cogl: Migrate texture get/set data testJonas Ådahl2022-08-084-148/+0
| | | | Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
* tests/cogl: Migrate alpha texture testJonas Ådahl2022-08-084-127/+0
| | | | Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
* tests/cogl: Migrate npot texture testJonas Ådahl2022-08-084-164/+0
| | | | Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
* tests/cogl: Migrate map buffer range testJonas Ådahl2022-08-084-128/+0
| | | | Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
* tests/cogl: Migrate alpha test testJonas Ådahl2022-08-084-78/+0
| | | | Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
* tests/cogl: Migrate layer remove testJonas Ådahl2022-08-084-149/+0
| | | | Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
* cogl: Remove versionJonas Ådahl2022-08-087-171/+0
| | | | | | | The cogl version was unused, and not relevant, as the version and API is tied to the mutter API version, not the old pre fork cogl version. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>