OLD | NEW |
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 15 matching lines...) Expand all Loading... |
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 unsigned version() const override { return 2; } | 33 unsigned version() const override { return 2; } |
34 String contextName() const override { return "WebGL2RenderingContext"; } | 34 String contextName() const override { return "WebGL2RenderingContext"; } |
35 void registerContextExtensions() override; | 35 void registerContextExtensions() override; |
| 36 void setCanvasGetContextResult(RenderingContext&) final; |
36 | 37 |
37 DECLARE_VIRTUAL_TRACE(); | 38 DECLARE_VIRTUAL_TRACE(); |
38 | 39 |
39 protected: | 40 protected: |
40 WebGL2RenderingContext(HTMLCanvasElement* passedCanvas, PassOwnPtr<WebGraphi
csContext3D>, const WebGLContextAttributes& requestedAttributes); | 41 WebGL2RenderingContext(HTMLCanvasElement* passedCanvas, PassOwnPtr<WebGraphi
csContext3D>, const WebGLContextAttributes& requestedAttributes); |
41 | 42 |
42 PersistentWillBeMember<CHROMIUMSubscribeUniform> m_chromiumSubscribeUniform; | 43 PersistentWillBeMember<CHROMIUMSubscribeUniform> m_chromiumSubscribeUniform; |
43 PersistentWillBeMember<EXTColorBufferFloat> m_extColorBufferFloat; | 44 PersistentWillBeMember<EXTColorBufferFloat> m_extColorBufferFloat; |
44 PersistentWillBeMember<EXTDisjointTimerQuery> m_extDisjointTimerQuery; | 45 PersistentWillBeMember<EXTDisjointTimerQuery> m_extDisjointTimerQuery; |
45 PersistentWillBeMember<EXTTextureFilterAnisotropic> m_extTextureFilterAnisot
ropic; | 46 PersistentWillBeMember<EXTTextureFilterAnisotropic> m_extTextureFilterAnisot
ropic; |
46 PersistentWillBeMember<OESTextureFloatLinear> m_oesTextureFloatLinear; | 47 PersistentWillBeMember<OESTextureFloatLinear> m_oesTextureFloatLinear; |
47 PersistentWillBeMember<WebGLCompressedTextureASTC> m_webglCompressedTextureA
STC; | 48 PersistentWillBeMember<WebGLCompressedTextureASTC> m_webglCompressedTextureA
STC; |
48 PersistentWillBeMember<WebGLCompressedTextureATC> m_webglCompressedTextureAT
C; | 49 PersistentWillBeMember<WebGLCompressedTextureATC> m_webglCompressedTextureAT
C; |
49 PersistentWillBeMember<WebGLCompressedTextureETC1> m_webglCompressedTextureE
TC1; | 50 PersistentWillBeMember<WebGLCompressedTextureETC1> m_webglCompressedTextureE
TC1; |
50 PersistentWillBeMember<WebGLCompressedTexturePVRTC> m_webglCompressedTexture
PVRTC; | 51 PersistentWillBeMember<WebGLCompressedTexturePVRTC> m_webglCompressedTexture
PVRTC; |
51 PersistentWillBeMember<WebGLCompressedTextureS3TC> m_webglCompressedTextureS
3TC; | 52 PersistentWillBeMember<WebGLCompressedTextureS3TC> m_webglCompressedTextureS
3TC; |
52 PersistentWillBeMember<WebGLDebugRendererInfo> m_webglDebugRendererInfo; | 53 PersistentWillBeMember<WebGLDebugRendererInfo> m_webglDebugRendererInfo; |
53 PersistentWillBeMember<WebGLDebugShaders> m_webglDebugShaders; | 54 PersistentWillBeMember<WebGLDebugShaders> m_webglDebugShaders; |
54 PersistentWillBeMember<WebGLLoseContext> m_webglLoseContext; | 55 PersistentWillBeMember<WebGLLoseContext> m_webglLoseContext; |
55 }; | 56 }; |
56 | 57 |
57 DEFINE_TYPE_CASTS(WebGL2RenderingContext, CanvasRenderingContext, context, | 58 DEFINE_TYPE_CASTS(WebGL2RenderingContext, CanvasRenderingContext, context, |
58 context->is3d() && WebGLRenderingContextBase::getWebGLVersion(context) == 2, | 59 context->is3d() && WebGLRenderingContextBase::getWebGLVersion(context) == 2, |
59 context.is3d() && WebGLRenderingContextBase::getWebGLVersion(&context) == 2)
; | 60 context.is3d() && WebGLRenderingContextBase::getWebGLVersion(&context) == 2)
; |
60 | 61 |
61 } // namespace blink | 62 } // namespace blink |
62 | 63 |
63 #endif | 64 #endif |
OLD | NEW |