clutter/paint-context: Allow passing redraw clip to offscreen paint context
So that we can mark the redraw clip of the part of the stage we're painting. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1207
This commit is contained in:
parent
1b33a5a3a7
commit
a4f55d4986
@ -60,13 +60,15 @@ clutter_paint_context_new_for_view (ClutterStageView *view,
|
|||||||
* clutter_paint_context_new_for_framebuffer: (skip)
|
* clutter_paint_context_new_for_framebuffer: (skip)
|
||||||
*/
|
*/
|
||||||
ClutterPaintContext *
|
ClutterPaintContext *
|
||||||
clutter_paint_context_new_for_framebuffer (CoglFramebuffer *framebuffer,
|
clutter_paint_context_new_for_framebuffer (CoglFramebuffer *framebuffer,
|
||||||
ClutterPaintFlag paint_flags)
|
const cairo_region_t *redraw_clip,
|
||||||
|
ClutterPaintFlag paint_flags)
|
||||||
{
|
{
|
||||||
ClutterPaintContext *paint_context;
|
ClutterPaintContext *paint_context;
|
||||||
|
|
||||||
paint_context = g_new0 (ClutterPaintContext, 1);
|
paint_context = g_new0 (ClutterPaintContext, 1);
|
||||||
g_ref_count_init (&paint_context->ref_count);
|
g_ref_count_init (&paint_context->ref_count);
|
||||||
|
paint_context->redraw_clip = cairo_region_copy (redraw_clip);
|
||||||
paint_context->paint_flags = paint_flags;
|
paint_context->paint_flags = paint_flags;
|
||||||
|
|
||||||
clutter_paint_context_push_framebuffer (paint_context, framebuffer);
|
clutter_paint_context_push_framebuffer (paint_context, framebuffer);
|
||||||
|
@ -40,8 +40,9 @@ CLUTTER_EXPORT
|
|||||||
GType clutter_paint_context_get_type (void);
|
GType clutter_paint_context_get_type (void);
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
ClutterPaintContext * clutter_paint_context_new_for_framebuffer (CoglFramebuffer *framebuffer,
|
ClutterPaintContext * clutter_paint_context_new_for_framebuffer (CoglFramebuffer *framebuffer,
|
||||||
ClutterPaintFlag paint_flags);
|
const cairo_region_t *redraw_clip,
|
||||||
|
ClutterPaintFlag paint_flags);
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
ClutterPaintContext * clutter_paint_context_ref (ClutterPaintContext *paint_context);
|
ClutterPaintContext * clutter_paint_context_ref (ClutterPaintContext *paint_context);
|
||||||
|
@ -1271,7 +1271,8 @@ get_image_via_offscreen (MetaShapedTexture *stex,
|
|||||||
clutter_paint_node_set_static_name (root_node, "MetaShapedTexture.offscreen");
|
clutter_paint_node_set_static_name (root_node, "MetaShapedTexture.offscreen");
|
||||||
|
|
||||||
paint_context =
|
paint_context =
|
||||||
clutter_paint_context_new_for_framebuffer (fb, CLUTTER_PAINT_FLAG_NONE);
|
clutter_paint_context_new_for_framebuffer (fb, NULL,
|
||||||
|
CLUTTER_PAINT_FLAG_NONE);
|
||||||
|
|
||||||
do_paint_content (stex, root_node, paint_context,
|
do_paint_content (stex, root_node, paint_context,
|
||||||
stex->texture,
|
stex->texture,
|
||||||
|
@ -1322,7 +1322,7 @@ meta_window_actor_blit_to_framebuffer (MetaScreenCastWindow *screen_cast_window,
|
|||||||
cogl_framebuffer_translate (framebuffer, -x, -y, 0);
|
cogl_framebuffer_translate (framebuffer, -x, -y, 0);
|
||||||
|
|
||||||
paint_context =
|
paint_context =
|
||||||
clutter_paint_context_new_for_framebuffer (framebuffer,
|
clutter_paint_context_new_for_framebuffer (framebuffer, NULL,
|
||||||
CLUTTER_PAINT_FLAG_NONE);
|
CLUTTER_PAINT_FLAG_NONE);
|
||||||
clutter_actor_paint (actor, paint_context);
|
clutter_actor_paint (actor, paint_context);
|
||||||
clutter_paint_context_destroy (paint_context);
|
clutter_paint_context_destroy (paint_context);
|
||||||
@ -1482,7 +1482,7 @@ meta_window_actor_get_image (MetaWindowActor *self,
|
|||||||
cogl_framebuffer_translate (framebuffer, -x, -y, 0);
|
cogl_framebuffer_translate (framebuffer, -x, -y, 0);
|
||||||
|
|
||||||
paint_context =
|
paint_context =
|
||||||
clutter_paint_context_new_for_framebuffer (framebuffer,
|
clutter_paint_context_new_for_framebuffer (framebuffer, NULL,
|
||||||
CLUTTER_PAINT_FLAG_NONE);
|
CLUTTER_PAINT_FLAG_NONE);
|
||||||
clutter_actor_paint (actor, paint_context);
|
clutter_actor_paint (actor, paint_context);
|
||||||
clutter_paint_context_destroy (paint_context);
|
clutter_paint_context_destroy (paint_context);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user