clutter-texture: Remove cogl_rectangle_with_texture_coords()

Mostly as expected, this port is also trivial. A small cleanup
accompanies this patch, making gen_texcoords_and_draw_cogl_rectangle()
receive the framebuffer that it should draw into.
This commit is contained in:
Georges Basile Stavracas Neto 2018-11-08 20:59:01 -02:00
parent a227e4078b
commit fcd1ff9c56
No known key found for this signature in database
GPG Key ID: 886C17EE170D1385

View File

@ -561,7 +561,9 @@ update_fbo (ClutterActor *self)
} }
static void static void
gen_texcoords_and_draw_cogl_rectangle (ClutterActor *self) gen_texcoords_and_draw_cogl_rectangle (ClutterActor *self,
CoglPipeline *pipeline,
CoglFramebuffer *framebuffer)
{ {
ClutterTexture *texture = CLUTTER_TEXTURE (self); ClutterTexture *texture = CLUTTER_TEXTURE (self);
ClutterTexturePrivate *priv = texture->priv; ClutterTexturePrivate *priv = texture->priv;
@ -580,10 +582,12 @@ gen_texcoords_and_draw_cogl_rectangle (ClutterActor *self)
else else
t_h = 1.0; t_h = 1.0;
cogl_rectangle_with_texture_coords (0, 0, cogl_framebuffer_draw_textured_rectangle (framebuffer,
box.x2 - box.x1, pipeline,
box.y2 - box.y1, 0, 0,
0, 0, t_w, t_h); box.x2 - box.x1,
box.y2 - box.y1,
0, 0, t_w, t_h);
} }
static CoglPipeline * static CoglPipeline *
@ -625,6 +629,7 @@ clutter_texture_pick (ClutterActor *self,
{ {
ClutterTexture *texture = CLUTTER_TEXTURE (self); ClutterTexture *texture = CLUTTER_TEXTURE (self);
ClutterTexturePrivate *priv = texture->priv; ClutterTexturePrivate *priv = texture->priv;
CoglFramebuffer *framebuffer = cogl_get_draw_framebuffer ();
if (!clutter_actor_should_pick_paint (self)) if (!clutter_actor_should_pick_paint (self))
return; return;
@ -656,8 +661,7 @@ clutter_texture_pick (ClutterActor *self,
0, &pick_color); 0, &pick_color);
cogl_pipeline_set_layer_texture (priv->pick_pipeline, 0, cogl_pipeline_set_layer_texture (priv->pick_pipeline, 0,
clutter_texture_get_cogl_texture (texture)); clutter_texture_get_cogl_texture (texture));
cogl_set_source (priv->pick_pipeline); gen_texcoords_and_draw_cogl_rectangle (self, priv->pick_pipeline, framebuffer);
gen_texcoords_and_draw_cogl_rectangle (self);
} }
else else
CLUTTER_ACTOR_CLASS (clutter_texture_parent_class)->pick (self, color); CLUTTER_ACTOR_CLASS (clutter_texture_parent_class)->pick (self, color);
@ -669,6 +673,7 @@ clutter_texture_paint (ClutterActor *self)
ClutterTexture *texture = CLUTTER_TEXTURE (self); ClutterTexture *texture = CLUTTER_TEXTURE (self);
ClutterTexturePrivate *priv = texture->priv; ClutterTexturePrivate *priv = texture->priv;
guint8 paint_opacity = clutter_actor_get_paint_opacity (self); guint8 paint_opacity = clutter_actor_get_paint_opacity (self);
CoglFramebuffer *framebuffer = cogl_get_draw_framebuffer ();
CLUTTER_NOTE (PAINT, CLUTTER_NOTE (PAINT,
"painting texture '%s'", "painting texture '%s'",
@ -683,9 +688,8 @@ clutter_texture_paint (ClutterActor *self)
paint_opacity, paint_opacity,
paint_opacity, paint_opacity,
paint_opacity); paint_opacity);
cogl_set_source (priv->pipeline);
gen_texcoords_and_draw_cogl_rectangle (self); gen_texcoords_and_draw_cogl_rectangle (self, priv->pipeline, framebuffer);
} }
static gboolean static gboolean