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

Unified Diff: ui/gfx/skbitmap_operations.cc

Issue 12257016: (Not ready for review!) Toolbar and views high dpi support. Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Cleaned up more useless diffs. Created 7 years, 10 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/gfx/screen_win.cc ('k') | ui/views/controls/button/image_button.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/skbitmap_operations.cc
diff --git a/ui/gfx/skbitmap_operations.cc b/ui/gfx/skbitmap_operations.cc
index 10cce9c45b27aaf3061cafddda74f87b28685de7..ce3beb442fb2d08afcb86fefd2709a366b92ca55 100644
--- a/ui/gfx/skbitmap_operations.cc
+++ b/ui/gfx/skbitmap_operations.cc
@@ -133,14 +133,16 @@ SkBitmap SkBitmapOperations::CreateBlendedBitmap(const SkBitmap& first,
// static
SkBitmap SkBitmapOperations::CreateMaskedBitmap(const SkBitmap& rgb,
const SkBitmap& alpha) {
- DCHECK(rgb.width() == alpha.width());
- DCHECK(rgb.height() == alpha.height());
+ // DCHECK(rgb.width() == alpha.width());
+ // DCHECK(rgb.height() == alpha.height());
DCHECK(rgb.bytesPerPixel() == alpha.bytesPerPixel());
DCHECK(rgb.config() == SkBitmap::kARGB_8888_Config);
DCHECK(alpha.config() == SkBitmap::kARGB_8888_Config);
SkBitmap masked;
- masked.setConfig(SkBitmap::kARGB_8888_Config, rgb.width(), rgb.height(), 0);
+ masked.setConfig(SkBitmap::kARGB_8888_Config,
+ std::min(rgb.width(), alpha.width()),
+ std::min(rgb.height(), alpha.height()), 0);
masked.allocPixels();
masked.eraseARGB(0, 0, 0, 0);
« no previous file with comments | « ui/gfx/screen_win.cc ('k') | ui/views/controls/button/image_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698