Index: ui/gfx/image/image_skia.cc |
diff --git a/ui/gfx/image/image_skia.cc b/ui/gfx/image/image_skia.cc |
index a886ab02d35b732c026e04eb5279e99475de8d33..7cc89e4e4bd54de9a53561fffc92fff46083e0aa 100644 |
--- a/ui/gfx/image/image_skia.cc |
+++ b/ui/gfx/image/image_skia.cc |
@@ -61,11 +61,18 @@ class ImageSkiaStorage : public base::RefCounted<ImageSkiaStorage>, |
ImageSkiaStorage(ImageSkiaSource* source, ui::ScaleFactor scale_factor) |
: source_(source), |
read_only_(false) { |
- const ImageSkiaRep& image = *FindRepresentation(scale_factor, true); |
- if (image.is_null()) |
+ ImageSkia::ImageSkiaReps::iterator it = |
+ FindRepresentation(scale_factor, true); |
+ // TODO(oshima): This is necessary as there are scale indepdent |
+ // resources loaded as 100P. Fix them and remove this. |
+ if (scale_factor != ui::SCALE_FACTOR_100P && |
+ (it == image_reps_.end() || it->is_null())) |
+ it = FindRepresentation(ui::SCALE_FACTOR_100P, true); |
+ |
+ if (it == image_reps_.end() || it->is_null()) |
source_.reset(); |
else |
- size_.SetSize(image.GetWidth(), image.GetHeight()); |
+ size_.SetSize(it->GetWidth(), it->GetHeight()); |
} |
bool has_source() const { return source_.get() != NULL; } |