Commit Graph

2485 Commits

Author SHA1 Message Date
Jonas Ådahl
4434a17d08 cogl/dma-buf-handle: Pass more metadata to handle constructor
Could be useful would one want to mmap the dmabuf and deal with its
content manually in CPU space.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1237
2020-05-26 13:54:27 +00:00
Daniel van Vugt
c5fbab6bad cogl: Add new function cogl_pipeline_set_layer_max_mipmap_level()
To configure an exact value of `GL_TEXTURE_MAX_LEVEL` clamped to within
the range of possible levels.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1003
2020-05-13 09:37:31 +00:00
Daniel van Vugt
f4301b77fa cogl: Generalize maybe_update_max_level() into set_max_level()
This way the caller can choose their own precondition.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1003
2020-05-13 09:37:31 +00:00
Daniel van Vugt
a3f27dfd89 cogl: Ensure GL_TEXTURE_MAX_LEVEL is set before using it
Just in case it was lower before. So that `upload_subregion_to_gl` is
not trying to upload to a disallowed mipmap level.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1003
2020-05-13 09:37:31 +00:00
Daniel van Vugt
73ce9c2e81 cogl: Replace an outdated #ifdef
The feature `GL_TEXTURE_MAX_LEVEL` it is hiding actually exists
in ES>=3.0, so the #ifdef is not appropriate.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1003
2020-05-13 09:37:31 +00:00
Daniel van Vugt
fd27c7c444 cogl: Delete a duplicate (masked) variable declaration
https://gitlab.gnome.org/GNOME/mutter/merge_requests/1003
2020-05-13 09:37:31 +00:00
Jonas Ådahl
753066598f clutter/view: Make it possible to assign a temporary direct scanout
Make it possible to cause the next frame to scan out directly from the
passed CoglScannout. This makes it possible to completely bypass
compositing for the following frame.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/798
2020-04-16 15:05:52 +02:00
Jonas Ådahl
3da8c1bfdc cogl/onscreen: Add API to scanout a buffer directly
Instead of always swapping buffers and flipping the back buffer, make it
possible to scan out a provided buffer directly without swapping any EGL
buffers.

A buffer is passed as an object implementing the empty CoglScanout
interface. It is only possible to do this in the native backend; and the
interface is implemented by MetaDrmBufferGbm. When directly scanned out,
instead of calling gbm_surface_lock_front_buffer() to get the gbm_bo and
fbid, get it directly from the MetaDrmBufferGbm, and use that to create
the page flip KMS update.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/798
2020-04-16 15:05:15 +02:00
Marco Trevisan (Treviño)
645d596f9d cogl: Use autopointers to free structs on return
This is a potential leak discovered by static analysis, in fact if
_COGL_GET_CONTEXT returns, the newly allocated struct isn't released.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1195
2020-04-12 21:40:20 +00:00
Adam Jackson
23d0bdd46d cogl: Remove unused fields from CoglContext
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1191
2020-04-09 11:48:03 -04:00
Carlos Garnacho
a5294ce55f cogl: Remove CoglPath and the tesselator
This was barely used, and doesn't represent the way we want to
do 2D rendering.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1126
2020-04-08 11:38:48 +02:00
Simon McVittie
c389aadff9 cogl: Defend against empty or unallocated framebuffers
It isn't immediately obvious that this is impossible, because there's some
"action at a distance" going on with framebuffers that have their size
set lazily, after their textures get allocated; so let's make this a
critical warning rather than crashing.

In particular, this works around a crash when gnome-shell tries to blur a
background that hasn't yet had any space allocated for it - which it seems
is really an actor layout bug, but more robustness seems good to have.

Workaround for <https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2538>.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1172

Signed-off-by: Simon McVittie <smcv@debian.org>
2020-04-03 10:32:02 +01:00
Simon McVittie
37eda498f2 cogl: Don't allow creating sized textures with 0 pixels
A texture with no pixels isn't a useful thing to have, and breaks
assumptions elsewhere. For example, CoglFramebuffer assumes that after
a texture has been allocated, it will have width and height both greater
than 0.

In particular, this works around a crash when gnome-shell tries to blur a
background that hasn't yet had any space allocated for it - which it seems
is really an actor layout bug, but more robustness seems good to have.

Workaround for <https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2538>.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1172

