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

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

Issue 10783015: Add ability to store hidpi theme images in data pack (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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.cc
diff --git a/ui/gfx/image/image_skia.cc b/ui/gfx/image/image_skia.cc
index fadd2e606236a00ef3e76e9d5bda7804067e8778..327000983dafcf86d16ec666c6f8c4e81764b3ac 100644
--- a/ui/gfx/image/image_skia.cc
+++ b/ui/gfx/image/image_skia.cc
@@ -53,6 +53,8 @@ class ImageSkiaStorage : public base::RefCounted<ImageSkiaStorage> {
size_(size) {
}
+ bool has_source() const { return source_.get() != NULL; }
+
std::vector<gfx::ImageSkiaRep>& image_reps() { return image_reps_; }
const gfx::Size& size() const { return size_; }
@@ -260,7 +262,17 @@ std::vector<ImageSkiaRep> ImageSkia::image_reps() const {
if (isNull())
return std::vector<ImageSkiaRep>();
- return storage_->image_reps();
+ ImageSkiaReps internal_image_reps = storage_->image_reps();
+ // Create list of image reps to return, skipping null image reps which were
+ // added for caching purposes only.
+ ImageSkiaReps image_reps;
+ for (ImageSkiaReps::iterator it = internal_image_reps.begin();
+ it != internal_image_reps.end(); ++it) {
+ if (!it->is_null())
+ image_reps.push_back(*it);
+ }
+
+ return image_reps;
}
const SkBitmap* ImageSkia::bitmap() const {

Powered by Google App Engine
This is Rietveld 408576698