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

Unified Diff: skia/ext/vector_platform_device_emf_win.cc

Issue 331283002: stop calling deprecated setConfig (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase + android typo Created 6 years, 6 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 | « skia/ext/skia_utils_mac_unittest.mm ('k') | skia/ext/vector_platform_device_skia.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..31059aff7bd3ecabeb2dc5e77dbf2668638acbdd 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::MakeUnknown(width, height));
return new VectorPlatformDeviceEmf(dc, bitmap);
}
« no previous file with comments | « skia/ext/skia_utils_mac_unittest.mm ('k') | skia/ext/vector_platform_device_skia.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698