Signed-off-by: Simon McVittie <smcv@debian.org>
2020-04-03 10:31:54 +01:00
Carlos Garnacho
aa136f4515 cogl-pango: Special case alpha of 0 for color glyphs
Like ed10aea44d, but for color glyphs. Since they do use the alpha
component from the given color.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1161
2020-03-29 12:53:39 +00:00
Florian Müllner
8748841094 cogl: Export two more functions
cogl_object_[get|set]_value_object() are annotated as [get|set]-value-func
for objects and primitives, so they must be visible for any derived types
to be usable from introspection.

https://gitlab.gnome.org/GNOME/mutter/-/issues/1146
2020-03-29 12:17:11 +00:00
Florian Müllner
86f2885e98 cogl: Remove obsolete .map file
Obsolete since commit 6885c37784.

https://gitlab.gnome.org/GNOME/mutter/-/issues/1146
2020-03-29 12:17:11 +00:00
Carlos Garnacho
e8ea5ecd8a cogl-pango: Factor in default color alpha again
In commit d846fabda we moved to using the override color alpha, however
it was missed that the actor opacity is transferred to the PangoRenderer
through the default color alpha, and the reason it was used there.

We actually want to factor in both alpha values, in order to respect
both foreground color alpha and actor opacity. This is done on the
unpremultiplied color, so we just need to change the alpha value.

Fixes effects on text actors that involve actor opacity.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1158
2020-03-28 12:48:11 +01:00
Florian Müllner
ed10aea44d cogl-pango: Special case alpha of 0
pango_renderer_get_alpha() returns 0 to indicate that the alpha value
should be inherited from the environment, but we are passing it on
(and therefore making the text fully translucent).

Instead, make the text fully opaque as expected.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1156
2020-03-28 01:04:17 +01:00
Carlos Garnacho
d846fabda2 cogl-pango: Forward alpha from correct color
Use the override color alpha, if set.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1155
2020-03-27 23:33:38 +01:00
Carlos Garnacho
2d94a34a14 cogl-pango: Honor foreground alpha PangoAttribute
Instead of hardcoding 0xff as alpha, forward this attribute.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1155
2020-03-27 23:33:35 +01:00
Georges Basile Stavracas Neto
3956ffd5e8 cogl/driver: Remove GError from context_init
It is not used by anyone, let's just remove it.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1152
2020-03-27 09:01:43 -03:00
Georges Basile Stavracas Neto
05341221d4 cogl/renderer: Remove documentation of nonexistent enum
We don't want to delve into the philosohical study of the not-being,
so let's just not document an enum value that doesn't exist anymore.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1151
2020-03-26 18:44:13 -03:00
Georges Basile Stavracas Neto
95642d05a6 cogl/gl: Move shared functions to shared file
Cogl shares some GL functions between the GLES and the big
GL drivers. Namely, it shares _cogl_driver_gl_context_init
and _cogl_driver_gl_context_deinit between these two drivers.

The plot twist is: even though these functions are shared and
their prototypes are in cogl-util-gl-private.h, they're actually
implemented inside cogl-driver-gl.c, which is strictly only
about the big GL driver.

This is problematic when building Mutter on ARM v7, where we
need to disable OpenGL, but keep GLES enabled.

Fix this by moving the shared GL functions to a shared GL file.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1151
2020-03-26 18:43:32 -03:00
Jonas Ådahl
6885c37784 cogl: Mark exported cogl symbols using COGL_EXPORT
Just like libmutter-clutter, and libmutter, mark exported symbols with
an COGL_EXPORT macro. This removes the .map and .map.in files previously
used, containing a list of semi private symbols. This symbol was out of
date, i.e. pointed to non-existing symbols, and was also replaced with
COGL_EXPORT macros.

