Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(337)

Unified Diff: ui/gfx/image/image_skia.h

Issue 10820049: Load 2x resources on demand (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove unnecessary code Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/gfx/image/image_skia.h
diff --git a/ui/gfx/image/image_skia.h b/ui/gfx/image/image_skia.h
index 24422d2f09a5559c1f28a53532925a83daa35130..fd9c40f4471fcab598a8caeab764bea70dc254ab 100644
--- a/ui/gfx/image/image_skia.h
+++ b/ui/gfx/image/image_skia.h
@@ -37,6 +37,7 @@ class UI_EXPORT ImageSkia {
// Creates an instance that will use the |source| to get the image
// for scale factors. |size| specifes the size of the image in DIP.
+ // ImageSkia owns |source|.
ImageSkia(ImageSkiaSource* source, const gfx::Size& size);
// Adds ref to passed in bitmap.
@@ -120,6 +121,15 @@ class UI_EXPORT ImageSkia {
// when source is used.
std::vector<gfx::ImageSkiaRep> image_reps() const;
+ // Delete the ImageSkiaSource if any. It will make GetRepresentation
+ // thread safe because it will no longer update the storage.
+ void DeleteSource();
+
+ // When the source is available, generates all ImageReps for
+ // supported scale factors. This method is defined as const as
+ // the state change in the storage is agnostic to the caller.
+ void EnsureRepsForSupportedScaleFactors() const;
+
private:
// Initialize ImageSkiaStorage with passed in parameters.
// If the image rep's bitmap is empty, ImageStorage is set to NULL.

Powered by Google App Engine
This is Rietveld 408576698