After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 633595 - st_texture_cache_load_from_raw: Don't pointlessly include size in cache key
st_texture_cache_load_from_raw: Don't pointlessly include size in cache key
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2010-10-30 23:48 UTC by Owen Taylor
Modified: 2010-11-12 22:37 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
st_texture_cache_load_from_raw: Don't pointlessly include size in cache key (1.31 KB, patch)
2010-10-30 23:48 UTC, Owen Taylor
committed Details | Review

Description Owen Taylor 2010-10-30 23:48:12 UTC
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.
Comment 1 Owen Taylor 2010-10-30 23:48:15 UTC
Created attachment 173580 [details] [review]
st_texture_cache_load_from_raw: Don't pointlessly include size in cache key
Comment 2 Dan Winship 2010-11-01 13:22:32 UTC
Comment on attachment 173580 [details] [review]
st_texture_cache_load_from_raw: Don't pointlessly include size in cache key

>-  /* In theory, two images of different size could have the same
>-   * pixel data. We ignore that theory.
>-   */

That comment is still true, though still ignorable. (If we wanted to be safe we could include width, height, and has_alpha in the key.)
Comment 3 Owen Taylor 2010-11-01 13:46:33 UTC
(In reply to comment #2)
> (From update of attachment 173580 [details] [review])
> >-  /* In theory, two images of different size could have the same
> >-   * pixel data. We ignore that theory.
> >-   */
> 
> That comment is still true, though still ignorable. (If we wanted to be safe we
> could include width, height, and has_alpha in the key.)

Oh, the comment meant "two images of different width and height could have the same pixel data" - it wasn't referring to the "size" parameter. Confusing. Another approach would be to add width, height has_alpha to the start of the check-summed data. I'll add the comment back clarified or (time permitting) make a new version that obsoletes it before committing.
Comment 4 Owen Taylor 2010-11-12 22:37:53 UTC
Comment restored and made more explanatory; didn't actually do the work to
use a more accurate checksum.

Attachment 173580 [details] pushed as 86f3a63 - st_texture_cache_load_from_raw: Don't pointlessly include size in cache key