gsk: Drop some unused arguments
authorMatthias Clasen <mclasen@redhat.com>
Tue, 21 Mar 2023 02:02:17 +0000 (22:02 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 22 Mar 2023 04:14:43 +0000 (00:14 -0400)
All callers of the slice apis pass 0 for
min_rows and min_cols. So just drop these.

gsk/gl/gskgldriver.c
gsk/gl/gskgldriverprivate.h
gsk/gl/gskglrenderjob.c

index f4dfdfce8c4e8135fdb7d9907bce488b7769504b..a4362c192c2e6bc815ad1157c7c3dfdc83b4f74e 100644 (file)
@@ -1240,12 +1240,10 @@ void
 gsk_gl_driver_add_texture_slices (GskGLDriver        *self,
                                   GdkTexture         *texture,
                                   gboolean            ensure_mipmap,
-                                  guint               min_cols,
-                                  guint               min_rows,
                                   GskGLTextureSlice **out_slices,
                                   guint              *out_n_slices)
 {
-  int max_texture_size;
+  int max_slice_size;
   GskGLTextureSlice *slices;
   GskGLTexture *t;
   guint n_slices;
@@ -1262,12 +1260,12 @@ gsk_gl_driver_add_texture_slices (GskGLDriver        *self,
   g_assert (out_slices != NULL);
   g_assert (out_n_slices != NULL);
 
-  max_texture_size = self->command_queue->max_texture_size / 2;
+  max_slice_size = self->command_queue->max_texture_size / 2;
   tex_width = texture->width;
   tex_height = texture->height;
 
-  cols = MAX ((texture->width / max_texture_size) + 1, min_cols);
-  rows = MAX ((texture->height / max_texture_size) + 1, min_rows);
+  cols = (texture->width / max_slice_size) + 1;
+  rows = (texture->height / max_slice_size) + 1;
 
   n_slices = cols * rows;
 
index 25f1ff6399374ae1eed7f767618abfd23ce9ab54..2945aaa4e75ca07b0fb82014746b0e9c03528668 100644 (file)
@@ -170,8 +170,6 @@ GskGLTexture      * gsk_gl_driver_mark_texture_permanent (GskGLDriver         *s
 void                gsk_gl_driver_add_texture_slices     (GskGLDriver         *self,
                                                           GdkTexture          *texture,
                                                           gboolean             ensure_mipmap,
-                                                          guint                min_cols,
-                                                          guint                min_rows,
                                                           GskGLTextureSlice  **out_slices,
                                                           guint               *out_n_slices);
 GskGLProgram      * gsk_gl_driver_lookup_shader          (GskGLDriver         *self,
@@ -224,8 +222,6 @@ static inline void
 gsk_gl_driver_slice_texture (GskGLDriver        *self,
                              GdkTexture         *texture,
                              gboolean            ensure_mipmap,
-                             guint               min_cols,
-                             guint               min_rows,
                              GskGLTextureSlice **out_slices,
                              guint              *out_n_slices)
 {
@@ -234,15 +230,14 @@ gsk_gl_driver_slice_texture (GskGLDriver        *self,
   t = gdk_texture_get_render_data (texture, self);
 
   if (t && t->slices &&
-      (t->has_mipmap || !ensure_mipmap) &&
-      min_cols == 0 && min_rows == 0)
+      (t->has_mipmap || !ensure_mipmap))
     {
       *out_slices = t->slices;
       *out_n_slices = t->n_slices;
       return;
     }
 
-  gsk_gl_driver_add_texture_slices (self, texture, ensure_mipmap, min_cols, min_rows, out_slices, out_n_slices);
+  gsk_gl_driver_add_texture_slices (self, texture, ensure_mipmap, out_slices, out_n_slices);
 }
 
 G_END_DECLS
index 3aef417cb06b43535d69c4d21e080cc0ce6247df..3fc8958f70bc3410b9bf0a0753cad4c334219661 100644 (file)
@@ -3573,7 +3573,7 @@ gsk_gl_render_job_visit_texture (GskGLRenderJob        *job,
       GskGLTextureSlice *slices = NULL;
       guint n_slices = 0;
 
-      gsk_gl_driver_slice_texture (job->driver, texture, use_mipmaps, 0, 0, &slices, &n_slices);
+      gsk_gl_driver_slice_texture (job->driver, texture, use_mipmaps, &slices, &n_slices);
 
       g_assert (slices != NULL);
       g_assert (n_slices > 0);
@@ -3720,7 +3720,7 @@ gsk_gl_render_job_visit_texture_scale_node (GskGLRenderJob      *job,
       GskGLTextureSlice *slices = NULL;
       guint n_slices = 0;
 
-      gsk_gl_driver_slice_texture (job->driver, texture, filter == GSK_SCALING_FILTER_TRILINEAR, 0, 0, &slices, &n_slices);
+      gsk_gl_driver_slice_texture (job->driver, texture, filter == GSK_SCALING_FILTER_TRILINEAR, &slices, &n_slices);
 
       gsk_gl_render_job_begin_draw (job, CHOOSE_PROGRAM (job, blit));