| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 bool originClean() const; | 63 bool originClean() const; |
| 64 void setOriginTainted() { m_originClean = false; } | 64 void setOriginTainted() { m_originClean = false; } |
| 65 // TODO(crbug.com/630356): apply the flag to WebGL context as well | 65 // TODO(crbug.com/630356): apply the flag to WebGL context as well |
| 66 void setDisableReadingFromCanvasTrue() { m_disableReadingFromCanvas = true; } | 66 void setDisableReadingFromCanvasTrue() { m_disableReadingFromCanvas = true; } |
| 67 | 67 |
| 68 OffscreenCanvasFrameDispatcher* getOrCreateFrameDispatcher(); | 68 OffscreenCanvasFrameDispatcher* getOrCreateFrameDispatcher(); |
| 69 | 69 |
| 70 void setSurfaceId(uint32_t clientId, | 70 void setSurfaceId(uint32_t clientId, |
| 71 uint32_t sinkId, | 71 uint32_t sinkId, |
| 72 uint32_t localId, | 72 uint32_t localId, |
| 73 uint64_t nonceHigh, | 73 uint64_t nonce) { |
| 74 uint64_t nonceLow) { | |
| 75 m_clientId = clientId; | 74 m_clientId = clientId; |
| 76 m_sinkId = sinkId; | 75 m_sinkId = sinkId; |
| 77 m_localId = localId; | 76 m_localId = localId; |
| 78 m_nonceHigh = nonceHigh; | 77 m_nonce = nonce; |
| 79 m_nonceLow = nonceLow; | |
| 80 } | 78 } |
| 81 uint32_t clientId() const { return m_clientId; } | 79 uint32_t clientId() const { return m_clientId; } |
| 82 uint32_t sinkId() const { return m_sinkId; } | 80 uint32_t sinkId() const { return m_sinkId; } |
| 83 uint32_t localId() const { return m_localId; } | 81 uint32_t localId() const { return m_localId; } |
| 84 uint64_t nonceHigh() const { return m_nonceHigh; } | 82 uint64_t nonce() const { return m_nonce; } |
| 85 uint64_t nonceLow() const { return m_nonceLow; } | |
| 86 | 83 |
| 87 // CanvasImageSource implementation | 84 // CanvasImageSource implementation |
| 88 PassRefPtr<Image> getSourceImageForCanvas(SourceImageStatus*, | 85 PassRefPtr<Image> getSourceImageForCanvas(SourceImageStatus*, |
| 89 AccelerationHint, | 86 AccelerationHint, |
| 90 SnapshotReason, | 87 SnapshotReason, |
| 91 const FloatSize&) const final; | 88 const FloatSize&) const final; |
| 92 bool wouldTaintOrigin(SecurityOrigin*) const final { return !m_originClean; } | 89 bool wouldTaintOrigin(SecurityOrigin*) const final { return !m_originClean; } |
| 93 bool isOffscreenCanvas() const final { return true; } | 90 bool isOffscreenCanvas() const final { return true; } |
| 94 FloatSize elementSize(const FloatSize& defaultObjectSize) const final { | 91 FloatSize elementSize(const FloatSize& defaultObjectSize) const final { |
| 95 return FloatSize(width(), height()); | 92 return FloatSize(width(), height()); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 123 | 120 |
| 124 std::unique_ptr<OffscreenCanvasFrameDispatcher> m_frameDispatcher; | 121 std::unique_ptr<OffscreenCanvasFrameDispatcher> m_frameDispatcher; |
| 125 // cc::SurfaceId is broken into three integer components as this can be used | 122 // cc::SurfaceId is broken into three integer components as this can be used |
| 126 // in transfer of OffscreenCanvas across threads | 123 // in transfer of OffscreenCanvas across threads |
| 127 // If this object is not created via | 124 // If this object is not created via |
| 128 // HTMLCanvasElement.transferControlToOffscreen(), | 125 // HTMLCanvasElement.transferControlToOffscreen(), |
| 129 // then the following members would remain as initialized zero values. | 126 // then the following members would remain as initialized zero values. |
| 130 uint32_t m_clientId = 0; | 127 uint32_t m_clientId = 0; |
| 131 uint32_t m_sinkId = 0; | 128 uint32_t m_sinkId = 0; |
| 132 uint32_t m_localId = 0; | 129 uint32_t m_localId = 0; |
| 133 uint64_t m_nonceHigh = 0; | 130 uint64_t m_nonce = 0; |
| 134 uint64_t m_nonceLow = 0; | |
| 135 }; | 131 }; |
| 136 | 132 |
| 137 } // namespace blink | 133 } // namespace blink |
| 138 | 134 |
| 139 #endif // OffscreenCanvas_h | 135 #endif // OffscreenCanvas_h |
| OLD | NEW |