unit_test_* symbols are exported by the help of the unit test defining
macro. test_* symbols are no longer supported as it proved unnecessary.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1059
2020-03-26 09:05:38 +01:00
Jonas Ådahl
238e41d493 cogl: Install cogl-trace.h and include from cogl.h
This is so that cogl-trace.h can start using things from cogl-macros.h,
and so that it doesn't leak cogl-config.h into the world, while exposing
it to e.g. gnome-shell so that it can make use of it as well. There is
no practical reason why we shouldn't just include cogl-trace.h via
cogl.h as we do with everything else.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1059
2020-03-26 09:05:38 +01:00
Carlos Garnacho
3aece84499 cogl-pango: Make color glyphs unaffected by foreground color
Making color glyphs affected by the foreground color makes them become
"tinted" on any other color than white. Make it sure we always paint
those white by checking the cached glyph value, the foreground color
will be reset on the next iteration through glyphs.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/850

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1148
2020-03-25 11:14:33 +00:00
Carlos Garnacho
40fb06ca17 cogl-pango: Cache whether glyphs are backed up by a color font
This will be necessary later on.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1148
2020-03-25 11:14:33 +00:00
Corentin Noël
0053ef2e16 cogl-texture: Add some missing array annotations
This allows bindings to correctly understand that it is an array

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1130
2020-03-17 13:30:31 +01:00
Andre Moreira Magalhaes
6989fea767 cogl: Fix build error when GL_ARB_sync is not defined
Commit 41992757e0 introduced a change to use CoglContext.glFenceSync
but this method is only available when GL_ARB_sync is defined (as
defined on gl-prototypes/cogl-all-functions.h).

This change fixes that.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1123
2020-03-12 18:05:10 -03:00
Corentin Noël
df33255162 cogl: Add main header for Cogl
This allows bindings linking to the C header to actually have the right one.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1101
2020-03-12 13:35:25 +00:00
Jonas Dreßler
46e38ff61a cogl/clip-stack: Set color and depth mask when drawing rectangle clips
Just like with the other functions drawing to the stencil buffer, we
should make sure the depth and color masks are set to FALSE during
drawing.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1096
2020-02-29 19:29:31 +00:00
Jonas Dreßler
1e0b015ce8 cogl/clip-stack: Explicitely initialize the stencil mask
We need the stencil buffer to consist of binary values of 0 and 1
because we're doing additions and subtractions on the buffer, so even
though this is the default, explicitely set the stencil mask to 0x1.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1096
2020-02-29 19:29:31 +00:00
Jonas Dreßler
72054332c5 cogl/clip-stack: Restore old matrices after drawing to stencil buffer
When using a region clip and something has a rectangle clip pushed, a
special drawing method for ClutterTexts (emit_vertex_buffer_geometry()
in cogl-pango-display-list.c) starts to fail and clipping issues with
long texts (because emit_vertex_buffer_geometry() is only used for texts
longer than 25 characters) start to appear. This specifically happened
in Looking Glass, where the StViewport of the ScrollView sets a
rectangle clips and the texts are usually longer than 25 characters.

This is caused by the changing of the perspective and modelview matrix
when drawing to the stencil buffer and started happening when
region-clipping was introduced with commit 8598b654. Even though the
changing of the matrices was done before that, too, the issue probably
didn't happen because `rect->can_be_scissor` was TRUE and no stencil
buffer clipping was used at all.

To fix this, temporarily save the old matrices, then set the new ones
and restore the old ones when we're done drawing to the stencil buffer.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/issues/2246

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1096
2020-02-29 19:29:31 +00:00
Jonas Dreßler
d30ef0dd3b cogl/clip-stack: Use "merge" parameter for rectangle clips
Just like for the other sorts of clips, use a "merge" parameter instead
of a "first" parameter.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1096
2020-02-29 19:29:31 +00:00
Georges Basile Stavracas Neto
3881c1f952 cogl/context: Add cogl_renderer_create_dma_buf() and family
This is a winsys-specific API that allows exporting a DMA buffer fd.
The CoglDmaBufHandle structure allows passing the ownership of the
DMA buffer to whoever is using it, so the winsys doesn't need to
manually track it.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1086
2020-02-28 14:54:48 -03:00
Georges Basile Stavracas Neto
038a3170bf cogl/framebuffer: Add cogl_framebuffer_flush
In future patches, we'll create additional CoglFramebuffers that
will be shared via DMA-Buf with PipeWire. When recording frames,
we'll blit the current onscreen framebuffer into the shared one.

However, that presents a problem: cogl_framebuffer_blit() mimics
glBlitFramebuffer() semantics, and doesn't do an implicit flush
of the GPU command stream. As a consequence, clients may receive
unblitted or incomplete framebuffers.

