1
0
Fork 0
Commit graph

2959 commits

Author SHA1 Message Date
Bilal Elmoussaoui
3fcff05847 cogl/pango: Remove no longer needed version check
We require pango 1.46 nowadays

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3491>
2024-01-05 14:22:22 +01:00
Bilal Elmoussaoui
f20cb09f34 cogl: Generate a GType for Buffer{BindTarget|UpdateHint}
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3357>
2024-01-05 12:25:00 +00:00
Bilal Elmoussaoui
3280fee8bc cogl: Make BufferBindTarget public
It would be used in the next commit to generate a gtype and
be used for Buffer::default-target

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3357>
2024-01-05 12:25:00 +00:00
Bilal Elmoussaoui
63a558950b cogl: Generate a GType for PixelFormat
So that CoglTexture uses the proper pspec type for it format property

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3357>
2024-01-05 12:25:00 +00:00
Sebastian Wick
985e93f9fa cogl/cpu-caps: Build cpuid and xgetbv only for x86_64
This also adds the cpuid functionality inline and checks for GCC ASM
flag output support.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3226
Fixes: 3bf6de60b ("cogl: Add CPU capability detection helper")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3488>
2024-01-04 16:45:37 +00:00
Bilal Elmoussaoui
7f1b890df1 cogl: Add missing new block in switch case
Closes #3226
Fixes: 6efd4a228 ("cogl/cleanup: Use construct-only properties for
CoglBuffer")

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3478>
2024-01-04 15:51:52 +00:00
Bilal Elmoussaoui
a72f44132d build: Make use of defined req variables
Closes https://gitlab.gnome.org/GNOME/mutter/-/issues/752

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3482>
2024-01-03 12:09:46 +00:00
Sebastian Wick
e40a256584 cogl/pixel-format: Support 16 bpc UNORM formats
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3371>
2023-12-20 23:51:14 +00:00
Bilal Elmoussaoui
05cd7bc6cb cogl: Remove unused Buffer:usage-hint
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3437>
2023-12-13 11:20:04 +00:00
Bilal Elmoussaoui
bc44d2855b cogl: Initialize first_index_to_prune
I don't know how come that the compiler wasn't complaining about it till now

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3437>
2023-12-13 11:20:04 +00:00
Bilal Elmoussaoui
6b29371db3 cogl: Remove unused private functions
The commit also moves certain functions from the private header
as they are not used anywhere else and removes COGL_EXPORT
when the function is supposed to be private and is not used outside of
cogl

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3437>
2023-12-13 11:20:04 +00:00
Bilal Elmoussaoui
5d9e9707dd cogl: Remove unused CoglPipelineEvalFlags
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3437>
2023-12-13 11:20:04 +00:00
Robert Mader
7454287d3b cogl/gles: Fix GL_OES_rgb8_rgba8 check
Fixes: bbf2d83e94 ("cogl/gles: Require OES_rgb8_rgba8 to have color-renderable 8bpc formats")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3451>
2023-12-11 23:28:24 +01:00
Sebastian Wick
60c082caaf cogl/bitmap-conversion: Support packing fp16 formats
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3441>
2023-12-06 23:01:02 +01:00
Sebastian Wick
e6eed4f32c cogl: Add a fp32 format for pixel read-back
We will also require GL_OES_texture_half_float and GLES 3.0 to enable
COGL_FEATURE_ID_TEXTURE_HALF_FLOAT. This gives us float types and makes
it possible to read pixels from framebuffers with internal floating
point formats (into float, half is never supported).

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3441>
2023-12-06 23:00:49 +01:00
Jonas Ådahl
568506ecbe cogl: Add half float implementation
This implementation is copied from mesa.

It uses x86_64 assembler on CPUs where it's supported, otherwise falls
back on a software implementation (cogl-soft-float.c). It's intended to
be used for packing and unpacking f16 format bitmaps.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3441>
2023-12-06 21:18:11 +01:00
Jonas Ådahl
3bf6de60bb cogl: Add CPU capability detection helper
This will be needed to support the fast half float implementations.
Copied from mesa and adapted.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3441>
2023-12-06 21:18:11 +01:00
Jonas Ådahl
8420692d3e cogl: Add soft-float software implementation
The implementation comes from mesa, which came from Berkeley SoftFloat
3e Library.

The software float implementation will be used to convert from and to
half floating point pixel format bitmaps, when no the CPU isn't capable
of the conversion.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3441>
2023-12-06 21:18:11 +01:00
Jonas Ådahl
68788d0e75 cogl/bitmap-conversion: Use enum for medium type
The type of the intermediate medium for storing pixel channels is
changed from "is 8 or 16 bit" to an enum, and switch cases. This doesn't
add support for anything, but will make adding a "float" medium type
less intrusive.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3441>
2023-12-06 21:18:11 +01:00
Sebastian Wick
64f4415f28 cogl/gl: Use CPU packing/unpacking for opaque fp16 formats
There is no internal fp16 format which has no alpha which means we would
get garbage alpha when reading the framebuffer directly. We have to use
the packing/unpacking to always get the alpha of 1.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3441>
2023-12-06 21:18:11 +01:00
Sebastian Wick
9c219db9fe cogl/pixel-format: Re-order pixel formats to be consistent
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3441>
2023-12-06 21:18:11 +01:00
Sebastian Wick
d90c2ab2a0 cogl: Determine glReadPixels format based on framebuffer format
Which gltype and glformat are allowed for a given gl framebuffer depends
on the internal gl framebuffer format. Either the format we want to read
into matches the gltype, glformat and doesn't need CPU packing from
another format or we have to use a tmp buffer with a format that matches
the GL requirements.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3441>
2023-12-06 21:18:11 +01:00
Sebastian Wick
07bfb24312 cogl/gles2: Only support rgba1010102 on little endian systems
We already check for this in various places but we still advertised this
feature when it's not actually supported.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3441>
2023-12-06 21:07:29 +01:00
Sebastian Wick
dc3866adf4 cogl/bitmap-conversion: Fix packing 8bpc opaque alpha
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3441>
2023-12-06 21:07:29 +01:00
Jonas Ådahl
80daaac438 cogl/build: Sort source files
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3441>
2023-12-06 21:07:29 +01:00
Ivan Molodetskikh
1f22b3a2e2 cogl/trace: Add COGL_TRACE_MESSAGE
Emits a formatted message at the current time without a duration.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3417>
2023-12-06 16:12:58 +00:00
Ivan Molodetskikh
bed42454d3 cogl/trace: Make COGL_TRACE_DESCRIBE append
Sometimes it's useful to combine the description from multiple places.
For example, a subsequent commit will add the output name as the first
thing to the frame clock span descriptions, leaving the rest of the
description with complex checks unchanged.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3417>
2023-12-06 16:12:58 +00:00
Ivan Molodetskikh
c897302f87 cogl/framebuffer: Add trace spans to flush and finish
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3417>
2023-12-06 16:12:58 +00:00
Ivan Molodetskikh
03252fefa3 cogl/journal: Add trace span to flush
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3417>
2023-12-06 16:12:58 +00:00
Jonas Ådahl
05efc92084 cogl/pipeline/glsl: Add line numbers to displayed source
When running with COGL_DEBUG=show-source include line numbers so that it
becomes easier to understand compilation errors.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3443>
2023-12-06 13:45:03 +00:00
Sebastian Wick
7f943613a8 cogl: Use sized internal renderable formats
Using sized internal formats is required to make sure we actually get
the precision that we want.

The formats should also be renderable, otherwise they can not be used as
a framebuffer attachment. For GLES we have to check for a bunch of
extensions and fall back to internal formats with more bits when they
are not available.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3429>
2023-12-05 08:47:11 +00:00
Sebastian Wick
bbf2d83e94 cogl/gles: Require OES_rgb8_rgba8 to have color-renderable 8bpc formats
In GLES 2.0 the required color-renderable formats to support to not
include 8bpc RGB/RGBA formats. The extension adds this requirement and
makes GLES 2.0 actually useable. Not specifying a gl internal format in
Cogl so far has hidden the problem and let the implementation fall back
to RGB585 for example.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3429>
2023-12-05 08:47:11 +00:00
Sebastian Wick
f77d95c9ae cogl: Make FP16 and RGBA1010102 public features
Also be more strict about what we consider RGBA1010102 support. Before
GLES 3.0, using ReadPixels on a framebuffers with format RGB10_A2 was
not possible with type GL_UNSIGNED_INT_2_10_10_10_REV_EXT and thus our
code to read back pixels could fail.

Users of cogl should check those feature flags before using FP16 and
RGBA1010102 pixel formats via CoglFeatureIDs:
 * COGL_FEATURE_ID_TEXTURE_RGBA1010102
 * COGL_FEATURE_ID_TEXTURE_HALF_FLOAT

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3429>
2023-12-05 08:47:11 +00:00
Sebastian Wick
5d0fc6d8c1 cogl: Remove unused COGL_PIXEL_FORMAT_DEPTH_32
It's not depth-renderable or required to be supported and we don't use
it anyway, so just get rid of it.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3429>
2023-12-05 08:47:11 +00:00
Qiu Wenbo
48515d917c cogl: Fix memory allocation of CoglGLContext
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3440>
2023-12-04 16:54:05 +08:00
Bilal Elmoussaoui
46da153548 cogl: Various g-i fixes
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3431>
2023-11-29 12:07:36 +01:00
Bilal Elmoussaoui
79846ff263 cogl: Remove no longer needed build check
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3431>
2023-11-29 12:00:07 +01:00
Bilal Elmoussaoui
85e4d08475 cogl: Remove unused utils
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3431>
2023-11-29 11:53:03 +01:00
Daniel van Vugt
1c2decbeb5 cogl/egl: Don't log "EGL color depth" anymore
Since e437c854cd `config` no longer represents the current config
but rather the fallback config that in most cases isn't being used. So
reporting on its attributes is now misleading.

Logging the current depth can instead now be done with MUTTER_DEBUG=kms
and grepping for "KMS: Using GBM format".

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3174
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3421>
2023-11-27 14:12:38 +00:00
Michel Dänzer
e1f795ff79 onscreen/native: Add and use choose_onscreen_egl_config helper
If the EGL_KHR_no_config_context extension is supported, use it to
choose a format per onscreen which is compatible with the scanout CRTC
and the GL rendering API used.

Suggested by Jonas Ådahl.

v2:
* Drop code which checked for GLES3 renderability. Makes no sense for
  various reasons, in particular that EGLconfigs are about EGLSurfaces,
  whereas secondary GPU contexts use an FBO for blitting.
* Use error parameter directly for meta_renderer_native_choose_gbm_format
  call (Jonas Ådahl)

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3139>
2023-11-23 20:11:31 +00:00
Michel Dänzer
e437c854cd cogl/egl: Add COGL_EGL_WINSYS_FEATURE_NO_CONFIG_CONTEXT
If the EGL_KHR_no_config_context extension is supported, pass
EGL_NO_CONFIG_KHR to eglCreateContext. This will allow binding the
context to surfaces created with different configs.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3139>
2023-11-23 20:11:30 +00:00
Michel Dänzer
dc57aa6d97 cogl/egl: Fix coding style of CoglEGLWinsysFeature definition
To prevent the check-style.py script from complaining about the next
commit.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3139>
2023-11-23 20:11:30 +00:00
Ivan Molodetskikh
2d1fc65b3a Adjust COGL_TRACE names to improve automatic processing
In profilers with a timeline or flame graph views it is a very common
scenario that a span name must be displayed in an area too short to fit
it. In this case, profilers may implement automatic shortening to show
the most important part of the span name in the available area. This
makes it easier to tell what's going on without having to zoom all the
way in.

The current trace span names in Mutter don't really follow any system
and cannot really be shortened automatically.

The Tracy profiler shortens with C++ in mind. Consider an example C++
name:

SomeNamespace::SomeClass::some_method(args)

The method name is the most important part, and the arguments with the
class name will be cut if necessary in the order of importance.

This logic makes sence for other languages too, like Rust. I can see it
being implemented in other profilers like Sysprof, since it's generally
useful.

Hence, this commit adjusts our trace names to look like C++ and arrange
the parts of the name in the respective order of importance.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3402>
2023-11-22 11:46:07 +00:00
Ivan Molodetskikh
77bbe44251 cogl/trace: Remove unused cogl_is_tracing () declaration
Introduced in ab39eaf131 but never
defined.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3409>
2023-11-20 12:29:37 +00:00
Bilal Elmoussaoui
1ce1745384 cogl: Remove duplicated build options check
Meson already has a check for ensuring that either GL or GLES 2 is
enabled
at build time

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3405>
2023-11-17 11:24:23 +00:00
Bilal Elmoussaoui
c632e29ec0 cogl: Don't use a separate file for egl defines
The file doesn't do anything special to require a special header

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3405>
2023-11-17 11:24:23 +00:00
Bilal Elmoussaoui
a8f77750fd cogl: Stop auto generating gl/egl headers
They contain nothing that requires generating those headers
automatically
so simplify the whole thing

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3405>
2023-11-17 11:24:23 +00:00
Bilal Elmoussaoui
f081d4b595 cogl: Remove unused files
Fallout of https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3368

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3405>
2023-11-17 11:24:23 +00:00
Ivan Molodetskikh
47814fab71 Remove COGL_TRACE_BEGIN in favor of BEGIN_SCOPED
Scoped traces are less error prone, and they can still be ended
prematurely if needed (this commit makes that work). The only case this
doesn't support is starting a trace inside a scope but ending outside,
but this is pretty unusual, plus we have anchored traces for a limited
variation of that.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3396>
2023-11-15 13:57:43 +00:00
Bilal Elmoussaoui
f5dac3a5d9 build: One config file to rule them all
Group all the three config files from clutter/cogl/meta into one
and also remove unnused configurations and replace duplicated ones

This also fixes Cogl usage of HAS_X11/HAS_XLIB to match the expected
build options

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3368>
2023-11-15 12:00:19 +00:00
Ivan Molodetskikh
ebba651c81 cogl/trace: Add check for failed sysprof context creation
This can fail for example when passing an invalid filename to
mutter --profile, which leads to assertion failures down the line.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3397>
2023-11-15 11:46:19 +00:00
Bilal Elmoussaoui
5fe3d13db5 cogl/pango: Drop no longer useful file
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3374>
2023-11-09 15:16:16 +00:00
Bilal Elmoussaoui
bb3de27621 cogl/cleanup: Drop unnused private structs
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3374>
2023-11-09 15:16:16 +00:00
Sebastian Keller
61de313198 cogl: Unconditionally free pipeline shader/program state cache struct
destroy_shader_state()/destroy_program_state() are called when the qdata
pointer to the state cache structure gets overwritten, but were only
conditionally destroying it. This lead to leaks when called with a
shader/program state ref count > 1.

Fixes: 9b9e12edb ("cogl: Port Node/Pipeline/PipelineLayer away from CoglObject")
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3141
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3366>
2023-11-07 10:15:57 +00:00
Sebastian Wick
5dbb6c31e9 cogl: Rename COGL_PIXEL_FORMAT_G_16 with COGL_PIXEL_FORMAT_R_16
Mechanical rename. The format already describes the first two (rg/xy)
components.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3276>
2023-11-04 00:11:52 +00:00
Sebastian Wick
764d5dd67b cogl: Rename COGL_PIXEL_FORMAT_G_8 with COGL_PIXEL_FORMAT_R_8
Mechanical rename. The format already describes the first (r/x)
component.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3276>
2023-11-04 00:11:52 +00:00
Bilal Elmoussaoui
51abbb5d4f cogl: Remove unnused include macro usage
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3349>
2023-11-03 11:36:07 +00:00
Bilal Elmoussaoui
7a6a821ed0 cogl: Drop unnused experimental API config
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3349>
2023-11-03 11:36:07 +00:00
Bilal Elmoussaoui
655b4a9c75 Port to MtkRegion
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3292>
2023-11-03 11:27:52 +00:00
Bilal Elmoussaoui
c01ffdb8ba cogl/gir: Depend explicitly on Mtk
As it is used now for MtkRegion types making the GIR file not containing
the relevant dependency and not being able to resolve MtkRegion type

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3292>
2023-11-03 11:27:52 +00:00
Bilal Elmoussaoui
ac2f6e8b9e cogl: Reduce the usage of _COGL_GET_CONTEXT
In cases where we already have the context where the function ends up
being called

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3353>
2023-11-02 15:17:49 +00:00
Bilal Elmoussaoui
2c4968fb41 cogl: Port Primitive away from CoglObject
- The associated CoglAttribute's are now stored in GPtrArray as suggested
by carlosg in
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3193?commit_id=19b619073b3c7d311c64e0a997558f943b38c94a#note_1849281
- cogl_primitive_set_attributes was dropped for "simplicity"
especially that nothing uses it.
- As this is the last remaining CoglObject subclass, the commit also drops
all the CoglObject related macros/types

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3193>
2023-10-29 21:16:24 +00:00
Bilal Elmoussaoui
b4bd69e4e8 cogl/cleanup: Replace CoglUserDataDestroyCallback with GDestroyNotify
It is just a typedef

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3193>
2023-10-29 21:16:24 +00:00
Bilal Elmoussaoui
b044e26e62 cogl: Drop no longer used user data helpers
This also drops the test-object conform test as it doesn't do anything
interesting and the gobject qdata functionnality is already well tested
across the platform

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3193>
2023-10-29 21:16:24 +00:00
Bilal Elmoussaoui
9b9e12edb2 cogl: Port Node/Pipeline/PipelineLayer away from CoglObject
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3193>
2023-10-29 21:16:24 +00:00
Bilal Elmoussaoui
80ce052a47 cogl/node: Stop taking a custom unparent function
As all the use cases end up chaining up anyways

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3193>
2023-10-29 21:16:24 +00:00
Bilal Elmoussaoui
6efd4a2282 cogl/cleanup: Use construct-only properties for CoglBuffer
Instead of a custom initialize function

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3193>
2023-10-29 21:16:24 +00:00
Bilal Elmoussaoui
739c59fefc cogl: Port Buffer* away from CoglObject
Make CoglBuffer an abstract class and inherit the various Cogl*Buffer types from it.
As none of the subclasses is overriding the vtable functions, they were not turned into
vfuncs but plain function pointers in CoglBuffer.
We still use _cogl_buffer_initialize until we port the various params into actual construct-only
properties, similar to the previous commit for CoglTexture.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3193>
2023-10-29 21:16:24 +00:00
Bilal Elmoussaoui
1d47e809e4 cogl/cleanup: Use construct-only properties instead of a custom init function
It only made sense pre-GObjectified Texture types

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3193>
2023-10-29 21:16:24 +00:00
Bilal Elmoussaoui
863163cc6e cogl: Port Texture* away from CoglObject
- Make Texture a parent GObject class and move the vtable funcs as vfuncs
instead of an interface as we would like to have dispose free the TextureLoader.
- Make the various texture sub-types inherit from it.
- Make all the sub-types constructors return a CoglTexture instead of their respective
specific type. As most of the times, the used functions accept a CoglTexture,
like all the GTK widgets constructors returning GtkWidget.
- Fix up the basics of gi-docgen for all these types.
- Remove CoglPrimitiveTexture as it is useless: It is just a texture underhood.
- Remove CoglMetaTexture: for the exact same reason as above.
- Switch various memory management functions to use g_ variant instead of the cogl_ one

Note we would still want to get rid of the _cogl_texture_init which is something
for the next commit

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3193>
2023-10-29 21:16:24 +00:00
Bilal Elmoussaoui
586c43d5a9 clutter/cogl: Use more of memory management helpers
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3193>
2023-10-29 21:16:24 +00:00
Bilal Elmoussaoui
75023d96bc cogl: Port Renderer away from CoglObject
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3193>
2023-10-29 21:16:24 +00:00
Bilal Elmoussaoui
4792db371a cogl/cleanup: Stop using CoglHandle
We use a GParamSpecPointer for CoglPipeline until that
gets ported from CoglObject

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3193>
2023-10-29 21:16:24 +00:00
Bilal Elmoussaoui
c8b4568973 cogl: Drop no longer used define boxed macro
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3193>
2023-10-29 21:16:24 +00:00
Bilal Elmoussaoui
93216b3c11 cogl: Port MatrixEntry from Cogl boxed type
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3193>
2023-10-29 21:16:24 +00:00
Bilal Elmoussaoui
686081077a cogl: Port Journal away from CoglObject
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3193>
2023-10-29 21:16:24 +00:00
Bilal Elmoussaoui
82ca43c3b6 cogl: Port (OnscreenDirtyClosure|FrameClosure) away from Cogl boxed type
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3193>
2023-10-29 21:16:24 +00:00
Bilal Elmoussaoui
60dbceac4f cogl/object: Drop no longer used Handle macros
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3193>
2023-10-29 21:16:24 +00:00
Bilal Elmoussaoui
bbdc0b42fc cogl: Port Program away from CoglObject
This also switches from using CoglHandle to CoglProgram where
appropriate
which allowed dropping a duplicated function that had the wrong
signature...

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3193>
2023-10-29 21:16:24 +00:00
Bilal Elmoussaoui
3aaae11d6b cogl: Port Shader away from CoglObject
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3193>
2023-10-29 21:16:24 +00:00
Bilal Elmoussaoui
c1e6948e42 cogl: Port Bitmap away from CoglObject
We still need to use set_qdata_full as CoglBitmapPixbuf would free
the data itself by unrefing the pixbuf

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3193>
2023-10-29 21:16:24 +00:00
Bilal Elmoussaoui
3c6c6a0ea5 cogl: Port Output away from CoglObject
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3193>
2023-10-29 21:16:24 +00:00
Bilal Elmoussaoui
946b6c945a cogl: Port Color to GBoxed
Also removes a part of the docs in the private structure as it ends up
being detected as the docs for the public structure causing conflict

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3193>
2023-10-29 21:16:24 +00:00
Bilal Elmoussaoui
4afc187062 cogl: Port MatrixStack away from CoglObject
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3193>
2023-10-29 21:16:24 +00:00
Bilal Elmoussaoui
d71fe5c55e cogl: Port OnscreenTemplate away from CoglObject
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3193>
2023-10-29 21:16:24 +00:00
Bilal Elmoussaoui
df8ae83040 cogl: Port Indices away from CoglObject
Also renames Indices.get_type to Indices.get_indices_type to avoid
a conflict with the generated Object.get_type function

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3193>
2023-10-29 21:16:24 +00:00
Bilal Elmoussaoui
4ea3593ebf cogl: Port Atlas away from CoglObject
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3193>
2023-10-29 21:16:24 +00:00
Bilal Elmoussaoui
f0923aab44 cogl: Port Attribute away from CoglObject
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3193>
2023-10-29 21:16:24 +00:00
Bilal Elmoussaoui
9d71949b26 cogl: Port SwapChain away from CoglObject
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3193>
2023-10-29 21:16:24 +00:00
Bilal Elmoussaoui
312d5c367e cogl: Port Snippet away from CoglObject
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3193>
2023-10-29 21:16:24 +00:00
Bilal Elmoussaoui
1da42dc3c0 cogl: Port Context away from CoglObject
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3193>
2023-10-29 21:16:24 +00:00
Bilal Elmoussaoui
0f54700101 cogl: Port Display away from CoglObject
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3193>
2023-10-29 21:16:24 +00:00
Bilal Elmoussaoui
748c1fb9f4 cogl: Port FrameInfo away from CoglObject
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3193>
2023-10-29 21:16:24 +00:00
Robert Mader
de8f69c787 cogl: Clean up HAVE_COGL_GL(ES2) checks
These were leftovers from times when GL(ES) 1.x was still supported.
As we require HAVE_COGL_GL and/or HAVE_COGL_GLES2 to be defined, all
cases for checking both are now redundant.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3338>
2023-10-27 16:13:37 +00:00
Robert Mader
81c6269ca7 cogl/driver/gl: Clean up pre-3.1 checks
They were just leftovers from times when we didn't require a 3.1
context.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3338>
2023-10-27 16:13:37 +00:00
Robert Mader
898044b9a5 cogl/driver: Remove pixel_format_from_gl_internal
It's unused.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3338>
2023-10-27 16:13:37 +00:00
Robert Mader
26c3686162 cogl: Remove some unused files
Note that the .gitignore may prevented other files from being removed in
older checkouts.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3338>
2023-10-27 16:13:37 +00:00
Michel Dänzer
e3749ac871 Remove unused _cogl_texture_2d_nop_* functions
Never used in mutter AFAICT.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3178>
2023-10-26 09:49:29 +00:00
Michel Dänzer
3f0184982d Remove unused _cogl_poll_renderer_remove_source
Never used in mutter AFAICT.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3178>
2023-10-26 09:49:29 +00:00
Michel Dänzer
e803e7718d Remove unused _cogl_poll_renderer_modify_fd
Unused since 865da1457a ("renderer: drop wayland client support").

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3178>
2023-10-26 09:49:29 +00:00