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

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

Issue 1914233006: Implement offscreenCanvas.getContext('webgl') on a worker thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 97edb87923a75ac4c350780acd7d61bac64edd48..ed05bf039af1f8f00f75907afeec4ff357a6e4e4 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h
+++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h
@@ -45,7 +45,8 @@
#include "platform/graphics/gpu/DrawingBuffer.h"
#include "platform/graphics/gpu/Extensions3DUtil.h"
#include "platform/graphics/gpu/WebGLImageConversion.h"
-#include "public/platform/WebGraphicsContext3D.h"
+#include "public/platform/Platform.h"
+#include "public/platform/WebGraphicsContext3DProvider.h"
#include "wtf/OwnPtr.h"
#include "wtf/text/WTFString.h"
@@ -84,6 +85,7 @@ class OESTextureFloatLinear;
class OESTextureHalfFloat;
class OESTextureHalfFloatLinear;
class OESVertexArrayObject;
+class WaitableEvent;
class WebGLActiveInfo;
class WebGLBuffer;
class WebGLCompressedTextureASTC;
@@ -1079,6 +1081,27 @@ protected:
private:
WebGLRenderingContextBase(HTMLCanvasElement*, OffscreenCanvas*, PassOwnPtr<WebGraphicsContext3DProvider>, const WebGLContextAttributes&);
+ static PassOwnPtr<WebGraphicsContext3DProvider> createWebGraphicsContext3DProviderInternal(HTMLCanvasElement*, ScriptState*, WebGLContextAttributes, unsigned);
+ class createWebGraphicsContext3DProviderUtils {
+ public:
+ createWebGraphicsContext3DProviderUtils(Platform::ContextAttributes contextAttributes, Platform::GraphicsInfo glInfo, ScriptState* scriptState)
+ {
+ m_contextAttributes = contextAttributes;
+ m_glInfo = glInfo;
+ m_scriptState = scriptState;
+ }
+ Platform::ContextAttributes contextAttributes() { return m_contextAttributes; }
+ Platform::GraphicsInfo glInfo() { return m_glInfo; }
+ ScriptState* scriptState() { return m_scriptState; }
+ void setContextProvider(PassOwnPtr<WebGraphicsContext3DProvider> provider) { m_provider = std::move(provider); }
+ PassOwnPtr<WebGraphicsContext3DProvider> releaseContextProvider() { return m_provider.release(); }
+ private:
+ Platform::ContextAttributes m_contextAttributes;
+ Platform::GraphicsInfo m_glInfo;
+ ScriptState* m_scriptState;
+ OwnPtr<WebGraphicsContext3DProvider> m_provider;
+ };
+ static void createWebGraphicsContext3DProviderMainThread(createWebGraphicsContext3DProviderUtils*, WaitableEvent*);
};
DEFINE_TYPE_CASTS(WebGLRenderingContextBase, CanvasRenderingContext, context, context->is3d(), context.is3d());

Powered by Google App Engine
This is Rietveld 408576698