We could use cogl_framebuffer_finish() to ensure the commands were
submitted to the GPU, but it is too harsh -- it blocks the CPU
completely until the commands are finished!

Add cogl_framebuffer_flush(), which ensures the command stream is
submitted to the GPU without blocking the CPU. Even though we don't
use the framebuffer specifically, it may be useful in the future
for e.g. a potential Vulkan backend to have access to the framebuffer.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1086
2020-02-28 10:52:34 -03:00
Adam Jackson
41992757e0 cogl: GLES3 has sync objects
https://gitlab.gnome.org/GNOME/mutter/merge_requests/882
2020-02-19 17:55:46 +00:00
Adam Jackson
445af61a68 cogl: GLES3 has vertex array objects
https://gitlab.gnome.org/GNOME/mutter/merge_requests/882
2020-02-19 17:55:46 +00:00
Adam Jackson
03ef335a70 cogl: GLES3 has sampler objects
https://gitlab.gnome.org/GNOME/mutter/merge_requests/882
2020-02-19 17:55:46 +00:00
Adam Jackson
b4226daadb cogl: GLES3 has glGetStringi
https://gitlab.gnome.org/GNOME/mutter/merge_requests/882
2020-02-19 17:55:46 +00:00
Adam Jackson
5c704e3f81 cogl: Remove no-op cogl_shader_compile and cogl_shader_get_info_log
https://gitlab.gnome.org/GNOME/mutter/merge_requests/1024
2020-02-12 21:55:44 +00:00
Adam Jackson
c1bdaba5ac cogl: Inline cogl_use_program into its one caller
https://gitlab.gnome.org/GNOME/mutter/merge_requests/1015
2020-01-31 17:26:25 +00:00
Adam Jackson
640ad4718e cogl: Inline _cogl_framebuffer_remove_all_dependencies into its one caller
https://gitlab.gnome.org/GNOME/mutter/merge_requests/1015
2020-01-31 17:26:25 +00:00
Adam Jackson
985b3b32ce cogl: Remove unused _cogl_pipeline_get_layers
https://gitlab.gnome.org/GNOME/mutter/merge_requests/1015
2020-01-31 17:26:25 +00:00
Adam Jackson
795491c80a cogl: Remove unused cogl_program_use and friends
https://gitlab.gnome.org/GNOME/mutter/merge_requests/1015
2020-01-31 17:26:25 +00:00
Adam Jackson
f5e2310dc7 cogl: Remove unused _cogl_framebuffer_set_clip_stack
https://gitlab.gnome.org/GNOME/mutter/merge_requests/1015
2020-01-31 17:26:25 +00:00
Adam Jackson
c5a936e0e8 cogl: Remove unused _cogl_framebuffer_{push,pop}_projection
https://gitlab.gnome.org/GNOME/mutter/merge_requests/1015
2020-01-31 17:26:25 +00:00
Adam Jackson
600dd155ce cogl: Remove unused p-axis texture wrap mode
Unused since removing 3D textures.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1015
2020-01-31 17:26:25 +00:00
Adam Jackson
99043e2af2 cogl: Mark _cogl_buffer_access_to_gl_enum static
https://gitlab.gnome.org/GNOME/mutter/merge_requests/1015
2020-01-31 17:26:25 +00:00
Adam Jackson
e0d2e1096d cogl: Remove unused _cogl_framebuffer_try_creating_gl_fbo
Unused since the cogl-gles2 removal in 7e8a8649.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1015
2020-01-31 17:26:25 +00:00
Adam Jackson
136c09585d cogl: Remove unused cogl.symbols
https://gitlab.gnome.org/GNOME/mutter/merge_requests/1015
2020-01-31 17:26:25 +00:00
Adam Jackson
5b1ff5935e cogl: Clean up private feature flags and GLSL builtin handling of same
https://gitlab.gnome.org/GNOME/mutter/merge_requests/995
2020-01-16 18:38:20 +00:00
Adam Jackson
347619a85f cogl: Remove unused GL imports from the CoglContext vtable
Notably this deletes cogl-fixed-functions.h since we are no longer using
any of the GL1-style fixed-function pipeline API.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/995
2020-01-16 18:38:20 +00:00
Adam Jackson
282eab45f7 cogl: Stop using glPointSize in big-GL
Just pass it in to the vertex shader like in GLES, it's one less thing
to vary between drivers. mutter is, shall we say, not a heavy user of
point primitives, so any performance impact (it might be measurable, who
knows) is not an issue. Again, the feature flag remains to be cleaned up
in a future commit.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/995
2020-01-16 18:38:20 +00:00
Adam Jackson
35f21c5bc0 cogl: Stop using glAlphaFunc in big-GL
We're always running through the GLSL pipeline so the fixed-function
alpha test is never invoked. This change does not yet remove the
alpha-test feture bit from the context because this bit of uniform
handling is going to be simplified in a future commit.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/995
2020-01-16 18:38:20 +00:00
Adam Jackson
9f2662c7f8 cogl: Remove fixed-function handling for layer color
This can't matter anymore, glColor* doesn't get used when drawing
through a shader.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/995
2020-01-16 18:38:20 +00:00
Adam Jackson
71a2ba7a98 cogl: Remove fixed-function workaround for point sprite coordinates
https://gitlab.gnome.org/GNOME/mutter/merge_requests/995
2020-01-16 18:38:20 +00:00
Adam Jackson
3f2ad5a50a cogl: Remove builtin/texcoord attribute tracking bitmasks from CoglContext
These were only being set from the fixed-function pipeline.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/995
2020-01-16 18:38:20 +00:00
Adam Jackson
abd094d135 cogl: Remove stray references to gl*Pointer, which we're never calling
https://gitlab.gnome.org/GNOME/mutter/merge_requests/995
2020-01-16 18:38:20 +00:00
Adam Jackson
737763112e cogl: Remove unused CoglMatrixMode
https://gitlab.gnome.org/GNOME/mutter/merge_requests/995
2020-01-16 18:38:20 +00:00
Jonas Ådahl
6e5ac0b585 Use G_GNUC_FALLTHROUGH instead of comments
Get the same task done in a bit more C:y way.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/998
2020-01-09 17:58:29 +01:00
Adam Jackson
498264959a cogl: Add support for GL_ANGLE_pack_reverse_row_order
This is the GLES equivalent of GL_MESA_pack_invert.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/980
2019-12-18 16:01:51 -05:00
Adam Jackson
e32e20521d cogl: Update documentation for COGL_PRIVATE_FEATURE_ANY_GL
https://gitlab.gnome.org/GNOME/mutter/merge_requests/973
2019-12-18 16:33:54 +00:00
Adam Jackson
9d5092cef5 cogl: Remove COGL_PRIVATE_FEATURE_GL_PROGRAMMABLE
Only the backend cares about this at all, and it's always set.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/973
2019-12-18 16:33:54 +00:00
Adam Jackson
68d0c11d88 cogl: Remove COGL_PRIVATE_FEATURE_GL_EMBEDDED
Only the driver backend cares about this now, we can equivalently check
that the driver is COGL_DRIVER_GLES2.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/973
2019-12-18 16:33:54 +00:00
Adam Jackson
fdf830940b cogl: Remove COGL_PRIVATE_FEATURE_GL_WEB
https://gitlab.gnome.org/GNOME/mutter/merge_requests/973
2019-12-18 16:33:54 +00:00
Adam Jackson
10daade1c0 cogl: Remove COGL_PRIVATE_FEATURE_GL_FIXED, track it in the driver
At this point only the gl driver is at all aware of the difference
between core and compat contexts. COGL_PRIVATE_FEATURE_GL_FIXED is also
now quite misnamed, since we're using the GLSL pipeline even for pre-GL3
contexts. Remove the private feature and handle the few remaining
differences by checking the driver class inside the gl driver.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/973
2019-12-18 16:33:54 +00:00
Adam Jackson
9a3a6dc212 cogl: Move GL-specific context setup/teardown into the driver
https://gitlab.gnome.org/GNOME/mutter/merge_requests/973
2019-12-18 16:33:54 +00:00
Adam Jackson
f9599b64d0 cogl: Add context_{,de}init hooks to CoglDriverVtable
There's quite a bit of CoglContext that properly belongs to the driver.
Add some hooks to allow the context to create/destroy such state. We
don't have driver-private storage in the CoglContext yet, though we
probably should.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/973
2019-12-18 16:33:54 +00:00
Adam Jackson
d5a70c7669 cogl: Remove unneeded X11 includes from various headers
https://gitlab.gnome.org/GNOME/mutter/merge_requests/977
2019-12-18 16:06:35 +00:00
Adam Jackson
573ba108d9 cogl: Remove unused xlib state from CoglContext
https://gitlab.gnome.org/GNOME/mutter/merge_requests/977
2019-12-18 16:06:35 +00:00
Adam Jackson
9325bd9d8e cogl: Remove unneeded GLX includes from cogl-framebuffer-private.h
https://gitlab.gnome.org/GNOME/mutter/merge_requests/977
2019-12-18 16:06:35 +00:00
Adam Jackson
420fb28d3f cogl: Move GLX-related headers into winsys/
Makes it harder to accidentally include them from the core.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/977
2019-12-18 16:06:35 +00:00
Adam Jackson
5613f4f7f4 cogl: Remove unused explicit blend-enable controls
https://gitlab.gnome.org/GNOME/mutter/merge_requests/978
2019-12-18 15:58:52 +00:00
Daniel van Vugt
02db9ee577 cogl: Remove reference to nonexistent type CoglVertex2f
It is actually CoglVertexP2.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/979
2019-12-18 15:50:36 +00:00
Daniel van Vugt
4aab814c37 cogl: Upload clipping rectangles in parallel
That is as a single array in a single GL operation. Instead of doing
each one as a separate upload.

