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

Unified Diff: Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp

Issue 9340004: Merge 104501 - [chromium win] Creating lots of temporary canvas contexts will crash. (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/963/
Patch Set: Created 8 years, 10 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 | « Source/WebCore/platform/graphics/ImageBuffer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp
===================================================================
--- Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp (revision 106844)
+++ Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp (working copy)
@@ -93,6 +93,13 @@
return canvas;
}
+static SkCanvas* createNonPlatformCanvas(const IntSize& size)
+{
+ SkCanvas* canvas = new SkCanvas();
+ canvas->setDevice(new SkDevice(SkBitmap::kARGB_8888_Config, size.width(), size.height()))->unref();
+ return canvas;
+}
+
ImageBuffer::ImageBuffer(const IntSize& size, ColorSpace, RenderingMode renderingMode, bool& success)
: m_data(size)
, m_size(size)
@@ -101,6 +108,8 @@
if (renderingMode == Accelerated)
canvas = adoptPtr(createAcceleratedCanvas(size, &m_data));
+ else if (renderingMode == UnacceleratedNonPlatformBuffer)
+ canvas = adoptPtr(createNonPlatformCanvas(size));
if (!canvas)
canvas = adoptPtr(skia::TryCreateBitmapCanvas(size.width(), size.height(), false));
« no previous file with comments | « Source/WebCore/platform/graphics/ImageBuffer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698