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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 uint32_t clientId() const { return m_clientId; } | 62 uint32_t clientId() const { return m_clientId; } |
63 uint32_t localId() const { return m_localId; } | 63 uint32_t localId() const { return m_localId; } |
64 uint64_t nonce() const { return m_nonce; } | 64 uint64_t nonce() const { return m_nonce; } |
65 | 65 |
66 // CanvasImageSource implementation | 66 // CanvasImageSource implementation |
67 PassRefPtr<Image> getSourceImageForCanvas(SourceImageStatus*, AccelerationHi
nt, SnapshotReason, const FloatSize&) const final; | 67 PassRefPtr<Image> getSourceImageForCanvas(SourceImageStatus*, AccelerationHi
nt, SnapshotReason, const FloatSize&) const final; |
68 bool wouldTaintOrigin(SecurityOrigin*) const final { return !m_originClean;
} | 68 bool wouldTaintOrigin(SecurityOrigin*) const final { return !m_originClean;
} |
69 bool isOffscreenCanvas() const final { return true; } | 69 bool isOffscreenCanvas() const final { return true; } |
70 FloatSize elementSize(const FloatSize& defaultObjectSize) const final { retu
rn FloatSize(width(), height()); } | 70 FloatSize elementSize(const FloatSize& defaultObjectSize) const final { retu
rn FloatSize(width(), height()); } |
71 bool isOpaque() const final; | 71 bool isOpaque() const final; |
| 72 bool isAccelerated() const final; |
72 int sourceWidth() final { return width(); } | 73 int sourceWidth() final { return width(); } |
73 int sourceHeight() final { return height(); } | 74 int sourceHeight() final { return height(); } |
74 | 75 |
75 DECLARE_VIRTUAL_TRACE(); | 76 DECLARE_VIRTUAL_TRACE(); |
76 | 77 |
77 private: | 78 private: |
78 explicit OffscreenCanvas(const IntSize&); | 79 explicit OffscreenCanvas(const IntSize&); |
79 | 80 |
80 using ContextFactoryVector = Vector<std::unique_ptr<CanvasRenderingContextFa
ctory>>; | 81 using ContextFactoryVector = Vector<std::unique_ptr<CanvasRenderingContextFa
ctory>>; |
81 static ContextFactoryVector& renderingContextFactories(); | 82 static ContextFactoryVector& renderingContextFactories(); |
(...skipping 15 matching lines...) Expand all Loading... |
97 // If this object is not created via HTMLCanvasElement.transferControlToOffs
creen(), | 98 // If this object is not created via HTMLCanvasElement.transferControlToOffs
creen(), |
98 // then the following members would remain as initialized zero values. | 99 // then the following members would remain as initialized zero values. |
99 uint32_t m_clientId = 0; | 100 uint32_t m_clientId = 0; |
100 uint32_t m_localId = 0; | 101 uint32_t m_localId = 0; |
101 uint64_t m_nonce = 0; | 102 uint64_t m_nonce = 0; |
102 }; | 103 }; |
103 | 104 |
104 } // namespace blink | 105 } // namespace blink |
105 | 106 |
106 #endif // OffscreenCanvas_h | 107 #endif // OffscreenCanvas_h |
OLD | NEW |