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

Side by Side Diff: third_party/WebKit/Source/modules/webgl/WebGL2RenderingContext.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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef WebGL2RenderingContext_h 5 #ifndef WebGL2RenderingContext_h
6 #define WebGL2RenderingContext_h 6 #define WebGL2RenderingContext_h
7 7
8 #include "core/html/canvas/CanvasRenderingContextFactory.h" 8 #include "core/html/canvas/CanvasRenderingContextFactory.h"
9 #include "modules/webgl/WebGL2RenderingContextBase.h" 9 #include "modules/webgl/WebGL2RenderingContextBase.h"
10 10
(...skipping 12 matching lines...) Expand all
23 ~Factory() override {} 23 ~Factory() override {}
24 24
25 CanvasRenderingContext* create(HTMLCanvasElement*, const CanvasContextCr eationAttributes&, Document&) override; 25 CanvasRenderingContext* create(HTMLCanvasElement*, const CanvasContextCr eationAttributes&, Document&) override;
26 CanvasRenderingContext::ContextType getContextType() const override { re turn CanvasRenderingContext::ContextWebgl2; } 26 CanvasRenderingContext::ContextType getContextType() const override { re turn CanvasRenderingContext::ContextWebgl2; }
27 void onError(HTMLCanvasElement*, const String& error) override; 27 void onError(HTMLCanvasElement*, const String& error) override;
28 }; 28 };
29 29
30 ~WebGL2RenderingContext() override; 30 ~WebGL2RenderingContext() override;
31 31
32 CanvasRenderingContext::ContextType getContextType() const override { return CanvasRenderingContext::ContextWebgl2; } 32 CanvasRenderingContext::ContextType getContextType() const override { return CanvasRenderingContext::ContextWebgl2; }
33 OffscreenCanvasRenderingContext::ContextType getOffscreenCanvasRenderingCont extType() const override { return OffscreenCanvasRenderingContext::ContextWebgl; }
34 ImageBitmap* transferToImageBitmap(ExceptionState&) final;
33 unsigned version() const override { return 2; } 35 unsigned version() const override { return 2; }
34 String contextName() const override { return "WebGL2RenderingContext"; } 36 String contextName() const override { return "WebGL2RenderingContext"; }
35 void registerContextExtensions() override; 37 void registerContextExtensions() override;
36 void setCanvasGetContextResult(RenderingContext&) final; 38 void setCanvasGetContextResult(RenderingContext&) final;
39 void setOffscreenCanvasGetContextResult(OffscreenRenderingContext&) final;
37 40
38 DECLARE_VIRTUAL_TRACE(); 41 DECLARE_VIRTUAL_TRACE();
39 42
40 protected: 43 protected:
41 WebGL2RenderingContext(HTMLCanvasElement* passedCanvas, PassOwnPtr<WebGraphi csContext3DProvider>, const WebGLContextAttributes& requestedAttributes); 44 WebGL2RenderingContext(HTMLCanvasElement* passedCanvas, PassOwnPtr<WebGraphi csContext3DProvider>, const WebGLContextAttributes& requestedAttributes);
42 45
43 Member<CHROMIUMSubscribeUniform> m_chromiumSubscribeUniform; 46 Member<CHROMIUMSubscribeUniform> m_chromiumSubscribeUniform;
44 Member<EXTColorBufferFloat> m_extColorBufferFloat; 47 Member<EXTColorBufferFloat> m_extColorBufferFloat;
45 Member<EXTDisjointTimerQuery> m_extDisjointTimerQuery; 48 Member<EXTDisjointTimerQuery> m_extDisjointTimerQuery;
46 Member<EXTTextureFilterAnisotropic> m_extTextureFilterAnisotropic; 49 Member<EXTTextureFilterAnisotropic> m_extTextureFilterAnisotropic;
47 Member<OESTextureFloatLinear> m_oesTextureFloatLinear; 50 Member<OESTextureFloatLinear> m_oesTextureFloatLinear;
48 Member<WebGLCompressedTextureASTC> m_webglCompressedTextureASTC; 51 Member<WebGLCompressedTextureASTC> m_webglCompressedTextureASTC;
49 Member<WebGLCompressedTextureATC> m_webglCompressedTextureATC; 52 Member<WebGLCompressedTextureATC> m_webglCompressedTextureATC;
50 Member<WebGLCompressedTextureETC1> m_webglCompressedTextureETC1; 53 Member<WebGLCompressedTextureETC1> m_webglCompressedTextureETC1;
51 Member<WebGLCompressedTexturePVRTC> m_webglCompressedTexturePVRTC; 54 Member<WebGLCompressedTexturePVRTC> m_webglCompressedTexturePVRTC;
52 Member<WebGLCompressedTextureS3TC> m_webglCompressedTextureS3TC; 55 Member<WebGLCompressedTextureS3TC> m_webglCompressedTextureS3TC;
53 Member<WebGLDebugRendererInfo> m_webglDebugRendererInfo; 56 Member<WebGLDebugRendererInfo> m_webglDebugRendererInfo;
54 Member<WebGLDebugShaders> m_webglDebugShaders; 57 Member<WebGLDebugShaders> m_webglDebugShaders;
55 Member<WebGLLoseContext> m_webglLoseContext; 58 Member<WebGLLoseContext> m_webglLoseContext;
56 }; 59 };
57 60
58 DEFINE_TYPE_CASTS(WebGL2RenderingContext, CanvasRenderingContext, context, 61 DEFINE_TYPE_CASTS(WebGL2RenderingContext, CanvasRenderingContext, context,
59 context->is3d() && WebGLRenderingContextBase::getWebGLVersion(context) == 2, 62 context->is3d() && WebGLRenderingContextBase::getWebGLVersion(context) == 2,
60 context.is3d() && WebGLRenderingContextBase::getWebGLVersion(&context) == 2) ; 63 context.is3d() && WebGLRenderingContextBase::getWebGLVersion(&context) == 2) ;
61 64
62 } // namespace blink 65 } // namespace blink
63 66
64 #endif 67 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698