| 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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 void WebGraphicsContext3DInProcessCommandBufferImpl::ConvertAttributes( | 127 void WebGraphicsContext3DInProcessCommandBufferImpl::ConvertAttributes( |
| 128 const blink::WebGraphicsContext3D::Attributes& attributes, | 128 const blink::WebGraphicsContext3D::Attributes& attributes, |
| 129 ::gpu::GLInProcessContextAttribs* output_attribs) { | 129 ::gpu::GLInProcessContextAttribs* output_attribs) { |
| 130 output_attribs->alpha_size = attributes.alpha ? 8 : 0; | 130 output_attribs->alpha_size = attributes.alpha ? 8 : 0; |
| 131 output_attribs->depth_size = attributes.depth ? 24 : 0; | 131 output_attribs->depth_size = attributes.depth ? 24 : 0; |
| 132 output_attribs->stencil_size = attributes.stencil ? 8 : 0; | 132 output_attribs->stencil_size = attributes.stencil ? 8 : 0; |
| 133 output_attribs->samples = attributes.antialias ? 4 : 0; | 133 output_attribs->samples = attributes.antialias ? 4 : 0; |
| 134 output_attribs->sample_buffers = attributes.antialias ? 1 : 0; | 134 output_attribs->sample_buffers = attributes.antialias ? 1 : 0; |
| 135 output_attribs->fail_if_major_perf_caveat = | 135 output_attribs->fail_if_major_perf_caveat = |
| 136 attributes.failIfMajorPerformanceCaveat ? 1 : 0; | 136 attributes.failIfMajorPerformanceCaveat ? 1 : 0; |
| 137 output_attribs->lose_context_when_out_of_memory = |
| 138 attributes.loseContextWhenOutOfMemory ? 1 : 0; |
| 137 } | 139 } |
| 138 | 140 |
| 139 bool WebGraphicsContext3DInProcessCommandBufferImpl::MaybeInitializeGL() { | 141 bool WebGraphicsContext3DInProcessCommandBufferImpl::MaybeInitializeGL() { |
| 140 if (initialized_) | 142 if (initialized_) |
| 141 return true; | 143 return true; |
| 142 | 144 |
| 143 if (initialize_failed_) | 145 if (initialize_failed_) |
| 144 return false; | 146 return false; |
| 145 | 147 |
| 146 // Ensure the gles2 library is initialized first in a thread safe way. | 148 // Ensure the gles2 library is initialized first in a thread safe way. |
| (...skipping 1033 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1180 | 1182 |
| 1181 DELEGATE_TO_GL_9(asyncTexSubImage2DCHROMIUM, AsyncTexSubImage2DCHROMIUM, | 1183 DELEGATE_TO_GL_9(asyncTexSubImage2DCHROMIUM, AsyncTexSubImage2DCHROMIUM, |
| 1182 WGC3Denum, WGC3Dint, WGC3Dint, WGC3Dint, WGC3Dsizei, WGC3Dsizei, | 1184 WGC3Denum, WGC3Dint, WGC3Dint, WGC3Dint, WGC3Dsizei, WGC3Dsizei, |
| 1183 WGC3Denum, WGC3Denum, const void*) | 1185 WGC3Denum, WGC3Denum, const void*) |
| 1184 | 1186 |
| 1185 DELEGATE_TO_GL_1(waitAsyncTexImage2DCHROMIUM, WaitAsyncTexImage2DCHROMIUM, | 1187 DELEGATE_TO_GL_1(waitAsyncTexImage2DCHROMIUM, WaitAsyncTexImage2DCHROMIUM, |
| 1186 WGC3Denum) | 1188 WGC3Denum) |
| 1187 | 1189 |
| 1188 } // namespace gpu | 1190 } // namespace gpu |
| 1189 } // namespace webkit | 1191 } // namespace webkit |
| OLD | NEW |