From fcd1ff9c56b062be4804ff2a3a2e879559f92833 Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Thu, 8 Nov 2018 20:59:01 -0200 Subject: [PATCH] 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. --- clutter/clutter/deprecated/clutter-texture.c | 22 ++++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/clutter/clutter/deprecated/clutter-texture.c b/clutter/clutter/deprecated/clutter-texture.c index 2b40e80fe..f0747595b 100644 --- a/clutter/clutter/deprecated/clutter-texture.c +++ b/clutter/clutter/deprecated/clutter-texture.c @@ -561,7 +561,9 @@ update_fbo (ClutterActor *self) } 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); ClutterTexturePrivate *priv = texture->priv; @@ -580,10 +582,12 @@ gen_texcoords_and_draw_cogl_rectangle (ClutterActor *self) else t_h = 1.0; - cogl_rectangle_with_texture_coords (0, 0, - box.x2 - box.x1, - box.y2 - box.y1, - 0, 0, t_w, t_h); + cogl_framebuffer_draw_textured_rectangle (framebuffer, + pipeline, + 0, 0, + box.x2 - box.x1, + box.y2 - box.y1, + 0, 0, t_w, t_h); } static CoglPipeline * @@ -625,6 +629,7 @@ clutter_texture_pick (ClutterActor *self, { ClutterTexture *texture = CLUTTER_TEXTURE (self); ClutterTexturePrivate *priv = texture->priv; + CoglFramebuffer *framebuffer = cogl_get_draw_framebuffer (); if (!clutter_actor_should_pick_paint (self)) return; @@ -656,8 +661,7 @@ clutter_texture_pick (ClutterActor *self, 0, &pick_color); cogl_pipeline_set_layer_texture (priv->pick_pipeline, 0, clutter_texture_get_cogl_texture (texture)); - cogl_set_source (priv->pick_pipeline); - gen_texcoords_and_draw_cogl_rectangle (self); + gen_texcoords_and_draw_cogl_rectangle (self, priv->pick_pipeline, framebuffer); } else CLUTTER_ACTOR_CLASS (clutter_texture_parent_class)->pick (self, color); @@ -669,6 +673,7 @@ clutter_texture_paint (ClutterActor *self) ClutterTexture *texture = CLUTTER_TEXTURE (self); ClutterTexturePrivate *priv = texture->priv; guint8 paint_opacity = clutter_actor_get_paint_opacity (self); + CoglFramebuffer *framebuffer = cogl_get_draw_framebuffer (); CLUTTER_NOTE (PAINT, "painting texture '%s'", @@ -683,9 +688,8 @@ clutter_texture_paint (ClutterActor *self) 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