Closes: https://gitlab.gnome.org/GNOME/mutter/issues/971

https://gitlab.gnome.org/GNOME/mutter/merge_requests/969
2019-12-18 11:52:23 +08:00
Daniel van Vugt
a48206e827 cogl: Simplify add_stencil_clip_region coordinates
https://gitlab.gnome.org/GNOME/mutter/merge_requests/969
2019-12-18 11:46:58 +08:00
Daniel van Vugt
99cc435730 cogl: Add function cogl_2d_primitives_immediate
For use in batching multiple primitives as a single GL upload.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/969
2019-12-18 11:46:54 +08:00
Jonas Ådahl
40205d8f1b cogl: Make pipeline creation introspectable
This means CoglContext is now also introspected, although its
constructor and some getters are skipped to avoid having to expose even
more types. This makes it possible to create pipelines using Javascript.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/935
2019-12-03 19:02:14 +00:00
Jonas Ådahl
4ede6ea8c5 cogl: Remove the framebuffer and source stacks
They have been deprecated for a long time, and all their uses in clutter
and mutter has been removed. This also removes some no longer needed
legacy state tracking, as they were only ever excercised in certain
circumstances when there was sources (pipelines or materials) on the now
removed source stack.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/935
2019-12-03 19:02:14 +00:00
Jonas Ådahl
77b3c0d670 cogl: Remove API implicitly switching between built in pipelines
This means cogl_set_source_color*() that switches to the opaque or
blending pipeline, or cogl_source_set_texture() which switches to the
texture pipeline.

