| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 static void registerRenderingContextFactory( | 67 static void registerRenderingContextFactory( |
| 68 std::unique_ptr<CanvasRenderingContextFactory>); | 68 std::unique_ptr<CanvasRenderingContextFactory>); |
| 69 | 69 |
| 70 bool originClean() const; | 70 bool originClean() const; |
| 71 void setOriginTainted() { m_originClean = false; } | 71 void setOriginTainted() { m_originClean = false; } |
| 72 // TODO(crbug.com/630356): apply the flag to WebGL context as well | 72 // TODO(crbug.com/630356): apply the flag to WebGL context as well |
| 73 void setDisableReadingFromCanvasTrue() { m_disableReadingFromCanvas = true; } | 73 void setDisableReadingFromCanvasTrue() { m_disableReadingFromCanvas = true; } |
| 74 | 74 |
| 75 OffscreenCanvasFrameDispatcher* getOrCreateFrameDispatcher(); | 75 OffscreenCanvasFrameDispatcher* getOrCreateFrameDispatcher(); |
| 76 | 76 |
| 77 void setSurfaceId(uint32_t clientId, | 77 void setFrameSinkId(uint32_t clientId, uint32_t sinkId) { |
| 78 uint32_t sinkId, | |
| 79 uint32_t localId, | |
| 80 uint64_t nonceHigh, | |
| 81 uint64_t nonceLow) { | |
| 82 m_clientId = clientId; | 78 m_clientId = clientId; |
| 83 m_sinkId = sinkId; | 79 m_sinkId = sinkId; |
| 84 m_localId = localId; | |
| 85 m_nonceHigh = nonceHigh; | |
| 86 m_nonceLow = nonceLow; | |
| 87 } | 80 } |
| 88 uint32_t clientId() const { return m_clientId; } | 81 uint32_t clientId() const { return m_clientId; } |
| 89 uint32_t sinkId() const { return m_sinkId; } | 82 uint32_t sinkId() const { return m_sinkId; } |
| 90 uint32_t localId() const { return m_localId; } | |
| 91 uint64_t nonceHigh() const { return m_nonceHigh; } | |
| 92 uint64_t nonceLow() const { return m_nonceLow; } | |
| 93 | 83 |
| 94 void setExecutionContext(ExecutionContext* context) { | 84 void setExecutionContext(ExecutionContext* context) { |
| 95 m_executionContext = context; | 85 m_executionContext = context; |
| 96 } | 86 } |
| 97 | 87 |
| 98 // EventTarget implementation | 88 // EventTarget implementation |
| 99 const AtomicString& interfaceName() const final { | 89 const AtomicString& interfaceName() const final { |
| 100 return EventTargetNames::OffscreenCanvas; | 90 return EventTargetNames::OffscreenCanvas; |
| 101 } | 91 } |
| 102 ExecutionContext* getExecutionContext() const { | 92 ExecutionContext* getExecutionContext() const { |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 | 129 |
| 140 IntSize m_size; | 130 IntSize m_size; |
| 141 bool m_isNeutered = false; | 131 bool m_isNeutered = false; |
| 142 | 132 |
| 143 bool m_originClean; | 133 bool m_originClean; |
| 144 bool m_disableReadingFromCanvas = false; | 134 bool m_disableReadingFromCanvas = false; |
| 145 | 135 |
| 146 bool isPaintable() const; | 136 bool isPaintable() const; |
| 147 | 137 |
| 148 std::unique_ptr<OffscreenCanvasFrameDispatcher> m_frameDispatcher; | 138 std::unique_ptr<OffscreenCanvasFrameDispatcher> m_frameDispatcher; |
| 149 // cc::SurfaceId is broken into three integer components as this can be used | 139 // cc::FrameSinkId is broken into two integer components as this can be used |
| 150 // in transfer of OffscreenCanvas across threads | 140 // in transfer of OffscreenCanvas across threads |
| 151 // If this object is not created via | 141 // If this object is not created via |
| 152 // HTMLCanvasElement.transferControlToOffscreen(), | 142 // HTMLCanvasElement.transferControlToOffscreen(), |
| 153 // then the following members would remain as initialized zero values. | 143 // then the following members would remain as initialized zero values. |
| 154 uint32_t m_clientId = 0; | 144 uint32_t m_clientId = 0; |
| 155 uint32_t m_sinkId = 0; | 145 uint32_t m_sinkId = 0; |
| 156 uint32_t m_localId = 0; | |
| 157 uint64_t m_nonceHigh = 0; | |
| 158 uint64_t m_nonceLow = 0; | |
| 159 }; | 146 }; |
| 160 | 147 |
| 161 } // namespace blink | 148 } // namespace blink |
| 162 | 149 |
| 163 #endif // OffscreenCanvas_h | 150 #endif // OffscreenCanvas_h |
| OLD | NEW |