gsk/gl: use consistent library naming

This commit is contained in:
Christian Hergert 2022-03-18 14:55:13 -07:00
parent c64836e1c9
commit cbbca38d88
4 changed files with 17 additions and 15 deletions

View File

@ -274,8 +274,8 @@ gsk_gl_driver_dispose (GObject *object)
g_assert (!self->key_to_texture_id|| g_hash_table_size (self->key_to_texture_id) == 0);
g_clear_object (&self->glyphs_library);
g_clear_object (&self->icons);
g_clear_object (&self->shadows);
g_clear_object (&self->icons_library);
g_clear_object (&self->shadows_library);
g_clear_pointer (&self->autorelease_framebuffers, g_array_unref);
g_clear_pointer (&self->key_to_texture_id, g_hash_table_unref);
@ -462,8 +462,8 @@ gsk_gl_driver_new (GskGLCommandQueue *command_queue,
}
self->glyphs_library = gsk_gl_glyph_library_new (self);
self->icons = gsk_gl_icon_library_new (self);
self->shadows = gsk_gl_shadow_library_new (self);
self->icons_library = gsk_gl_icon_library_new (self);
self->shadows_library = gsk_gl_shadow_library_new (self);
gdk_profiler_end_mark (before, "create GskGLDriver", NULL);
@ -554,13 +554,13 @@ gsk_gl_driver_begin_frame (GskGLDriver *self,
gsk_gl_command_queue_begin_frame (self->command_queue);
/* Mark unused pixel regions of the atlases */
gsk_gl_texture_library_begin_frame (GSK_GL_TEXTURE_LIBRARY (self->icons),
gsk_gl_texture_library_begin_frame (GSK_GL_TEXTURE_LIBRARY (self->icons_library),
self->current_frame_id);
gsk_gl_texture_library_begin_frame (GSK_GL_TEXTURE_LIBRARY (self->glyphs_library),
self->current_frame_id);
/* Cleanup old shadows */
gsk_gl_shadow_library_begin_frame (self->shadows);
gsk_gl_shadow_library_begin_frame (self->shadows_library);
/* Remove all textures that are from a previous frame or are no
* longer used by linked GdkTexture. We do this at the beginning
@ -1158,7 +1158,7 @@ gsk_gl_driver_save_atlases_to_png (GskGLDriver *self,
g_ptr_array_extend(dst, GSK_GL_TEXTURE_LIBRARY(library)->atlases, NULL, NULL)
atlases = g_ptr_array_new ();
copy_atlases (atlases, self->glyphs_library);
copy_atlases (atlases, self->icons);
copy_atlases (atlases, self->icons_library);
#undef copy_atlases
for (guint i = 0; i < atlases->len; i++)

View File

@ -101,8 +101,8 @@ struct _GskGLDriver
GskGLCommandQueue *command_queue;
GskGLGlyphLibrary *glyphs_library;
GskGLIconLibrary *icons;
GskGLShadowLibrary *shadows;
GskGLIconLibrary *icons_library;
GskGLShadowLibrary *shadows_library;
GArray *texture_pool;
GHashTable *textures;

View File

@ -2512,7 +2512,9 @@ gsk_gl_render_job_visit_blurred_outset_shadow_node (GskGLRenderJob *job,
scaled_outline.corner[i].height *= scale_y;
}
cached_tid = gsk_gl_shadow_library_lookup (job->driver->shadows, &scaled_outline, blur_radius);
cached_tid = gsk_gl_shadow_library_lookup (job->driver->shadows_library,
&scaled_outline,
blur_radius);
if (cached_tid == 0)
{
@ -2574,7 +2576,7 @@ gsk_gl_render_job_visit_blurred_outset_shadow_node (GskGLRenderJob *job,
blur_radius * scale_x,
blur_radius * scale_y);
gsk_gl_shadow_library_insert (job->driver->shadows,
gsk_gl_shadow_library_insert (job->driver->shadows_library,
&scaled_outline,
blur_radius,
blurred_texture_id);
@ -3499,14 +3501,14 @@ gsk_gl_render_job_upload_texture (GskGLRenderJob *job,
GdkTexture *texture,
GskGLRenderOffscreen *offscreen)
{
if (gsk_gl_texture_library_can_cache ((GskGLTextureLibrary *)job->driver->icons,
if (gsk_gl_texture_library_can_cache ((GskGLTextureLibrary *)job->driver->icons_library,
texture->width,
texture->height) &&
!GDK_IS_GL_TEXTURE (texture))
{
const GskGLIconData *icon_data;
gsk_gl_icon_library_lookup_or_add (job->driver->icons, texture, &icon_data);
gsk_gl_icon_library_lookup_or_add (job->driver->icons_library, texture, &icon_data);
offscreen->texture_id = GSK_GL_TEXTURE_ATLAS_ENTRY_TEXTURE (icon_data);
memcpy (&offscreen->area, &icon_data->entry.area, sizeof offscreen->area);
}

View File

@ -29,9 +29,9 @@
struct _GskGLShadowLibrary
{
GObject parent_instance;
GObject parent_instance;
GskGLDriver *driver;
GArray *shadows;
GArray *shadows;
};
typedef struct _Shadow