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

Unified Diff: Source/platform/graphics/GraphicsContext.cpp

Issue 540033002: use tryAllocPixels to check the result, allocPixels to require success (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 3 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
Index: Source/platform/graphics/GraphicsContext.cpp
diff --git a/Source/platform/graphics/GraphicsContext.cpp b/Source/platform/graphics/GraphicsContext.cpp
index a4aca79b256e33ae0af1ce6411d82da15a655122..85d38bff20eab2d940e3755af6c68d7a80bbae4f 100644
--- a/Source/platform/graphics/GraphicsContext.cpp
+++ b/Source/platform/graphics/GraphicsContext.cpp
@@ -798,7 +798,7 @@ void GraphicsContext::drawLineForDocumentMarker(const FloatPoint& pt, float widt
const int rowPixels = 4 * deviceScaleFactor;
const int colPixels = 3 * deviceScaleFactor;
SkBitmap bitmap;
- if (!bitmap.allocN32Pixels(rowPixels, colPixels))
+ if (!bitmap.tryAllocN32Pixels(rowPixels, colPixels))
return;
bitmap.eraseARGB(0, 0, 0, 0);
@@ -856,7 +856,7 @@ void GraphicsContext::drawLineForDocumentMarker(const FloatPoint& pt, float widt
const int rowPixels = 32 * deviceScaleFactor; // Must be multiple of 4 for pattern below.
const int colPixels = 2 * deviceScaleFactor;
SkBitmap bitmap;
- if (!bitmap.allocN32Pixels(rowPixels, colPixels))
+ if (!bitmap.tryAllocN32Pixels(rowPixels, colPixels))
return;
bitmap.eraseARGB(0, 0, 0, 0);
« no previous file with comments | « Source/platform/graphics/DeferredImageDecoderTest.cpp ('k') | Source/platform/graphics/GraphicsContextTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698