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

Unified Diff: skia/ext/platform_canvas.h

Issue 7686006: Fix crash when allocation of very large HTML canvas fails. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 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 | skia/ext/platform_canvas.cc » ('j') | skia/ext/platform_canvas.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/ext/platform_canvas.h
===================================================================
--- skia/ext/platform_canvas.h (revision 97133)
+++ skia/ext/platform_canvas.h (working copy)
@@ -109,6 +109,13 @@
// transparency: this will enable some optimizations.
SK_API SkCanvas* CreateBitmapCanvas(int width, int height, bool is_opaque);
+// Non-crashing version of CreateBitmapCanvas
+// returns NULL if allocation fails for any reason.
+// Use this instead of CreateBitmapCanvas in places that are likely to
+// attempt to allocate very large canvases (therefore likely to fail),
+// and where it is possible to recover gracefully from the failed allocation.
+SK_API SkCanvas* TryCreateBitmapCanvas(int width, int height, bool is_opaque);
+
// Returns true if native platform routines can be used to draw on the
// given canvas. If this function returns false, BeginPlatformPaint will
// return NULL PlatformSurface.
« no previous file with comments | « no previous file | skia/ext/platform_canvas.cc » ('j') | skia/ext/platform_canvas.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698