1
0
Fork 0
Commit graph

3089 commits

Author SHA1 Message Date
Bilal Elmoussaoui
60edafe3eb cogl/pango: Drop mipmapping API/env variables
As GNOME Shell always sets that to FALSE anyways
This does not drop the separate caching whether the mipmapping is
disabled or not, in case shell wants to make use of that in the future

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3962>
2024-08-22 16:45:01 +00:00
Sebastian Wick
45dcfeb0cc cogl/gles: Revert to unsized GL_BGRA as internalformat for BGRA_8888
Using GL_BGRA8_EXT as internalformat for TexSubImage2D was not allowed
in the EXT_texture_format_BGRA8888 extension. This changed recently:

https://registry.khronos.org/OpenGL/extensions/EXT/EXT_texture_format_BGRA8888.txt

  1.4, 23/06/2024 Erik Faye-Lund: Add GL_BGRA8_EXT for ES 2.0 and later.

Mesa already supports this which is why 7f943613a8 ("cogl: Use sized
internal renderable formats") worked as intended. Technically spec
compliant and our CI had an up-to-date driver.

So while this is no bug, it's still not great because older drivers will
generate GL errors. This commit changes this specific format back to an
unsized internal format which means we could, in theory, get less than
8bpc framebuffers.

We can try to revert this commit when newer driver versions have
propagated far enough.

Fixes: 7f943613a8 ("cogl: Use sized internal renderable formats")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3954>
2024-08-16 14:24:38 +00:00
Sebastian Wick
ce5f97fde1 cogl/gles: Explain GLES2 requirement of matching internalformat & format
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3914>
2024-08-14 12:17:18 +00:00
Sebastian Wick
c3eb01e547 cogl/gles: Use the GL_BGRA8_EXT internalformat instead of the format
There is one define for the format (GL_BGRA_EXT) and one for the
internal format (GL_BGRA8_EXT). Use them appropriately.

This also adds defines to consistenly not use the _EXT postfix.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3914>
2024-08-14 12:17:18 +00:00
Sebastian Wick
d820fe030a cogl/gles: Use a premul required format for opaque fp16 Cogl formats
The opaque fp16 Cogl format variants need a required format that is
already premultiplied whereas the fp16 formats with an alpha channel can
be either straight or premult.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3914>
2024-08-14 12:17:18 +00:00
Sebastian Wick
41700d3cc7 cogl/gl: Use internal formats without alpha for non-alpha Cogl formats
The formats COGL_PIXEL_FORMAT_RGB_888 and COGL_PIXEL_FORMAT_BGR_888 for
the gl driver were using internal formats with an alpha channel.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3914>
2024-08-14 12:17:18 +00:00
Bilal Elmoussaoui
4ea693bc20 surface-actor: Pass damage area as MtkRectangle
All the corresponding calls ends up creating a rectangle anyways

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3945>
2024-08-13 14:08:48 +02:00
Michel Dänzer
61ae9eedb6 cogl: Update latest sync fd also from cogl_gl_framebuffer_flush/finish
This ensures that any drawing for screen casting is reflected in the
sync fd.

Fixes: 99209958b9 ("cogl: Store latest GPU work completed sync fd")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3946>
2024-08-13 09:52:34 +00:00
Marco Trevisan (Treviño)
07023b65bc cogl/color: Do not make cogl_color_free introspectable
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3925>
2024-08-06 01:27:12 -06:00
Marco Trevisan (Treviño)
d422cddc2e cogl/color: Ensure Cogl.Color.equal() is introspectable
We need to explicitly define the type, being a generic const pointer.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3925>
2024-08-06 01:23:55 -06:00
Jonas Ådahl
de76e007b5 cogl: Fix some whitespace issues
The removal of the onscreen template left some function definitions and
declarations incorrectly indented.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3923>
2024-08-05 21:31:43 +02:00
Sebastian Wick
c5e9f028b2 cogl: Provide backwards compat for GLSL version 140 shaders
We still use GLSL 100 syntax which means `varying`, `attribute` and
`gl_FragColor` but GLSL 140 wants us to use `in` and `out`. This
provides some simple `#define`s to make it still look like the GLSL 100
syntax is supported.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3907>
2024-08-05 17:57:11 +00:00
Sebastian Wick
ea696ae4b1 cogl: Repace codegen_boilerplate_buffer with a local variable
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3907>
2024-08-05 17:57:11 +00:00
Sebastian Wick
94806c98bf cogl: Derive GLSL version from major, minor and GL vs GLES
The GLSL version can be derived from the major and the minor, with the
exception that GLSL ES versions require the "es" suffix.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3907>
2024-08-05 17:57:11 +00:00
Sebastian Wick
e122943bcd cogl/gl: Check GLSL version and unify GL context version checks
This adds a check which makes sure that the required GLSL/GLSL ES
versions are supported.

It also splits out the GLES version check into its own function, just
like GL does.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3907>
2024-08-05 17:57:11 +00:00
Sebastian Wick
74917e1b07 cogl/gl: Use g_auto (GStrv) and g_autofree in more cases
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3907>
2024-08-05 17:57:11 +00:00
Bilal Elmoussaoui
5277e33d37 cogl: Remove no longer used OnscreenTemplate
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3915>
2024-08-05 15:47:29 +00:00
Bilal Elmoussaoui
3b386ba5d7 cogl: Remove no longer used FramebufferConfig
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3915>
2024-08-05 15:47:29 +00:00
Bilal Elmoussaoui
833070ab79 cogl: Remove need_stencil config
As it is always set to TRUE

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3915>
2024-08-05 15:47:29 +00:00
Bilal Elmoussaoui
41ec1aa0ca cogl: Remove use_stereo_stage config
Nothing sets it from the X11 backend API, so just get rid of it

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3915>
2024-08-05 15:47:29 +00:00
Bilal Elmoussaoui
a1828e7212 cogl: Remove samples_per_pixel config
It is only set through an undocumented env variable

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3915>
2024-08-05 15:47:29 +00:00
Bilal Elmoussaoui
b9269abaf5 cogl: Remove unused Error types
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3910>
2024-08-01 11:06:33 +00:00
Bilal Elmoussaoui
e43d9d7e75 cogl/indices: Add a IndicesType.get_size
To de-duplicate that code

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3910>
2024-08-01 11:06:33 +00:00
Bilal Elmoussaoui
609f7e3fe1 cogl: Remove unused OnScreenTemplate.set_samples_per_pixel
Not sure if we want to keep that env variable around

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3910>
2024-08-01 11:06:33 +00:00
Bilal Elmoussaoui
a71ad8e861 cogl/list: Remove unused API
Ideally, I think we might have to replace CoglList usage
as the over-complicated macros makes it hard to parse

But that is a task for another day

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3910>
2024-08-01 11:06:33 +00:00
Bilal Elmoussaoui
2d25b114e6 cogl/buffer: Use set_data helper
That ignores the error param, which is the behaviour
we always had. Changing that to propagate the error
would make the API ugly, so it is fine to remove?

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3910>
2024-08-01 11:06:33 +00:00
Bilal Elmoussaoui
beb9ecdbc4 cogl: Remove no longer useful Since annotation
Spotted in previous commit

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3910>
2024-08-01 11:06:33 +00:00
Bilal Elmoussaoui
a05caa6338 cogl/texture2d: Rename from_egl_image constructor
Similar to the from_egl_image_external one, to give it the correct
namespace

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3910>
2024-08-01 11:06:33 +00:00
Bilal Elmoussaoui
a9ec604eba cogl/renderer: Expose handle_event
As it was originally the function to be used before
making it private and providing safer wrappers around it for x11/win32.

Nowadays, it is only used in x11 and only internally in mutter, exposing
a 'safer' variant costs us exposing more of x11 renderer APIs without
much benefits.

With this change, the only internal xlib renderer we need from meta is
set_foreign_display which can't be easily worked around

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3910>
2024-08-01 11:06:33 +00:00
Bilal Elmoussaoui
b07c772fc8 cogl: Rename Shader/Program constructors
Otherwise they end up as global functions instead of constructors
of their corresponding types. Helps with better docs

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3910>
2024-08-01 11:06:33 +00:00
Bilal Elmoussaoui
716f23c7c1 cogl/pixel-format: Make CAN_HAVE_PREMULT an inlined function
To avoid exposing the function macro in the gir file & so the docs

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3910>
2024-08-01 11:06:33 +00:00
Bilal Elmoussaoui
162b8e1a15 cogl: Remove no longer useful UNAVAILABLE macro
It is no longer a separate library

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3910>
2024-08-01 11:06:33 +00:00
Bilal Elmoussaoui
5d7c4bccd8 cogl: Make BlendStringError private
It is a private API

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3910>
2024-08-01 11:06:33 +00:00
Bilal Elmoussaoui
4bd974222e cogl: Make RendererConstraint private
It is only used internally

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3910>
2024-08-01 11:06:33 +00:00
Bilal Elmoussaoui
50fc438599 cogl: Replace OnscreenDirtyInfo with MtkRectangle
It is a rectangle after all and is only used internally, so instead of
making it private just replace it

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3910>
2024-08-01 11:06:33 +00:00
Bilal Elmoussaoui
6b0a289d77 cogl: Make FramebufferDriverConfig private
There is 0 reason to expose that, it is a private API

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3910>
2024-08-01 11:06:33 +00:00
Bilal Elmoussaoui
b3404816fb cogl: Switch remaining headers to pragma once
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3910>
2024-08-01 11:06:33 +00:00
Bilal Elmoussaoui
6c1739ea1c cogl: Move get_graphics_status to Context
That is where it belongs & avoids a global function in the docs
when it shouldn't be one

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3910>
2024-08-01 11:06:33 +00:00
Bilal Elmoussaoui
97c43f9eec cogl/egl: Move get_egl_display to Context
Allows us to get rid of the extra header

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3910>
2024-08-01 11:06:33 +00:00
Bilal Elmoussaoui
e90d2e845e cogl/glib-source: Remove no longer useful API
It was only useful when Cogl was a separate library

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3910>
2024-08-01 11:06:33 +00:00
Bilal Elmoussaoui
5a6d2266e4 cogl/magazine: Remove unused free functions
The only magazine instance created is a static so nothing to be freed

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3910>
2024-08-01 11:06:33 +00:00
Bilal Elmoussaoui
47695daed1 cogl/xlib-renderer: Move struct where it is used
The extra header is too much for one struct

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3910>
2024-08-01 11:06:33 +00:00
Bilal Elmoussaoui
e57d3615bc cogl/xlib-renderer: Remove [add|remove]_filter
They end up calling the Renderer APIs & they are not used outside
of Cogl

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3910>
2024-08-01 11:06:33 +00:00
Bilal Elmoussaoui
0f405e9270 Rename remaining usages of material to pipeline
material is almost no longer used in the code base and the
few remaining references makes it confusing when looking at parts
of the codebase. So rename the rest as well.

Note that this renames a DeformEffect property and the only extension
making use of it doesn't use the property so i think it is okay to do
so without deprecating the old property for a few releases

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3910>
2024-08-01 11:06:33 +00:00
Bilal Elmoussaoui
a107cae976 cogl/atlas: Remove unused private function
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3910>
2024-08-01 11:06:33 +00:00
Bilal Elmoussaoui
5fde5abd3e cogl: Remove unnecessary compiler functions defines
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3910>
2024-08-01 11:06:33 +00:00
Bilal Elmoussaoui
7eadc948ae cogl: Inline various utilities
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3910>
2024-08-01 11:06:33 +00:00
Bilal Elmoussaoui
5f1ffb5304 cogl: Remove unused Primitive APIs
This also removes a clutter interactive test, but as those
tests don't serve that much any more for being no longer executed..

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3910>
2024-08-01 11:06:33 +00:00
Bilal Elmoussaoui
69d66eb82f cogl: Expose Atlas API
Needed to build cogl-pango out of tree

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3909>
2024-07-30 20:20:45 +00:00
Bilal Elmoussaoui
b035350ffd cogl: Replace RectangleMapEntry with MtkRectangle
Avoids exposing the former in the next commit even if MtkRectangle
uses signed integers compared to RectangleMapEntry. But as
those rectangles are defined inside of Cogl, it should be okay
I guess?

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3909>
2024-07-30 20:20:45 +00:00