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

Unified Diff: skia/ext/bitmap_platform_device_win.cc

Issue 2025373002: Add error messages for canvas creation failures (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 | « components/test_runner/pixel_dump.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/ext/bitmap_platform_device_win.cc
diff --git a/skia/ext/bitmap_platform_device_win.cc b/skia/ext/bitmap_platform_device_win.cc
index 867843145175d1d94506e9b99f935881c4e5710d..f440edabbce029e2b256eeff215537b50b639220 100644
--- a/skia/ext/bitmap_platform_device_win.cc
+++ b/skia/ext/bitmap_platform_device_win.cc
@@ -168,19 +168,25 @@ BitmapPlatformDevice* BitmapPlatformDevice::Create(
// shared memory as the bitmap.
if (base::win::IsUser32AndGdi32Available()) {
hbitmap = CreateHBitmap(width, height, is_opaque, shared_section, &data);
- if (!hbitmap)
+ if (!hbitmap) {
+ LOG(ERROR) << "CreateHBitmap failed";
return NULL;
+ }
} else {
DCHECK(shared_section != NULL);
data = MapViewOfFile(shared_section, FILE_MAP_WRITE, 0, 0,
PlatformCanvasStrideForWidth(width) * height);
- if (!data)
+ if (!data) {
+ LOG(ERROR) << "MapViewOfFile failed";
return NULL;
+ }
}
SkBitmap bitmap;
- if (!InstallHBitmapPixels(&bitmap, width, height, is_opaque, data, hbitmap))
+ if (!InstallHBitmapPixels(&bitmap, width, height, is_opaque, data, hbitmap)) {
+ LOG(ERROR) << "InstallHBitmapPixels failed";
return NULL;
+ }
if (do_clear)
bitmap.eraseColor(0);
« no previous file with comments | « components/test_runner/pixel_dump.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698