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 23 matching lines...) Expand all Loading... |
34 public: | 34 public: |
35 static OffscreenCanvas* create(unsigned width, unsigned height); | 35 static OffscreenCanvas* create(unsigned width, unsigned height); |
36 | 36 |
37 // IDL attributes | 37 // IDL attributes |
38 unsigned width() const { return m_size.width(); } | 38 unsigned width() const { return m_size.width(); } |
39 unsigned height() const { return m_size.height(); } | 39 unsigned height() const { return m_size.height(); } |
40 void setWidth(unsigned, ExceptionState&); | 40 void setWidth(unsigned, ExceptionState&); |
41 void setHeight(unsigned, ExceptionState&); | 41 void setHeight(unsigned, ExceptionState&); |
42 | 42 |
43 // API Methods | 43 // API Methods |
44 ImageBitmap* transferToImageBitmap(ExceptionState&); | 44 ImageBitmap* transferToImageBitmap(ScriptState*, ExceptionState&); |
45 ScriptPromise convertToBlob(ScriptState*, | 45 ScriptPromise convertToBlob(ScriptState*, |
46 const ImageEncodeOptions&, | 46 const ImageEncodeOptions&, |
47 ExceptionState&); | 47 ExceptionState&); |
48 | 48 |
49 IntSize size() const { return m_size; } | 49 IntSize size() const { return m_size; } |
50 void setAssociatedCanvasId(int canvasId) { m_canvasId = canvasId; } | 50 void setAssociatedCanvasId(int canvasId) { m_canvasId = canvasId; } |
51 int getAssociatedCanvasId() const { return m_canvasId; } | 51 int getAssociatedCanvasId() const { return m_canvasId; } |
52 bool isNeutered() const { return m_isNeutered; } | 52 bool isNeutered() const { return m_isNeutered; } |
53 void setNeutered(); | 53 void setNeutered(); |
54 CanvasRenderingContext* getCanvasRenderingContext( | 54 CanvasRenderingContext* getCanvasRenderingContext( |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 // then the following members would remain as initialized zero values. | 126 // then the following members would remain as initialized zero values. |
127 uint32_t m_clientId = 0; | 127 uint32_t m_clientId = 0; |
128 uint32_t m_sinkId = 0; | 128 uint32_t m_sinkId = 0; |
129 uint32_t m_localId = 0; | 129 uint32_t m_localId = 0; |
130 uint64_t m_nonce = 0; | 130 uint64_t m_nonce = 0; |
131 }; | 131 }; |
132 | 132 |
133 } // namespace blink | 133 } // namespace blink |
134 | 134 |
135 #endif // OffscreenCanvas_h | 135 #endif // OffscreenCanvas_h |
OLD | NEW |