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 51ad64568734c0db8969c0b6ee5d4b1e86923de3..cd95ec8945820cd309907c5be372a918edabe55d 100644 |
--- a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp |
+++ b/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp |
@@ -335,7 +335,7 @@ void HTMLCanvasElement::restoreCanvasMatrixClipStack(SkCanvas* canvas) const |
void HTMLCanvasElement::doDeferredPaintInvalidation() |
{ |
ASSERT(!m_dirtyRect.isEmpty()); |
- if (is3D()) { |
+ if (!m_context->is2d()) { |
didFinalizeFrame(); |
} else { |
ASSERT(hasImageBuffer()); |
@@ -461,6 +461,12 @@ void HTMLCanvasElement::paint(GraphicsContext& context, const LayoutRect& r) |
if (!paintsIntoCanvasBuffer() && !document().printing()) |
return; |
+ // TODO(junov): Paint is currently only implemented by ImageBitmap contexts. |
+ // We could improve the abstraction by making all context types paint |
+ // themselves (implement paint()). |
+ if (m_context->paint(context, pixelSnappedIntRect(r))) |
+ return; |
+ |
m_context->paintRenderingResultsToCanvas(FrontBuffer); |
if (hasImageBuffer()) { |
if (!context.contextDisabled()) { |