Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(740)

Unified Diff: third_party/WebKit/Source/modules/offscreencanvas/OffscreenCanvasRenderingContext.h

Issue 1748163003: Add rendering context and rendering 2D context to OffscreenCanvas (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase with master and fix merge conflicts Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698