Chromium Code Reviews| Index: skia/ext/vector_platform_device_emf_win.cc |
| diff --git a/skia/ext/vector_platform_device_emf_win.cc b/skia/ext/vector_platform_device_emf_win.cc |
| index 1dd59d370c4b3c3e0bbe5bf49e532f0294b883ee..080b71bbd107746ec460066862f55ca1d1435f93 100644 |
| --- a/skia/ext/vector_platform_device_emf_win.cc |
| +++ b/skia/ext/vector_platform_device_emf_win.cc |
| @@ -81,20 +81,16 @@ SkBaseDevice* VectorPlatformDeviceEmf::create(HDC dc, int width, int height) { |
| // VectorPlatformDeviceEmf has no way to detect this, so the HBITMAP |
| // could be released while SkBitmap still has a reference to it. Be |
| // cautious. |
| - if (width == bitmap_data.bmWidth && |
| - height == bitmap_data.bmHeight) { |
| - bitmap.setConfig(SkBitmap::kARGB_8888_Config, |
| - bitmap_data.bmWidth, |
| - bitmap_data.bmHeight, |
| - bitmap_data.bmWidthBytes); |
| - bitmap.setPixels(bitmap_data.bmBits); |
| - succeeded = true; |
| + if (width == bitmap_data.bmWidth && height == bitmap_data.bmHeight) { |
| + SkImageInfo info = SkImageInfo::MakeN32Premul(width, height); |
| + succeeded = bitmap.installPixels(info, bitmap_data.bmBits, |
| + bitmap_data.bmWidthBytes); |
| } |
| } |
| } |
| if (!succeeded) |
| - bitmap.setConfig(SkBitmap::kARGB_8888_Config, width, height); |
| + bitmap.setInfo(SkImageInfo::MakeEmpty(width, height)); |
|
f(malita)
2014/06/16 21:00:45
This actually looks like it's fixing an existing i
reed1
2014/06/16 21:19:04
Yes, I think so.
|
| return new VectorPlatformDeviceEmf(dc, bitmap); |
| } |