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