OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 10 matching lines...) Expand all Loading... |
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
24 */ | 24 */ |
25 | 25 |
26 #ifndef WebGLRenderingContext_h | 26 #ifndef WebGLRenderingContext_h |
27 #define WebGLRenderingContext_h | 27 #define WebGLRenderingContext_h |
28 | 28 |
29 #include "core/html/canvas/CanvasRenderingContextFactory.h" | 29 #include "core/html/canvas/CanvasRenderingContextFactory.h" |
30 #include "modules/webgl/WebGLRenderingContextBase.h" | 30 #include "modules/webgl/WebGLRenderingContextBase.h" |
| 31 #include <memory> |
31 | 32 |
32 namespace blink { | 33 namespace blink { |
33 | 34 |
34 class CanvasContextCreationAttributes; | 35 class CanvasContextCreationAttributes; |
35 | 36 |
36 class WebGLRenderingContext final : public WebGLRenderingContextBase { | 37 class WebGLRenderingContext final : public WebGLRenderingContextBase { |
37 DEFINE_WRAPPERTYPEINFO(); | 38 DEFINE_WRAPPERTYPEINFO(); |
38 public: | 39 public: |
39 class Factory : public CanvasRenderingContextFactory { | 40 class Factory : public CanvasRenderingContextFactory { |
40 WTF_MAKE_NONCOPYABLE(Factory); | 41 WTF_MAKE_NONCOPYABLE(Factory); |
(...skipping 16 matching lines...) Expand all Loading... |
57 void registerContextExtensions() override; | 58 void registerContextExtensions() override; |
58 void setCanvasGetContextResult(RenderingContext&) final; | 59 void setCanvasGetContextResult(RenderingContext&) final; |
59 void setOffscreenCanvasGetContextResult(OffscreenRenderingContext&) final; | 60 void setOffscreenCanvasGetContextResult(OffscreenRenderingContext&) final; |
60 | 61 |
61 EAGERLY_FINALIZE(); | 62 EAGERLY_FINALIZE(); |
62 DECLARE_VIRTUAL_TRACE(); | 63 DECLARE_VIRTUAL_TRACE(); |
63 | 64 |
64 DECLARE_VIRTUAL_TRACE_WRAPPERS(); | 65 DECLARE_VIRTUAL_TRACE_WRAPPERS(); |
65 | 66 |
66 private: | 67 private: |
67 WebGLRenderingContext(HTMLCanvasElement*, PassOwnPtr<WebGraphicsContext3DPro
vider>, const WebGLContextAttributes&); | 68 WebGLRenderingContext(HTMLCanvasElement*, std::unique_ptr<WebGraphicsContext
3DProvider>, const WebGLContextAttributes&); |
68 WebGLRenderingContext(OffscreenCanvas*, PassOwnPtr<WebGraphicsContext3DProvi
der>, const WebGLContextAttributes&); | 69 WebGLRenderingContext(OffscreenCanvas*, std::unique_ptr<WebGraphicsContext3D
Provider>, const WebGLContextAttributes&); |
69 | 70 |
70 // Enabled extension objects. | 71 // Enabled extension objects. |
71 Member<ANGLEInstancedArrays> m_angleInstancedArrays; | 72 Member<ANGLEInstancedArrays> m_angleInstancedArrays; |
72 Member<EXTBlendMinMax> m_extBlendMinMax; | 73 Member<EXTBlendMinMax> m_extBlendMinMax; |
73 Member<EXTDisjointTimerQuery> m_extDisjointTimerQuery; | 74 Member<EXTDisjointTimerQuery> m_extDisjointTimerQuery; |
74 Member<EXTFragDepth> m_extFragDepth; | 75 Member<EXTFragDepth> m_extFragDepth; |
75 Member<EXTShaderTextureLOD> m_extShaderTextureLOD; | 76 Member<EXTShaderTextureLOD> m_extShaderTextureLOD; |
76 Member<EXTsRGB> m_extsRGB; | 77 Member<EXTsRGB> m_extsRGB; |
77 Member<EXTTextureFilterAnisotropic> m_extTextureFilterAnisotropic; | 78 Member<EXTTextureFilterAnisotropic> m_extTextureFilterAnisotropic; |
78 Member<OESTextureFloat> m_oesTextureFloat; | 79 Member<OESTextureFloat> m_oesTextureFloat; |
(...skipping 15 matching lines...) Expand all Loading... |
94 Member<WebGLDepthTexture> m_webglDepthTexture; | 95 Member<WebGLDepthTexture> m_webglDepthTexture; |
95 }; | 96 }; |
96 | 97 |
97 DEFINE_TYPE_CASTS(WebGLRenderingContext, CanvasRenderingContext, context, | 98 DEFINE_TYPE_CASTS(WebGLRenderingContext, CanvasRenderingContext, context, |
98 context->is3d() && WebGLRenderingContextBase::getWebGLVersion(context) == 1, | 99 context->is3d() && WebGLRenderingContextBase::getWebGLVersion(context) == 1, |
99 context.is3d() && WebGLRenderingContextBase::getWebGLVersion(&context) == 1)
; | 100 context.is3d() && WebGLRenderingContextBase::getWebGLVersion(&context) == 1)
; |
100 | 101 |
101 } // namespace blink | 102 } // namespace blink |
102 | 103 |
103 #endif // WebGLRenderingContext_h | 104 #endif // WebGLRenderingContext_h |
OLD | NEW |