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

Unified Diff: third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp

Issue 2255683005: Determine if OffscreenCanvas is paintable in different rendering contexts (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Canvas2DTypecast
Patch Set: enum Created 4 years, 4 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/offscreencanvas/OffscreenCanvas.cpp
diff --git a/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp b/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp
index 316d340d0bf159ad50a06f8032c4ad03143ffdbf..526b9fb656f544c1aa9ecb33fb014edb31cc774f 100644
--- a/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp
+++ b/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp
@@ -8,6 +8,7 @@
#include "core/html/canvas/CanvasContextCreationAttributes.h"
#include "core/html/canvas/CanvasRenderingContext.h"
#include "core/html/canvas/CanvasRenderingContextFactory.h"
+#include "platform/graphics/ImageBuffer.h"
#include "wtf/MathExtras.h"
#include <memory>
@@ -109,6 +110,13 @@ bool OffscreenCanvas::originClean() const
return m_originClean && !m_disableReadingFromCanvas;
}
+bool OffscreenCanvas::isPaintable() const
+{
+ if (!m_context)
+ return ImageBuffer::canCreateImageBuffer(m_size);
Ken Russell (switch to Gerrit) 2016/08/19 20:31:01 How reliable is this query, and how much does that
+ return m_context->isPaintable();
+}
+
DEFINE_TRACE(OffscreenCanvas)
{
visitor->trace(m_context);

Powered by Google App Engine
This is Rietveld 408576698