| 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 |
| 11 namespace blink { | 11 namespace blink { |
| 12 | 12 |
| 13 class CanvasContextCreationAttributes; | 13 class CanvasContextCreationAttributes; |
| 14 class EXTColorBufferFloat; | 14 class EXTColorBufferFloat; |
| 15 | 15 |
| 16 class WebGL2RenderingContext : public WebGL2RenderingContextBase { | 16 class WebGL2RenderingContext : public WebGL2RenderingContextBase { |
| 17 DEFINE_WRAPPERTYPEINFO(); | 17 DEFINE_WRAPPERTYPEINFO(); |
| 18 public: | 18 public: |
| 19 class Factory : public CanvasRenderingContextFactory { | 19 class Factory : public CanvasRenderingContextFactory { |
| 20 WTF_MAKE_NONCOPYABLE(Factory); | 20 WTF_MAKE_NONCOPYABLE(Factory); |
| 21 public: | 21 public: |
| 22 Factory() {} | 22 Factory() {} |
| 23 ~Factory() override {} | 23 ~Factory() override {} |
| 24 | 24 |
| 25 PassOwnPtrWillBeRawPtr<CanvasRenderingContext> create(HTMLCanvasElement*
, const CanvasContextCreationAttributes&, Document&) override; | 25 RawPtr<CanvasRenderingContext> create(HTMLCanvasElement*, const CanvasCo
ntextCreationAttributes&, 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 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 void setCanvasGetContextResult(RenderingContext&) final; |
| 37 | 37 |
| 38 DECLARE_VIRTUAL_TRACE(); | 38 DECLARE_VIRTUAL_TRACE(); |
| 39 | 39 |
| 40 protected: | 40 protected: |
| 41 WebGL2RenderingContext(HTMLCanvasElement* passedCanvas, PassOwnPtr<WebGraphi
csContext3DProvider>, const WebGLContextAttributes& requestedAttributes); | 41 WebGL2RenderingContext(HTMLCanvasElement* passedCanvas, PassOwnPtr<WebGraphi
csContext3DProvider>, const WebGLContextAttributes& requestedAttributes); |
| 42 | 42 |
| 43 PersistentWillBeMember<CHROMIUMSubscribeUniform> m_chromiumSubscribeUniform; | 43 Member<CHROMIUMSubscribeUniform> m_chromiumSubscribeUniform; |
| 44 PersistentWillBeMember<EXTColorBufferFloat> m_extColorBufferFloat; | 44 Member<EXTColorBufferFloat> m_extColorBufferFloat; |
| 45 PersistentWillBeMember<EXTDisjointTimerQuery> m_extDisjointTimerQuery; | 45 Member<EXTDisjointTimerQuery> m_extDisjointTimerQuery; |
| 46 PersistentWillBeMember<EXTTextureFilterAnisotropic> m_extTextureFilterAnisot
ropic; | 46 Member<EXTTextureFilterAnisotropic> m_extTextureFilterAnisotropic; |
| 47 PersistentWillBeMember<OESTextureFloatLinear> m_oesTextureFloatLinear; | 47 Member<OESTextureFloatLinear> m_oesTextureFloatLinear; |
| 48 PersistentWillBeMember<WebGLCompressedTextureASTC> m_webglCompressedTextureA
STC; | 48 Member<WebGLCompressedTextureASTC> m_webglCompressedTextureASTC; |
| 49 PersistentWillBeMember<WebGLCompressedTextureATC> m_webglCompressedTextureAT
C; | 49 Member<WebGLCompressedTextureATC> m_webglCompressedTextureATC; |
| 50 PersistentWillBeMember<WebGLCompressedTextureETC1> m_webglCompressedTextureE
TC1; | 50 Member<WebGLCompressedTextureETC1> m_webglCompressedTextureETC1; |
| 51 PersistentWillBeMember<WebGLCompressedTexturePVRTC> m_webglCompressedTexture
PVRTC; | 51 Member<WebGLCompressedTexturePVRTC> m_webglCompressedTexturePVRTC; |
| 52 PersistentWillBeMember<WebGLCompressedTextureS3TC> m_webglCompressedTextureS
3TC; | 52 Member<WebGLCompressedTextureS3TC> m_webglCompressedTextureS3TC; |
| 53 PersistentWillBeMember<WebGLDebugRendererInfo> m_webglDebugRendererInfo; | 53 Member<WebGLDebugRendererInfo> m_webglDebugRendererInfo; |
| 54 PersistentWillBeMember<WebGLDebugShaders> m_webglDebugShaders; | 54 Member<WebGLDebugShaders> m_webglDebugShaders; |
| 55 PersistentWillBeMember<WebGLLoseContext> m_webglLoseContext; | 55 Member<WebGLLoseContext> m_webglLoseContext; |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 DEFINE_TYPE_CASTS(WebGL2RenderingContext, CanvasRenderingContext, context, | 58 DEFINE_TYPE_CASTS(WebGL2RenderingContext, CanvasRenderingContext, context, |
| 59 context->is3d() && WebGLRenderingContextBase::getWebGLVersion(context) == 2, | 59 context->is3d() && WebGLRenderingContextBase::getWebGLVersion(context) == 2, |
| 60 context.is3d() && WebGLRenderingContextBase::getWebGLVersion(&context) == 2)
; | 60 context.is3d() && WebGLRenderingContextBase::getWebGLVersion(&context) == 2)
; |
| 61 | 61 |
| 62 } // namespace blink | 62 } // namespace blink |
| 63 | 63 |
| 64 #endif | 64 #endif |
| OLD | NEW |