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

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: rebase 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..8ade02136e791477f64040698a2a5e53a8cb4ace 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,
Stephen White 2016/02/10 15:34:55 MicroNit: comma splice. Use a semicolon, or split
+ // we could improve the abstraction by making all context types paint
+ /// themselves (implement paint).
Stephen White 2016/02/10 15:34:55 MicroNit: ///
+ 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