| 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 12 matching lines...) Expand all Loading... |
| 23 typedef OffscreenCanvasRenderingContext2DOrWebGLRenderingContextOrWebGL2Renderin
gContext OffscreenRenderingContext; | 23 typedef OffscreenCanvasRenderingContext2DOrWebGLRenderingContextOrWebGL2Renderin
gContext OffscreenRenderingContext; |
| 24 | 24 |
| 25 class CORE_EXPORT OffscreenCanvas final : public GarbageCollectedFinalized<Offsc
reenCanvas>, public ScriptWrappable, public CanvasImageSource { | 25 class CORE_EXPORT OffscreenCanvas final : public GarbageCollectedFinalized<Offsc
reenCanvas>, public ScriptWrappable, public CanvasImageSource { |
| 26 DEFINE_WRAPPERTYPEINFO(); | 26 DEFINE_WRAPPERTYPEINFO(); |
| 27 public: | 27 public: |
| 28 static OffscreenCanvas* create(unsigned width, unsigned height); | 28 static OffscreenCanvas* create(unsigned width, unsigned height); |
| 29 | 29 |
| 30 // IDL attributes | 30 // IDL attributes |
| 31 unsigned width() const { return m_size.width(); } | 31 unsigned width() const { return m_size.width(); } |
| 32 unsigned height() const { return m_size.height(); } | 32 unsigned height() const { return m_size.height(); } |
| 33 void setWidth(unsigned); | 33 void setWidth(unsigned, ExceptionState&); |
| 34 void setHeight(unsigned); | 34 void setHeight(unsigned, ExceptionState&); |
| 35 | 35 |
| 36 // API Methods | 36 // API Methods |
| 37 ImageBitmap* transferToImageBitmap(ExceptionState&); | 37 ImageBitmap* transferToImageBitmap(ExceptionState&); |
| 38 | 38 |
| 39 IntSize size() const { return m_size; } | 39 IntSize size() const { return m_size; } |
| 40 void setAssociatedCanvasId(int canvasId) { m_canvasId = canvasId; } | 40 void setAssociatedCanvasId(int canvasId) { m_canvasId = canvasId; } |
| 41 int getAssociatedCanvasId() const { return m_canvasId; } | 41 int getAssociatedCanvasId() const { return m_canvasId; } |
| 42 bool isNeutered() const { return m_isNeutered; } | 42 bool isNeutered() const { return m_isNeutered; } |
| 43 void setNeutered(); | 43 void setNeutered(); |
| 44 CanvasRenderingContext* getCanvasRenderingContext(ScriptState*, const String
&, const CanvasContextCreationAttributes&); | 44 CanvasRenderingContext* getCanvasRenderingContext(ScriptState*, const String
&, const CanvasContextCreationAttributes&); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 // If this object is not created via HTMLCanvasElement.transferControlToOffs
creen(), | 97 // If this object is not created via HTMLCanvasElement.transferControlToOffs
creen(), |
| 98 // then the following members would remain as initialized zero values. | 98 // then the following members would remain as initialized zero values. |
| 99 uint32_t m_clientId = 0; | 99 uint32_t m_clientId = 0; |
| 100 uint32_t m_localId = 0; | 100 uint32_t m_localId = 0; |
| 101 uint64_t m_nonce = 0; | 101 uint64_t m_nonce = 0; |
| 102 }; | 102 }; |
| 103 | 103 |
| 104 } // namespace blink | 104 } // namespace blink |
| 105 | 105 |
| 106 #endif // OffscreenCanvas_h | 106 #endif // OffscreenCanvas_h |
| OLD | NEW |