Left is the opaque pipeline, as it is still used to compare other
pipelines to check whether they are opaque or not, and as the default
pipeline still pushed to the source stack during initialization.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/935
2019-12-03 19:02:14 +00:00
Jonas Ådahl
3819291cb7 cogl: Remove API implicitly using framebuffer stack
E.g. cogl_frustum(), cogl_push_matrix(), etc.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/935
2019-12-03 19:02:14 +00:00
Jonas Ådahl
30964051fe cogl: Remove declaration for long gone function
It was removed in 2011, but the declaration lingered. Until now.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/935
2019-12-03 19:02:14 +00:00
Jonas Ådahl
ae4ae61a5f cogl: Remove deprecated primitives functions
Such as cogl_rectangle() and cogl_polygon().

https://gitlab.gnome.org/GNOME/mutter/merge_requests/935
2019-12-03 19:02:14 +00:00
Jonas Ådahl
a91138c8f8 cogl/context: Remove unusued window_buffer field
It kept track of the last "window" (i.e. CoglOnscreen) was the active
on. It was used by API removed in the past, so also remove the left over
field.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/935
2019-12-03 19:02:14 +00:00
Jonas Ådahl
27b6d1892f cogl/path: Remove API using deprecated Cogl API
The implicit stacks are going away, so remove API that depend on it.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/935
2019-12-03 19:02:14 +00:00
Jonas Ådahl
2a8f0c2801 cogl/tests: Port away from legacy implicit stack based API
Use the new API where state (framebuffer, pipeline) is always passed as
parameters, instead of using the implicit material and framebuffer
stack.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/935
2019-12-03 19:02:14 +00:00
Jonas Ådahl
9e2e44c0c2 cogl/tests/warp-modes: Test CoglPrimitive instead of cogl_polygon()
Change the warp modes test to sanity check CoglPrimitive based polygon
drawing instead of cogl_polygon(). This removes some checks, as
cogl_polygon() has explicitly documented special behaviour for automatic
wrap modes, which CoglPrimitive does not.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/935
2019-12-03 19:02:14 +00:00
Jonas Ådahl
5e117b3f5a cogl/tests: Remove testing of legacy API
Some tests just test that deprecated API still work as they should.
Those APIs are being removed, so prepare by removing their tests.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/935
2019-12-03 19:02:14 +00:00
Jonas Ådahl
294b4eda4c cogl/tests/backface-culling: Port to non-deprecated API
Usage of cogl_polygon() was ported to CoglPrimitive, and implicit
framebuffer stack API was ported to explicit framebuffer based API.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/935
2019-12-03 19:02:14 +00:00
Jonas Ådahl
7faf9f91db cogl/tests/backface-culling: Stop testing legacy state
It's going away, so stop testing it.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/935
2019-12-03 19:02:14 +00:00
Jonas Ådahl
4b5abdc988 cogl/tests: Remove test-materials
It wasn't compiled, nor ported to the new test suite, and tests
deprecated functionality that are being removed. Lets drop it.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/935
2019-12-03 19:02:14 +00:00
Jonas Ådahl
e696f639ab cogl/pixel-buffer: Remove declaration hidden behind #if
Doesn't lead to anywhere, isn't used anywhere, so lets remove it.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/935
2019-12-03 19:02:14 +00:00
Jonas Ådahl
66f02ae93d cogl/pango: Remove deprecated API using implicit fb stack
Remove the implicit framebuffer stack using cogl_pango_render_*() API
that was replaced with the newer cogl_pango_show_*() API.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/935
2019-12-03 19:02:14 +00:00
Jonas Ådahl
e8e5ccf82d cogl/tests: Remove test-fixed
It was a non-built non-ported test case for removed code.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/935
2019-12-03 19:02:14 +00:00
Jonas Ådahl
98c0fe934b cogl: Remove CoglVertexBuffer
It was deprecated, relied on deprecated API (implicit framebuffers,
mateiarls etc), and was unused. Lets remove it.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/935
2019-12-03 19:02:14 +00:00
Jonas Ådahl
49c8d42317 clutter: Introduce paint contexts
When painting, actors rely on semi global state tracked by the state to
get various things needed for painting, such as the current draw
framebuffer. Having state hidden in such ways can be very deceiving as
it's hard to follow changes spread out, and adding more and more state
that should be tracked during a paint gets annoying as they will not
change in isolation but one by one in their own places. To do this
better, introduce a paint context that is passed along in paint calls
that contains the necessary state needed during painting.

The paint context implements a framebuffer stack just as Cogl works,
which is currently needed for offscreen rendering used by clutter.

The same context is passed around for paint nodes, contents and effects
as well.

In this commit, the context is only introduced, but not used. It aims to
replace the Cogl framebuffer stack, and will allow actors to know what
view it is currently painted on.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/935
2019-12-03 19:02:14 +00:00
Carlos Garnacho
a586f6a152 cogl: Drop unused struct field
We only ever stored that the current clip uses the stencil buffer, but
never read it back. It doesn't seem like we'll have an use for it.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/867
2019-11-22 21:07:05 +00:00
Carlos Garnacho
a1116bc6c8 cogl: Add support for clipping regions
This uses the stencil buffer to poke holes in the shape of the
given cairo_region_t that we will draw through.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/867
2019-11-22 21:07:05 +00:00
Robert Mader
8e172aeecb cleanup: Use g_clear_handle_id() for g_source_remove()
It makes sure we do not forget to zero the id and lets us avoid
zero checks before. We use it for all new code, lets clean up the
existing code base.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/947
2019-11-22 01:27:40 +01:00