[gnome-shell] st_texture_cache_load_from_raw: Don't pointlessly include size in cache key



commit 86f3a637f1a47cae5bfd0959447fb91604a0d051
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Sat Oct 30 19:46:50 2010 -0400

    st_texture_cache_load_from_raw: Don't pointlessly include size in cache key
    
    The texture is independent of the size that the user passed in; so there
    is no obvious reason to include the texture in the cache key.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=633595

 src/st/st-texture-cache.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/src/st/st-texture-cache.c b/src/st/st-texture-cache.c
index b4aa8a7..cbbe7b1 100644
--- a/src/st/st-texture-cache.c
+++ b/src/st/st-texture-cache.c
@@ -1505,11 +1505,13 @@ st_texture_cache_load_from_raw (StTextureCache    *cache,
   texture = create_default_texture (cache);
   clutter_actor_set_size (CLUTTER_ACTOR (texture), size, size);
 
-  /* In theory, two images of different size could have the same
-   * pixel data. We ignore that theory.
+  /* In theory, two images of with different width and height could have the same
+   * pixel data and thus hash the same. (Say, a 16x16 and a 8x32 blank image.)
+   * We ignore this for now. If anybody hits this problem they should use
+   * GChecksum directly to compute a checksum including the width and height.
    */
   checksum = g_compute_checksum_for_data (G_CHECKSUM_SHA1, data, len);
-  key = g_strdup_printf (CACHE_PREFIX_RAW_CHECKSUM "checksum=%s,size=%d", checksum, size);
+  key = g_strdup_printf (CACHE_PREFIX_RAW_CHECKSUM "checksum=%s", checksum);
   g_free (checksum);
 
   texdata = g_hash_table_lookup (cache->priv->keyed_cache, key);



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