[gtk/wip/chergert/glproto] use offscreen directly instead of rect



commit ac092db046d751ac0398a74abae6fad5cbe0f437
Author: Christian Hergert <chergert redhat com>
Date:   Thu Jan 28 23:16:24 2021 -0800

    use offscreen directly instead of rect
    
    we are probably going to need to change this to use x1/x2 semantics so we
    dont loose precision from the float values. i think that may be related
    to why `compare` is showing diffs in edging around the icons.
    
    followup patches would need to address this in area.

 gsk/next/gskglrenderjob.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)
---
diff --git a/gsk/next/gskglrenderjob.c b/gsk/next/gskglrenderjob.c
index 417178495a..0bd5883f71 100644
--- a/gsk/next/gskglrenderjob.c
+++ b/gsk/next/gskglrenderjob.c
@@ -184,12 +184,12 @@ static gboolean gsk_gl_render_job_visit_node_with_offscreen (GskGLRenderJob
                                                              GskGLRenderOffscreen *offscreen);
 
 static inline void
-init_full_texture_region (graphene_rect_t *rect)
+init_full_texture_region (GskGLRenderOffscreen *offscreen)
 {
-  rect->origin.x = 0;
-  rect->origin.y = 0;
-  rect->size.width = 1;
-  rect->size.height = 1;
+  offscreen->area.origin.x = 0;
+  offscreen->area.origin.y = 0;
+  offscreen->area.size.width = 1;
+  offscreen->area.size.height = 1;
 }
 
 static inline gboolean G_GNUC_PURE
@@ -1148,7 +1148,7 @@ blur_node (GskGLRenderJob       *job,
                                               texture_height * scale_y,
                                               blur_radius * scale_x,
                                               blur_radius * scale_y);
-      init_full_texture_region (&offscreen->area);
+      init_full_texture_region (offscreen);
     }
 
   *min_x = job->offset_x + node->bounds.origin.x - half_blur_extra;
@@ -1962,7 +1962,7 @@ gsk_gl_render_job_visit_blurred_inset_shadow_node (GskGLRenderJob *job,
       gsk_gl_render_state_restore (&state, job);
 
       offscreen.texture_id = render_target->texture_id;
-      init_full_texture_region (&offscreen.area);
+      init_full_texture_region (&offscreen);
 
       blurred_texture_id = blur_offscreen (job,
                                            &offscreen,
@@ -3124,7 +3124,7 @@ gsk_gl_render_job_upload_texture (GskGLRenderJob       *job,
   else
     {
       offscreen->texture_id = gsk_next_driver_load_texture (job->driver, texture, GL_LINEAR, GL_LINEAR);
-      init_full_texture_region (&offscreen->area);
+      init_full_texture_region (offscreen);
     }
 }
 
@@ -3484,7 +3484,7 @@ gsk_gl_render_job_visit_node_with_offscreen (GskGLRenderJob       *job,
     {
       /* Just to be safe. */
       offscreen->texture_id = 0;
-      init_full_texture_region (&offscreen->area);
+      init_full_texture_region (offscreen);
       offscreen->was_offscreen = FALSE;
       return FALSE;
     }
@@ -3513,7 +3513,7 @@ gsk_gl_render_job_visit_node_with_offscreen (GskGLRenderJob       *job,
   if (cached_id != 0)
     {
       offscreen->texture_id = cached_id;
-      init_full_texture_region (&offscreen->area);
+      init_full_texture_region (offscreen);
       /* We didn't render it offscreen, but hand out an offscreen texture id */
       offscreen->was_offscreen = TRUE;
       return TRUE;
@@ -3606,7 +3606,7 @@ gsk_gl_render_job_visit_node_with_offscreen (GskGLRenderJob       *job,
                                                                  render_target,
                                                                  FALSE);
 
-  init_full_texture_region (&offscreen->area);
+  init_full_texture_region (offscreen);
 
   if (!offscreen->do_not_cache)
     gsk_next_driver_cache_texture (job->driver, &key, offscreen->texture_id);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]