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

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

Issue 1598923002: Add ImageBitmapRenderingContext (experimental) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: another missing adoptRef Created 4 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
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()) {

Powered by Google App Engine
This is Rietveld 408576698