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

Unified Diff: third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h

Issue 1881563003: Implement OffscreenCanvas.getContext('webgl') (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: offscreenCanvas.getContext('webgl') crashes on worker Created 4 years, 8 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/webgl/WebGLRenderingContextBase.h
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h
index af0f0c9a5a667046d04bc01bb6861afcedc76649..ca9844691f9404621cd49a27234c60ad76158025 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h
+++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h
@@ -35,6 +35,7 @@
#include "core/dom/TypedFlexibleArrayBufferView.h"
#include "core/html/canvas/CanvasRenderingContext.h"
#include "core/layout/LayoutBoxModelObject.h"
+#include "modules/offscreencanvas/OffscreenCanvasRenderingContext.h"
#include "modules/webgl/WebGLContextAttributes.h"
#include "modules/webgl/WebGLExtensionName.h"
#include "modules/webgl/WebGLTexture.h"
@@ -141,7 +142,8 @@ private:
Member<WebGLFramebuffer> m_readFramebufferBinding;
};
-class MODULES_EXPORT WebGLRenderingContextBase : public CanvasRenderingContext {
+class MODULES_EXPORT WebGLRenderingContextBase : public CanvasRenderingContext, public OffscreenCanvasRenderingContext, public ScriptWrappable {
xlai (Olivia) 2016/04/20 20:42:16 [continued from previous comment] But then why is
xidachen 2016/04/20 20:52:09 WebGLBase has a idl and it is the actual interface
Ken Russell (switch to Gerrit) 2016/04/21 01:05:24 Based on past experience with multiple inheritance
xlai (Olivia) 2016/04/21 15:31:54 First, I agree with merging OffscreenCanvasRenderi
Ken Russell (switch to Gerrit) 2016/04/21 19:52:00 OK. Please do as you see fit with CanvasRenderingC
+ USING_GARBAGE_COLLECTED_MIXIN(WebGLRenderingContextBase);
public:
~WebGLRenderingContextBase() override;
@@ -154,6 +156,7 @@ public:
static unsigned getWebGLVersion(const CanvasRenderingContext*);
static PassOwnPtr<WebGraphicsContext3DProvider> createWebGraphicsContext3DProvider(HTMLCanvasElement*, WebGLContextAttributes, unsigned webGLVersion);
+ static PassOwnPtr<WebGraphicsContext3DProvider> createWebGraphicsContext3DProvider(ScriptState*, WebGLContextAttributes, unsigned webGLVersion);
static void forceNextWebGLContextCreationToFail();
int drawingBufferWidth() const;
@@ -409,7 +412,6 @@ public:
// to (first) be able to detach its WebGLContextObjects, before
// they're later swept and finalized.
EAGERLY_FINALIZE();
- DECLARE_EAGER_FINALIZATION_OPERATOR_NEW();
DECLARE_VIRTUAL_TRACE();
// Returns approximate gpu memory allocated per pixel.
@@ -448,6 +450,7 @@ protected:
friend class ScopedFramebufferRestorer;
WebGLRenderingContextBase(HTMLCanvasElement*, PassOwnPtr<WebGraphicsContext3DProvider>, const WebGLContextAttributes&);
+ WebGLRenderingContextBase(OffscreenCanvas*, PassOwnPtr<WebGraphicsContext3DProvider>, const WebGLContextAttributes&);
PassRefPtr<DrawingBuffer> createDrawingBuffer(PassOwnPtr<WebGraphicsContext3DProvider>);
void setupFlags();
@@ -1080,6 +1083,9 @@ protected:
static WebGLRenderingContextBase* oldestEvictedContext();
CrossThreadWeakPersistentThisPointer<WebGLRenderingContextBase> createWeakThisPointer() { return CrossThreadWeakPersistentThisPointer<WebGLRenderingContextBase>(this); }
+
+private:
+ WebGLRenderingContextBase(HTMLCanvasElement*, OffscreenCanvas*, PassOwnPtr<WebGraphicsContext3DProvider>, const WebGLContextAttributes&);
};
DEFINE_TYPE_CASTS(WebGLRenderingContextBase, CanvasRenderingContext, context, context->is3d(), context.is3d());

Powered by Google App Engine
This is Rietveld 408576698