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

Unified Diff: third_party/WebKit/Source/core/html/canvas/OffscreenCanvas.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/OffscreenCanvas.h
diff --git a/third_party/WebKit/Source/core/html/canvas/OffscreenCanvas.h b/third_party/WebKit/Source/core/html/canvas/OffscreenCanvas.h
index a9a14b258f0d9d592f2e886709f52d3fa3fca45d..dd3f64884c6c9503a7e59cb5cc71af025adfa389 100644
--- a/third_party/WebKit/Source/core/html/canvas/OffscreenCanvas.h
+++ b/third_party/WebKit/Source/core/html/canvas/OffscreenCanvas.h
@@ -14,6 +14,10 @@
namespace blink {
+class CanvasContextCreationAttributes;
Justin Novosad 2016/03/02 15:41:50 The Blink core has no dependency on OffscreenCanva
+class OffscreenCanvasRenderingContext;
+class OffscreenCanvasRenderingContextFactory;
+
class CORE_EXPORT OffscreenCanvas final : public GarbageCollectedFinalized<OffscreenCanvas>, public ScriptWrappable {
DEFINE_WRAPPERTYPEINFO();
public:
@@ -22,15 +26,24 @@ public:
IntSize size() const { return m_size; }
unsigned width() const { return m_size.width(); }
unsigned height() const { return m_size.height(); }
-
void setWidth(unsigned);
void setHeight(unsigned);
+ OffscreenCanvasRenderingContext* getContext(const String&, const CanvasContextCreationAttributes&);
+ OffscreenCanvasRenderingContext* renderingContext() const { return m_context.get(); }
+
+ static void registerRenderingContextFactory(PassOwnPtr<OffscreenCanvasRenderingContextFactory>);
+
DECLARE_VIRTUAL_TRACE();
private:
OffscreenCanvas(const IntSize&);
+ using ContextFactoryVector = Vector<OwnPtr<OffscreenCanvasRenderingContextFactory>>;
+ static ContextFactoryVector& renderingContextFactories();
+ static OffscreenCanvasRenderingContextFactory* getRenderingContextFactory(int);
+
+ OwnPtrWillBeMember<OffscreenCanvasRenderingContext> m_context;
IntSize m_size;
};

Powered by Google App Engine
This is Rietveld 408576698