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

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

Issue 10389109: Add gfx::Screen::IsEnabled() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nicer diff Created 8 years, 7 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 21fb659881aa18849fdf1b96d18572f44c72171f..1c65c0f5bc9d29f721f9fa0e232a610c633c2149 100644
--- a/ui/gfx/image/image_skia.cc
+++ b/ui/gfx/image/image_skia.cc
@@ -91,15 +91,10 @@ void ImageSkia::AddBitmapForScale(const SkBitmap& bitmap,
if (isNull()) {
Init(bitmap, dip_scale_factor);
} else {
- // We currently assume that the bitmap size = 1x size * |dip_scale_factor|.
- // TODO(pkotwicz): Do something better because of rounding errors when
- // |dip_scale_factor| is not an int.
- // TODO(pkotwicz): Remove DCHECK for dip_scale_factor == 1.0f once
- // image_loading_tracker correctly handles multiple sized images.
- DCHECK(dip_scale_factor == 1.0f ||
- static_cast<int>(width() * dip_scale_factor) == bitmap.width());
- DCHECK(dip_scale_factor == 1.0f ||
- static_cast<int>(height() * dip_scale_factor) == bitmap.height());
+ // Currently data packs include 1x scale images whenever a different scale
+ // image is unavailable. As |dip_scale_factor| is derived from the data
+ // pack, sometimes |dip_scale_factor| is incorrect.
+ // TODO(pkotwicz): Fix this and add DCHECK.
storage_->AddBitmap(bitmap);
}
}
« no previous file with comments | « ui/base/resource/resource_bundle.cc ('k') | ui/gfx/screen.h » ('j') | ui/gfx/screen_aura.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698