Chromium Code Reviews
Descriptiongfx::Image: Made Image objects shallow-copy their representations.
Previously, Images kept a reference-counted map. Now they just clone the
entire map. All of the objects inside are reference-counted, so this is
slightly more expensive but not by much, and avoids some thread safety
issues.
PROOF OF CONCEPT / DO NOT SUBMIT
Problems with this approach:
- Breaks ToImageSkia(); the returned pointer now points into storage
owned by the immediate Image object it was called on (previously it
pointed at memory shared by all of the Image objects). Lots of client
code relies on this and it is non-trivial to clean it up.
- Efficiency issues: This weakens the effects of caching because each
individual image object has its own copy of the cache (e.g., imagine
an Image with an ImageRepPNG is copied, then AsImageSkia() is called,
then the copy is deleted; the original Image will not have an
ImageSkia rep).
BUG=600237
Patch Set 1 #Patch Set 2 : Rebase. #
Messages
Total messages: 1 (1 generated)
|
||||||||||||||||||||||||||||