Chromium Code Reviews| Index: ui/gfx/skbitmap_operations.cc |
| diff --git a/ui/gfx/skbitmap_operations.cc b/ui/gfx/skbitmap_operations.cc |
| index bcc27238d5734e30acbfb0ef63fecfa8d2be520a..a14fb389fcc219c3b02fbdffc0fc9bcd1db2bd11 100644 |
| --- a/ui/gfx/skbitmap_operations.cc |
| +++ b/ui/gfx/skbitmap_operations.cc |
| @@ -133,14 +133,18 @@ SkBitmap SkBitmapOperations::CreateBlendedBitmap(const SkBitmap& first, |
| // static |
| SkBitmap SkBitmapOperations::CreateMaskedBitmap(const SkBitmap& rgb, |
| const SkBitmap& alpha) { |
| +#if !defined(ENABLE_HIDPI) |
|
kevers
2013/04/19 20:31:42
These changes should not be necessary. The roundi
|
| DCHECK(rgb.width() == alpha.width()); |
| DCHECK(rgb.height() == alpha.height()); |
| +#endif |
| 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); |