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

Unified Diff: third_party/WebKit/Source/core/html/canvas/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: Remove CanvasRenderingContextBase Created 4 years, 10 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/core/html/canvas/OffscreenCanvasRenderingContext.h
diff --git a/third_party/WebKit/Source/core/html/canvas/OffscreenCanvasRenderingContext.h b/third_party/WebKit/Source/core/html/canvas/OffscreenCanvasRenderingContext.h
new file mode 100644
index 0000000000000000000000000000000000000000..f474b6d1e60febdbee69454c72842ae4d49ab7b8
--- /dev/null
+++ b/third_party/WebKit/Source/core/html/canvas/OffscreenCanvasRenderingContext.h
@@ -0,0 +1,36 @@
+// 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.
+
+#include "core/CoreExport.h"
+#include "core/html/canvas/OffscreenCanvas.h"
+
+namespace blink {
+
+class CORE_EXPORT OffscreenCanvasRenderingContext : public NoBaseWillBeGarbageCollectedFinalized<OffscreenCanvasRenderingContext>, public ScriptWrappable {
Justin Novosad 2016/03/02 15:41:50 This class should also go in the new 'offscreencan
+WTF_MAKE_NONCOPYABLE(OffscreenCanvasRenderingContext);
+USING_FAST_MALLOC_WILL_BE_REMOVED(OffscreenCanvasRenderingContext);
+public:
+ virtual ~OffscreenCanvasRenderingContext() { }
+ enum ContextType {
+ Context2d = 0,
+ ContextWebgl = 1,
+ ContextWebgl2 = 2,
+ ContextImageBitmap = 3,
Justin Novosad 2016/03/02 15:41:50 ImageBitmap context will not be supported with Off
xlai (Olivia) 2016/03/03 22:50:06 Done.
+ ContextTypeCount
+ };
+ static ContextType contextTypeFromId(const String& id);
+
+ OffscreenCanvas* offscreenCanvas() const { return m_offscreenCanvas; }
+ ContextType contextType() const { return m_contextType; }
+
+protected:
+ OffscreenCanvasRenderingContext(OffscreenCanvas*);
+ DECLARE_VIRTUAL_TRACE();
+
+private:
+ Member<OffscreenCanvas> m_offscreenCanvas;
+ ContextType m_contextType;
+};
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698