OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef OffscreenCanvasRenderingContext_h |
| 6 #define OffscreenCanvasRenderingContext_h |
| 7 |
| 8 #include "modules/offscreencanvas/OffscreenCanvas.h" |
| 9 |
| 10 namespace blink { |
| 11 |
| 12 class OffscreenCanvasRenderingContext : public GarbageCollectedFinalized<Offscre
enCanvasRenderingContext>, public ScriptWrappable { |
| 13 WTF_MAKE_NONCOPYABLE(OffscreenCanvasRenderingContext); |
| 14 public: |
| 15 virtual ~OffscreenCanvasRenderingContext() { } |
| 16 enum ContextType { |
| 17 Context2d = 0, |
| 18 ContextWebgl = 1, |
| 19 ContextWebgl2 = 2, |
| 20 ContextTypeCount |
| 21 }; |
| 22 static ContextType contextTypeFromId(const String& id); |
| 23 |
| 24 OffscreenCanvas* offscreenCanvas() const { return m_offscreenCanvas; } |
| 25 virtual ContextType contextType() const = 0; |
| 26 |
| 27 virtual bool is2d() const { return false; } |
| 28 |
| 29 protected: |
| 30 OffscreenCanvasRenderingContext(OffscreenCanvas*); |
| 31 DECLARE_VIRTUAL_TRACE(); |
| 32 |
| 33 private: |
| 34 Member<OffscreenCanvas> m_offscreenCanvas; |
| 35 }; |
| 36 |
| 37 } // namespace blink |
| 38 |
| 39 #endif // OffscreenCanvasRenderingContext_h |
OLD | NEW |