OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.
h" | 5 #include "webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.
h" |
6 | 6 |
7 #include <GLES2/gl2.h> | 7 #include <GLES2/gl2.h> |
8 #ifndef GL_GLEXT_PROTOTYPES | 8 #ifndef GL_GLEXT_PROTOTYPES |
9 #define GL_GLEXT_PROTOTYPES 1 | 9 #define GL_GLEXT_PROTOTYPES 1 |
10 #endif | 10 #endif |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 private: | 59 private: |
60 DISALLOW_COPY_AND_ASSIGN(GLES2Initializer); | 60 DISALLOW_COPY_AND_ASSIGN(GLES2Initializer); |
61 }; | 61 }; |
62 | 62 |
63 static base::LazyInstance<GLES2Initializer> g_gles2_initializer = | 63 static base::LazyInstance<GLES2Initializer> g_gles2_initializer = |
64 LAZY_INSTANCE_INITIALIZER; | 64 LAZY_INSTANCE_INITIALIZER; |
65 | 65 |
66 } // namespace anonymous | 66 } // namespace anonymous |
67 | 67 |
68 // static | 68 // static |
69 scoped_ptr<WebKit::WebGraphicsContext3D> | 69 scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl> |
70 WebGraphicsContext3DInProcessCommandBufferImpl::CreateViewContext( | 70 WebGraphicsContext3DInProcessCommandBufferImpl::CreateViewContext( |
71 const WebKit::WebGraphicsContext3D::Attributes& attributes, | 71 const WebKit::WebGraphicsContext3D::Attributes& attributes, |
72 gfx::AcceleratedWidget window) { | 72 gfx::AcceleratedWidget window) { |
73 scoped_ptr<WebKit::WebGraphicsContext3D> context; | 73 scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl> context; |
74 if (gfx::GLSurface::InitializeOneOff()) { | 74 if (gfx::GLSurface::InitializeOneOff()) { |
75 context.reset(new WebGraphicsContext3DInProcessCommandBufferImpl( | 75 context.reset(new WebGraphicsContext3DInProcessCommandBufferImpl( |
76 scoped_ptr< ::gpu::GLInProcessContext>(), attributes, false, window)); | 76 scoped_ptr< ::gpu::GLInProcessContext>(), attributes, false, window)); |
77 } | 77 } |
78 return context.Pass(); | 78 return context.Pass(); |
79 } | 79 } |
80 | 80 |
81 // static | 81 // static |
82 scoped_ptr<WebKit::WebGraphicsContext3D> | 82 scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl> |
83 WebGraphicsContext3DInProcessCommandBufferImpl::CreateOffscreenContext( | 83 WebGraphicsContext3DInProcessCommandBufferImpl::CreateOffscreenContext( |
84 const WebKit::WebGraphicsContext3D::Attributes& attributes) { | 84 const WebKit::WebGraphicsContext3D::Attributes& attributes) { |
85 return make_scoped_ptr(new WebGraphicsContext3DInProcessCommandBufferImpl( | 85 return make_scoped_ptr(new WebGraphicsContext3DInProcessCommandBufferImpl( |
86 scoped_ptr< ::gpu::GLInProcessContext>(), | 86 scoped_ptr< ::gpu::GLInProcessContext>(), |
87 attributes, | 87 attributes, |
88 true, | 88 true, |
89 gfx::kNullAcceleratedWidget)) | 89 gfx::kNullAcceleratedWidget)) |
90 .PassAs<WebKit::WebGraphicsContext3D>(); | 90 .Pass();; |
91 } | 91 } |
92 | 92 |
93 scoped_ptr<WebKit::WebGraphicsContext3D> | 93 scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl> |
94 WebGraphicsContext3DInProcessCommandBufferImpl::WrapContext( | 94 WebGraphicsContext3DInProcessCommandBufferImpl::WrapContext( |
95 scoped_ptr< ::gpu::GLInProcessContext> context, | 95 scoped_ptr< ::gpu::GLInProcessContext> context, |
96 const WebKit::WebGraphicsContext3D::Attributes& attributes) { | 96 const WebKit::WebGraphicsContext3D::Attributes& attributes) { |
97 return make_scoped_ptr( | 97 return make_scoped_ptr( |
98 new WebGraphicsContext3DInProcessCommandBufferImpl( | 98 new WebGraphicsContext3DInProcessCommandBufferImpl( |
99 context.Pass(), | 99 context.Pass(), |
100 attributes, | 100 attributes, |
101 true /* is_offscreen. Not used. */, | 101 true /* is_offscreen. Not used. */, |
102 gfx::kNullAcceleratedWidget /* window. Not used. */)) | 102 gfx::kNullAcceleratedWidget /* window. Not used. */)) |
103 .PassAs<WebKit::WebGraphicsContext3D>(); | 103 .Pass(); |
104 } | 104 } |
105 | 105 |
106 WebGraphicsContext3DInProcessCommandBufferImpl:: | 106 WebGraphicsContext3DInProcessCommandBufferImpl:: |
107 WebGraphicsContext3DInProcessCommandBufferImpl( | 107 WebGraphicsContext3DInProcessCommandBufferImpl( |
108 scoped_ptr< ::gpu::GLInProcessContext> context, | 108 scoped_ptr< ::gpu::GLInProcessContext> context, |
109 const WebKit::WebGraphicsContext3D::Attributes& attributes, | 109 const WebKit::WebGraphicsContext3D::Attributes& attributes, |
110 bool is_offscreen, | 110 bool is_offscreen, |
111 gfx::AcceleratedWidget window) | 111 gfx::AcceleratedWidget window) |
112 : is_offscreen_(is_offscreen), | 112 : is_offscreen_(is_offscreen), |
113 window_(window), | 113 window_(window), |
(...skipping 1089 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1203 | 1203 |
1204 DELEGATE_TO_GL_9(asyncTexSubImage2DCHROMIUM, AsyncTexSubImage2DCHROMIUM, | 1204 DELEGATE_TO_GL_9(asyncTexSubImage2DCHROMIUM, AsyncTexSubImage2DCHROMIUM, |
1205 WGC3Denum, WGC3Dint, WGC3Dint, WGC3Dint, WGC3Dsizei, WGC3Dsizei, | 1205 WGC3Denum, WGC3Dint, WGC3Dint, WGC3Dint, WGC3Dsizei, WGC3Dsizei, |
1206 WGC3Denum, WGC3Denum, const void*) | 1206 WGC3Denum, WGC3Denum, const void*) |
1207 | 1207 |
1208 DELEGATE_TO_GL_1(waitAsyncTexImage2DCHROMIUM, WaitAsyncTexImage2DCHROMIUM, | 1208 DELEGATE_TO_GL_1(waitAsyncTexImage2DCHROMIUM, WaitAsyncTexImage2DCHROMIUM, |
1209 WGC3Denum) | 1209 WGC3Denum) |
1210 | 1210 |
1211 } // namespace gpu | 1211 } // namespace gpu |
1212 } // namespace webkit | 1212 } // namespace webkit |
OLD | NEW |