| 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 16 matching lines...) Expand all Loading... |
| 27 ~OffscreenCanvas(); | 27 ~OffscreenCanvas(); |
| 28 | 28 |
| 29 // IDL attributes | 29 // IDL attributes |
| 30 unsigned width() const { return m_size.width(); } | 30 unsigned width() const { return m_size.width(); } |
| 31 unsigned height() const { return m_size.height(); } | 31 unsigned height() const { return m_size.height(); } |
| 32 void setWidth(unsigned); | 32 void setWidth(unsigned); |
| 33 void setHeight(unsigned); | 33 void setHeight(unsigned); |
| 34 | 34 |
| 35 // API Methods | 35 // API Methods |
| 36 OffscreenCanvasRenderingContext2D* getContext(const String&, const CanvasCon
textCreationAttributes&); | 36 OffscreenCanvasRenderingContext2D* getContext(const String&, const CanvasCon
textCreationAttributes&); |
| 37 PassRefPtrWillBeRawPtr<ImageBitmap> transferToImageBitmap(ExceptionState&); | 37 RawPtr<ImageBitmap> transferToImageBitmap(ExceptionState&); |
| 38 | 38 |
| 39 IntSize size() const { return m_size; } | 39 IntSize size() const { return m_size; } |
| 40 OffscreenCanvasRenderingContext2D* renderingContext() const; | 40 OffscreenCanvasRenderingContext2D* renderingContext() const; |
| 41 | 41 |
| 42 static void registerRenderingContextFactory(PassOwnPtr<OffscreenCanvasRender
ingContextFactory>); | 42 static void registerRenderingContextFactory(PassOwnPtr<OffscreenCanvasRender
ingContextFactory>); |
| 43 | 43 |
| 44 DECLARE_VIRTUAL_TRACE(); | 44 DECLARE_VIRTUAL_TRACE(); |
| 45 | 45 |
| 46 private: | 46 private: |
| 47 OffscreenCanvas(const IntSize&); | 47 OffscreenCanvas(const IntSize&); |
| 48 | 48 |
| 49 using ContextFactoryVector = Vector<OwnPtr<OffscreenCanvasRenderingContextFa
ctory>>; | 49 using ContextFactoryVector = Vector<OwnPtr<OffscreenCanvasRenderingContextFa
ctory>>; |
| 50 static ContextFactoryVector& renderingContextFactories(); | 50 static ContextFactoryVector& renderingContextFactories(); |
| 51 static OffscreenCanvasRenderingContextFactory* getRenderingContextFactory(in
t); | 51 static OffscreenCanvasRenderingContextFactory* getRenderingContextFactory(in
t); |
| 52 | 52 |
| 53 Member<OffscreenCanvasRenderingContext> m_context; | 53 Member<OffscreenCanvasRenderingContext> m_context; |
| 54 IntSize m_size; | 54 IntSize m_size; |
| 55 }; | 55 }; |
| 56 | 56 |
| 57 } // namespace blink | 57 } // namespace blink |
| 58 | 58 |
| 59 #endif // OffscreenCanvas_h | 59 #endif // OffscreenCanvas_h |
| OLD | NEW |