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

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

Issue 2493673002: Synchronize OffscreenCanvas content with the placeholder canvas (Closed)
Patch Set: fix obsolete test Created 4 years, 1 month 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.h
diff --git a/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.h b/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.h
index 656b4dd24c7d6d2a11270afbd14339a5fdc15ee2..1a5c283379dab83e64b6b5e535cdc10e4e53be5e 100644
--- a/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.h
+++ b/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.h
@@ -47,8 +47,13 @@ class CORE_EXPORT OffscreenCanvas final
ExceptionState&);
IntSize size() const { return m_size; }
- void setAssociatedCanvasId(int canvasId) { m_canvasId = canvasId; }
- int getAssociatedCanvasId() const { return m_canvasId; }
+ void setPlaceholderCanvasId(int canvasId) {
+ m_placeholderCanvasId = canvasId;
+ }
+ int placeholderCanvasId() const { return m_placeholderCanvasId; }
+ bool hasPlaceholderCanvas() {
+ return m_placeholderCanvasId != kNoPlaceholderCanvas;
+ }
bool isNeutered() const { return m_isNeutered; }
void setNeutered();
CanvasRenderingContext* getCanvasRenderingContext(
@@ -110,8 +115,12 @@ class CORE_EXPORT OffscreenCanvas final
static CanvasRenderingContextFactory* getRenderingContextFactory(int);
Member<CanvasRenderingContext> m_context;
- int m_canvasId = -1; // DOMNodeIds starts from 0, using -1 to indicate no
- // associated canvas element.
+
+ enum {
+ kNoPlaceholderCanvas = -1, // DOMNodeIds starts from 0, using -1 to
+ // indicate no associated canvas element.
+ };
+ int m_placeholderCanvasId = kNoPlaceholderCanvas;
IntSize m_size;
bool m_isNeutered = false;

Powered by Google App Engine
This is Rietveld 408576698