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

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

Issue 10391179: Revert 137622 - Fix a couple of bugs with the image skia implementation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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
« no previous file with comments | « ui/base/resource/resource_bundle.cc ('k') | ui/gfx/screen.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/image/image_skia.cc
===================================================================
--- ui/gfx/image/image_skia.cc (revision 137624)
+++ ui/gfx/image/image_skia.cc (working copy)
@@ -91,10 +91,15 @@
if (isNull()) {
Init(bitmap, dip_scale_factor);
} else {
- // 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.
+ // 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());
storage_->AddBitmap(bitmap);
}
}
« no previous file with comments | « ui/base/resource/resource_bundle.cc ('k') | ui/gfx/screen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698