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) |
| 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); |
|
kevers
2013/06/03 17:28:50
Is this change necessary? Recent changes to the r
girard
2013/06/03 22:31:55
This prevents tearing in the new tab page. We've s
|
| masked.allocPixels(); |
| masked.eraseARGB(0, 0, 0, 0); |