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

Unified Diff: third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp

Issue 2622283005: Fix DCHECK in createTransparentSkImage (Closed)
Patch Set: Created 3 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp b/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
index b0f92dbd71f8906be13a81d75d3a2bb25e3b4cf7..fe9be298adabee153e3c380ff4ec19fb40d1f11c 100644
--- a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
@@ -112,7 +112,8 @@ const int MaxGlobalGPUMemoryUsage =
const int UndefinedQualityValue = -1.0;
sk_sp<SkImage> createTransparentSkImage(const IntSize& size) {
- DCHECK(ImageBuffer::canCreateImageBuffer(size));
+ if (!ImageBuffer::canCreateImageBuffer(size))
+ return nullptr;
sk_sp<SkSurface> surface =
SkSurface::MakeRasterN32Premul(size.width(), size.height());
return surface ? surface->makeImageSnapshot() : nullptr;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698