clutter, core: Stop using the Cogl framebuffer stack

The Cogl framebuffer stack is going away; replace all its uses by the
framebuffer stack carried by the paint context.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/935
This commit is contained in:
Jonas Ådahl
2019-11-22 11:41:04 +01:00
committed by Georges Basile Stavracas Neto
parent 549f60fe49
commit 3f65837e0d
29 changed files with 105 additions and 79 deletions

View File

@ -58,7 +58,7 @@ foo_actor_paint (ClutterActor *actor,
255, 0, 0,
foo_actor->last_paint_opacity);
framebuffer = cogl_get_draw_framebuffer ();
framebuffer = clutter_paint_context_get_framebuffer (paint_context);
cogl_framebuffer_draw_rectangle (framebuffer,
pipeline,
allocation.x1,

View File

@ -147,7 +147,7 @@ key_group_paint (ClutterActor *actor,
pipeline = cogl_pipeline_new (ctx);
cogl_pipeline_set_color4ub (pipeline, 255, 255, 0, 224);
framebuffer = cogl_get_draw_framebuffer ();
framebuffer = clutter_paint_context_get_framebuffer (paint_context);
clutter_actor_iter_init (&iter, actor);
while (clutter_actor_iter_next (&iter, &child))

View File

@ -157,7 +157,8 @@ key_group_paint (ClutterActor *actor,
ClutterActorIter iter;
ClutterActor *child;
gint i = 0;
CoglFramebuffer *framebuffer = cogl_get_draw_framebuffer ();
CoglFramebuffer *framebuffer =
clutter_paint_context_get_framebuffer (paint_context);
CoglContext *ctx = cogl_framebuffer_get_context (framebuffer);
CoglPipeline *pipeline;

View File

@ -87,7 +87,8 @@ test_coglbox_paint (ClutterActor *self,
ClutterPaintContext *paint_context)
{
TestCoglboxPrivate *priv = TEST_COGLBOX_GET_PRIVATE (self);
CoglFramebuffer *framebuffer = cogl_get_draw_framebuffer ();
CoglFramebuffer *framebuffer =
clutter_paint_context_get_framebuffer (paint_context);
CoglContext *ctx = cogl_framebuffer_get_context (framebuffer);
gfloat texcoords[4] = { 0, 0, 1, 1 };
CoglPipeline *pipeline;

View File

@ -99,7 +99,8 @@ paint_cb (ClutterActor *stage,
ClutterPaintContext *paint_context,
Data *data)
{
CoglFramebuffer *framebuffer = cogl_get_draw_framebuffer ();
CoglFramebuffer *framebuffer =
clutter_paint_context_get_framebuffer (paint_context);
CoglMatrix old_matrix, new_matrix;
int i;
float diff_time;

View File

@ -87,7 +87,8 @@ test_coglbox_paint (ClutterActor *self,
{
TestCoglboxPrivate *priv = TEST_COGLBOX_GET_PRIVATE (self);
CoglPipeline *pipeline;
CoglFramebuffer *framebuffer = cogl_get_draw_framebuffer ();
CoglFramebuffer *framebuffer =
clutter_paint_context_get_framebuffer (paint_context);
CoglContext *ctx = cogl_framebuffer_get_context (framebuffer);
gfloat texcoords[4] = { 0.0, 0.0, 1.0, 1.0 };

View File

@ -197,7 +197,8 @@ test_coglbox_paint (ClutterActor *self,
: priv->not_sliced_tex;
int tex_width = cogl_texture_get_width (tex_handle);
int tex_height = cogl_texture_get_height (tex_handle);
CoglFramebuffer *framebuffer = cogl_get_draw_framebuffer ();
CoglFramebuffer *framebuffer =
clutter_paint_context_get_framebuffer (paint_context);
CoglHandle material = cogl_material_new ();
cogl_material_set_layer (material, 0, tex_handle);

View File

@ -87,7 +87,8 @@ test_coglbox_paint (ClutterActor *self,
ClutterPaintContext *paint_context)
{
TestCoglboxPrivate *priv = TEST_COGLBOX_GET_PRIVATE (self);
CoglFramebuffer *framebuffer = cogl_get_draw_framebuffer ();
CoglFramebuffer *framebuffer =
clutter_paint_context_get_framebuffer (paint_context);
CoglContext *ctx = cogl_framebuffer_get_context (framebuffer);
CoglPipeline *pipeline;
gfloat texcoords[4] = { 0.0f, 0.0f, 1.0f, 1.0f };

View File

@ -148,7 +148,8 @@ hand_pre_paint (ClutterActor *actor,
ClutterPaintContext *paint_context,
gpointer user_data)
{
CoglFramebuffer *framebuffer = cogl_get_draw_framebuffer ();
CoglFramebuffer *framebuffer =
clutter_paint_context_get_framebuffer (paint_context);
CoglContext *ctx = cogl_framebuffer_get_context (framebuffer);
CoglPipeline *pipeline;
SuperOH *oh = user_data;
@ -176,7 +177,8 @@ hand_post_paint (ClutterActor *actor,
ClutterPaintContext *paint_context,
gpointer user_data)
{
CoglFramebuffer *framebuffer = cogl_get_draw_framebuffer ();
CoglFramebuffer *framebuffer =
clutter_paint_context_get_framebuffer (paint_context);
CoglContext *ctx = cogl_framebuffer_get_context (framebuffer);
CoglPipeline *pipeline;
SuperOH *oh = user_data;

View File

@ -27,14 +27,17 @@ typedef struct _TestState
int current_test;
} TestState;
typedef void (*TestCallback) (TestState *state);
typedef void (*TestCallback) (TestState *state,
ClutterPaintContext *paint_context);
static void
test_rectangles (TestState *state)
test_rectangles (TestState *state,
ClutterPaintContext *paint_context)
{
#define RECT_WIDTH 5
#define RECT_HEIGHT 5
CoglFramebuffer *framebuffer = cogl_get_draw_framebuffer ();
CoglFramebuffer *framebuffer =
clutter_paint_context_get_framebuffer (paint_context);
CoglContext *ctx = cogl_framebuffer_get_context (framebuffer);
int x;
int y;
@ -111,7 +114,7 @@ on_paint (ClutterActor *actor,
ClutterPaintContext *paint_context,
TestState *state)
{
tests[state->current_test] (state);
tests[state->current_test] (state, paint_context);
}
static gboolean