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

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

Issue 895153002: Make CanvasRenderingContext2D use SkCanvas directly (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix issue with the copy composite operator Created 5 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/core/html/HTMLCanvasElement.h ('k') | Source/core/html/canvas/CanvasRenderingContext2D.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLCanvasElement.cpp
diff --git a/Source/core/html/HTMLCanvasElement.cpp b/Source/core/html/HTMLCanvasElement.cpp
index 37db4a2cc4859f46d9449032234d3c8571f886e3..09bc5d57aaba75922dfa80f5b3462ef1ea602a2a 100644
--- a/Source/core/html/HTMLCanvasElement.cpp
+++ b/Source/core/html/HTMLCanvasElement.cpp
@@ -700,7 +700,7 @@ void HTMLCanvasElement::updateExternallyAllocatedMemory() const
GraphicsContext* HTMLCanvasElement::drawingContext() const
{
- return buffer() ? m_imageBuffer->context() : 0;
+ return buffer() ? m_imageBuffer->context() : nullptr;
}
GraphicsContext* HTMLCanvasElement::existingDrawingContext() const
@@ -711,6 +711,19 @@ GraphicsContext* HTMLCanvasElement::existingDrawingContext() const
return drawingContext();
}
+SkCanvas* HTMLCanvasElement::drawingCanvas() const
+{
+ return buffer() ? m_imageBuffer->canvas() : nullptr;
+}
+
+SkCanvas* HTMLCanvasElement::existingDrawingCanvas() const
+{
+ if (!hasImageBuffer())
+ return nullptr;
+
+ return m_imageBuffer->canvas();
+}
+
ImageBuffer* HTMLCanvasElement::buffer() const
{
ASSERT(m_context);
« no previous file with comments | « Source/core/html/HTMLCanvasElement.h ('k') | Source/core/html/canvas/CanvasRenderingContext2D.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698