[gtk/wip/chergert/glproto: 272/526] add helper to check cachability




commit dce2b02cc5d5375b80492418814f2815900c6692
Author: Christian Hergert <chergert redhat com>
Date:   Wed Jan 20 10:23:26 2021 -0800

    add helper to check cachability

 gsk/next/gskgltexturelibraryprivate.h | 8 ++++++++
 1 file changed, 8 insertions(+)
---
diff --git a/gsk/next/gskgltexturelibraryprivate.h b/gsk/next/gskgltexturelibraryprivate.h
index 0f9b554954..52aefd469f 100644
--- a/gsk/next/gskgltexturelibraryprivate.h
+++ b/gsk/next/gskgltexturelibraryprivate.h
@@ -183,6 +183,14 @@ gsk_gl_texture_atlas_get_unused_ratio (const GskGLTextureAtlas *self)
   return 0.0;
 }
 
+static inline gboolean
+gsk_gl_texture_library_can_cache (GskGLTextureLibrary *self,
+                                  int                  width,
+                                  int                  height)
+{
+  return width <= self->max_entry_size && height <= self->max_entry_size;
+}
+
 G_END_DECLS
 
 #endif /* __GSK_GL_TEXTURE_LIBRARY_PRIVATE_H__ */


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