| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef OffscreenCanvas_h | 5 #ifndef OffscreenCanvas_h |
| 6 #define OffscreenCanvas_h | 6 #define OffscreenCanvas_h |
| 7 | 7 |
| 8 #include "bindings/core/v8/ScriptPromise.h" | 8 #include "bindings/core/v8/ScriptPromise.h" |
| 9 #include "bindings/core/v8/ScriptState.h" | 9 #include "bindings/core/v8/ScriptState.h" |
| 10 #include "bindings/core/v8/ScriptWrappable.h" | 10 #include "bindings/core/v8/ScriptWrappable.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 IntSize size() const { return m_size; } | 36 IntSize size() const { return m_size; } |
| 37 void setAssociatedCanvasId(int canvasId) { m_canvasId = canvasId; } | 37 void setAssociatedCanvasId(int canvasId) { m_canvasId = canvasId; } |
| 38 int getAssociatedCanvasId() const { return m_canvasId; } | 38 int getAssociatedCanvasId() const { return m_canvasId; } |
| 39 bool isNeutered() const { return m_isNeutered; } | 39 bool isNeutered() const { return m_isNeutered; } |
| 40 void setNeutered(); | 40 void setNeutered(); |
| 41 CanvasRenderingContext* getCanvasRenderingContext(ScriptState*, const String
&, const CanvasContextCreationAttributes&); | 41 CanvasRenderingContext* getCanvasRenderingContext(ScriptState*, const String
&, const CanvasContextCreationAttributes&); |
| 42 CanvasRenderingContext* renderingContext() { return m_context; } | 42 CanvasRenderingContext* renderingContext() { return m_context; } |
| 43 | 43 |
| 44 static void registerRenderingContextFactory(PassOwnPtr<CanvasRenderingContex
tFactory>); | 44 static void registerRenderingContextFactory(PassOwnPtr<CanvasRenderingContex
tFactory>); |
| 45 | 45 |
| 46 bool originClean() const; |
| 47 void setOriginTainted() { m_originClean = false; } |
| 48 |
| 46 DECLARE_VIRTUAL_TRACE(); | 49 DECLARE_VIRTUAL_TRACE(); |
| 47 | 50 |
| 48 private: | 51 private: |
| 49 explicit OffscreenCanvas(const IntSize&); | 52 explicit OffscreenCanvas(const IntSize&); |
| 50 | 53 |
| 51 using ContextFactoryVector = Vector<OwnPtr<CanvasRenderingContextFactory>>; | 54 using ContextFactoryVector = Vector<OwnPtr<CanvasRenderingContextFactory>>; |
| 52 static ContextFactoryVector& renderingContextFactories(); | 55 static ContextFactoryVector& renderingContextFactories(); |
| 53 static CanvasRenderingContextFactory* getRenderingContextFactory(int); | 56 static CanvasRenderingContextFactory* getRenderingContextFactory(int); |
| 54 | 57 |
| 55 Member<CanvasRenderingContext> m_context; | 58 Member<CanvasRenderingContext> m_context; |
| 56 int m_canvasId = -1; // DOMNodeIds starts from 0, using -1 to indicate no as
sociated canvas element. | 59 int m_canvasId = -1; // DOMNodeIds starts from 0, using -1 to indicate no as
sociated canvas element. |
| 57 IntSize m_size; | 60 IntSize m_size; |
| 58 bool m_isNeutered = false; | 61 bool m_isNeutered = false; |
| 62 |
| 63 bool m_originClean; |
| 59 }; | 64 }; |
| 60 | 65 |
| 61 } // namespace blink | 66 } // namespace blink |
| 62 | 67 |
| 63 #endif // OffscreenCanvas_h | 68 #endif // OffscreenCanvas_h |
| OLD | NEW |