| 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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 | 131 |
| 132 // static | 132 // static |
| 133 void WebGraphicsContext3DInProcessCommandBufferImpl::ConvertAttributes( | 133 void WebGraphicsContext3DInProcessCommandBufferImpl::ConvertAttributes( |
| 134 const blink::WebGraphicsContext3D::Attributes& attributes, | 134 const blink::WebGraphicsContext3D::Attributes& attributes, |
| 135 ::gpu::GLInProcessContextAttribs* output_attribs) { | 135 ::gpu::GLInProcessContextAttribs* output_attribs) { |
| 136 output_attribs->alpha_size = attributes.alpha ? 8 : 0; | 136 output_attribs->alpha_size = attributes.alpha ? 8 : 0; |
| 137 output_attribs->depth_size = attributes.depth ? 24 : 0; | 137 output_attribs->depth_size = attributes.depth ? 24 : 0; |
| 138 output_attribs->stencil_size = attributes.stencil ? 8 : 0; | 138 output_attribs->stencil_size = attributes.stencil ? 8 : 0; |
| 139 output_attribs->samples = attributes.antialias ? 4 : 0; | 139 output_attribs->samples = attributes.antialias ? 4 : 0; |
| 140 output_attribs->sample_buffers = attributes.antialias ? 1 : 0; | 140 output_attribs->sample_buffers = attributes.antialias ? 1 : 0; |
| 141 output_attribs->fail_if_major_perf_caveat = |
| 142 attributes.failIfMajorPerformanceCaveat ? 1 : 0; |
| 141 } | 143 } |
| 142 | 144 |
| 143 bool WebGraphicsContext3DInProcessCommandBufferImpl::MaybeInitializeGL() { | 145 bool WebGraphicsContext3DInProcessCommandBufferImpl::MaybeInitializeGL() { |
| 144 if (initialized_) | 146 if (initialized_) |
| 145 return true; | 147 return true; |
| 146 | 148 |
| 147 if (initialize_failed_) | 149 if (initialize_failed_) |
| 148 return false; | 150 return false; |
| 149 | 151 |
| 150 // Ensure the gles2 library is initialized first in a thread safe way. | 152 // Ensure the gles2 library is initialized first in a thread safe way. |
| (...skipping 1048 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1199 | 1201 |
| 1200 DELEGATE_TO_GL_9(asyncTexSubImage2DCHROMIUM, AsyncTexSubImage2DCHROMIUM, | 1202 DELEGATE_TO_GL_9(asyncTexSubImage2DCHROMIUM, AsyncTexSubImage2DCHROMIUM, |
| 1201 WGC3Denum, WGC3Dint, WGC3Dint, WGC3Dint, WGC3Dsizei, WGC3Dsizei, | 1203 WGC3Denum, WGC3Dint, WGC3Dint, WGC3Dint, WGC3Dsizei, WGC3Dsizei, |
| 1202 WGC3Denum, WGC3Denum, const void*) | 1204 WGC3Denum, WGC3Denum, const void*) |
| 1203 | 1205 |
| 1204 DELEGATE_TO_GL_1(waitAsyncTexImage2DCHROMIUM, WaitAsyncTexImage2DCHROMIUM, | 1206 DELEGATE_TO_GL_1(waitAsyncTexImage2DCHROMIUM, WaitAsyncTexImage2DCHROMIUM, |
| 1205 WGC3Denum) | 1207 WGC3Denum) |
| 1206 | 1208 |
| 1207 } // namespace gpu | 1209 } // namespace gpu |
| 1208 } // namespace webkit | 1210 } // namespace webkit |
| OLD | NEW |