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 #include <memory> | |
11 | 10 |
12 namespace blink { | 11 namespace blink { |
13 | 12 |
14 class CanvasContextCreationAttributes; | 13 class CanvasContextCreationAttributes; |
15 class EXTColorBufferFloat; | 14 class EXTColorBufferFloat; |
16 | 15 |
17 class WebGL2RenderingContext : public WebGL2RenderingContextBase { | 16 class WebGL2RenderingContext : public WebGL2RenderingContextBase { |
18 DEFINE_WRAPPERTYPEINFO(); | 17 DEFINE_WRAPPERTYPEINFO(); |
19 public: | 18 public: |
20 class Factory : public CanvasRenderingContextFactory { | 19 class Factory : public CanvasRenderingContextFactory { |
(...skipping 15 matching lines...) Expand all Loading... |
36 String contextName() const override { return "WebGL2RenderingContext"; } | 35 String contextName() const override { return "WebGL2RenderingContext"; } |
37 void registerContextExtensions() override; | 36 void registerContextExtensions() override; |
38 void setCanvasGetContextResult(RenderingContext&) final; | 37 void setCanvasGetContextResult(RenderingContext&) final; |
39 void setOffscreenCanvasGetContextResult(OffscreenRenderingContext&) final; | 38 void setOffscreenCanvasGetContextResult(OffscreenRenderingContext&) final; |
40 | 39 |
41 DECLARE_VIRTUAL_TRACE(); | 40 DECLARE_VIRTUAL_TRACE(); |
42 | 41 |
43 DECLARE_VIRTUAL_TRACE_WRAPPERS(); | 42 DECLARE_VIRTUAL_TRACE_WRAPPERS(); |
44 | 43 |
45 protected: | 44 protected: |
46 WebGL2RenderingContext(HTMLCanvasElement* passedCanvas, std::unique_ptr<WebG
raphicsContext3DProvider>, const WebGLContextAttributes& requestedAttributes); | 45 WebGL2RenderingContext(HTMLCanvasElement* passedCanvas, PassOwnPtr<WebGraphi
csContext3DProvider>, const WebGLContextAttributes& requestedAttributes); |
47 | 46 |
48 Member<EXTColorBufferFloat> m_extColorBufferFloat; | 47 Member<EXTColorBufferFloat> m_extColorBufferFloat; |
49 Member<EXTDisjointTimerQuery> m_extDisjointTimerQuery; | 48 Member<EXTDisjointTimerQuery> m_extDisjointTimerQuery; |
50 Member<EXTTextureFilterAnisotropic> m_extTextureFilterAnisotropic; | 49 Member<EXTTextureFilterAnisotropic> m_extTextureFilterAnisotropic; |
51 Member<OESTextureFloatLinear> m_oesTextureFloatLinear; | 50 Member<OESTextureFloatLinear> m_oesTextureFloatLinear; |
52 Member<WebGLCompressedTextureASTC> m_webglCompressedTextureASTC; | 51 Member<WebGLCompressedTextureASTC> m_webglCompressedTextureASTC; |
53 Member<WebGLCompressedTextureATC> m_webglCompressedTextureATC; | 52 Member<WebGLCompressedTextureATC> m_webglCompressedTextureATC; |
54 Member<WebGLCompressedTextureETC1> m_webglCompressedTextureETC1; | 53 Member<WebGLCompressedTextureETC1> m_webglCompressedTextureETC1; |
55 Member<WebGLCompressedTexturePVRTC> m_webglCompressedTexturePVRTC; | 54 Member<WebGLCompressedTexturePVRTC> m_webglCompressedTexturePVRTC; |
56 Member<WebGLCompressedTextureS3TC> m_webglCompressedTextureS3TC; | 55 Member<WebGLCompressedTextureS3TC> m_webglCompressedTextureS3TC; |
57 Member<WebGLDebugRendererInfo> m_webglDebugRendererInfo; | 56 Member<WebGLDebugRendererInfo> m_webglDebugRendererInfo; |
58 Member<WebGLDebugShaders> m_webglDebugShaders; | 57 Member<WebGLDebugShaders> m_webglDebugShaders; |
59 Member<WebGLLoseContext> m_webglLoseContext; | 58 Member<WebGLLoseContext> m_webglLoseContext; |
60 }; | 59 }; |
61 | 60 |
62 DEFINE_TYPE_CASTS(WebGL2RenderingContext, CanvasRenderingContext, context, | 61 DEFINE_TYPE_CASTS(WebGL2RenderingContext, CanvasRenderingContext, context, |
63 context->is3d() && WebGLRenderingContextBase::getWebGLVersion(context) == 2, | 62 context->is3d() && WebGLRenderingContextBase::getWebGLVersion(context) == 2, |
64 context.is3d() && WebGLRenderingContextBase::getWebGLVersion(&context) == 2)
; | 63 context.is3d() && WebGLRenderingContextBase::getWebGLVersion(&context) == 2)
; |
65 | 64 |
66 } // namespace blink | 65 } // namespace blink |
67 | 66 |
68 #endif | 67 #endif |
OLD | NEW |