Index: third_party/WebKit/Source/modules/offscreencanvas/OffscreenCanvasRenderingContext.h |
diff --git a/third_party/WebKit/Source/modules/offscreencanvas/OffscreenCanvasRenderingContext.h b/third_party/WebKit/Source/modules/offscreencanvas/OffscreenCanvasRenderingContext.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..99365bd7d36d75f37b8df75e34d9f0f425ff2dca |
--- /dev/null |
+++ b/third_party/WebKit/Source/modules/offscreencanvas/OffscreenCanvasRenderingContext.h |
@@ -0,0 +1,39 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef OffscreenCanvasRenderingContext_h |
+#define OffscreenCanvasRenderingContext_h |
+ |
+#include "modules/offscreencanvas/OffscreenCanvas.h" |
+ |
+namespace blink { |
+ |
+class OffscreenCanvasRenderingContext : public GarbageCollectedFinalized<OffscreenCanvasRenderingContext>, public ScriptWrappable { |
+ WTF_MAKE_NONCOPYABLE(OffscreenCanvasRenderingContext); |
+public: |
+ virtual ~OffscreenCanvasRenderingContext() { } |
+ enum ContextType { |
+ Context2d = 0, |
+ ContextWebgl = 1, |
+ ContextWebgl2 = 2, |
+ ContextTypeCount |
+ }; |
+ static ContextType contextTypeFromId(const String& id); |
+ |
+ OffscreenCanvas* offscreenCanvas() const { return m_offscreenCanvas; } |
+ virtual ContextType contextType() const = 0; |
+ |
+ virtual bool is2d() const { return false; } |
+ |
+protected: |
+ OffscreenCanvasRenderingContext(OffscreenCanvas*); |
+ DECLARE_VIRTUAL_TRACE(); |
+ |
+private: |
+ Member<OffscreenCanvas> m_offscreenCanvas; |
+}; |
+ |
+} // namespace blink |
+ |
+#endif // OffscreenCanvasRenderingContext_h |