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 "gpu/blink/webgraphicscontext3d_impl.h" | 5 #include "gpu/blink/webgraphicscontext3d_impl.h" |
6 | 6 |
7 #include "base/atomicops.h" | 7 #include "base/atomicops.h" |
8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "gpu/GLES2/gl2extchromium.h" | 10 #include "gpu/GLES2/gl2extchromium.h" |
11 #include "gpu/command_buffer/client/gles2_implementation.h" | 11 #include "gpu/command_buffer/client/gles2_implementation.h" |
12 #include "gpu/command_buffer/client/gles2_lib.h" | 12 #include "gpu/command_buffer/client/gles2_lib.h" |
13 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 13 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
14 #include "gpu/command_buffer/common/sync_token.h" | 14 #include "gpu/command_buffer/common/sync_token.h" |
15 #include "gpu/skia_bindings/gl_bindings_skia_cmd_buffer.h" | |
16 | 15 |
17 #include "third_party/khronos/GLES2/gl2.h" | 16 #include "third_party/khronos/GLES2/gl2.h" |
18 #ifndef GL_GLEXT_PROTOTYPES | 17 #ifndef GL_GLEXT_PROTOTYPES |
19 #define GL_GLEXT_PROTOTYPES 1 | 18 #define GL_GLEXT_PROTOTYPES 1 |
20 #endif | 19 #endif |
21 #include "third_party/khronos/GLES2/gl2ext.h" | 20 #include "third_party/khronos/GLES2/gl2ext.h" |
22 | 21 |
23 using blink::WGC3Dbitfield; | 22 using blink::WGC3Dbitfield; |
24 using blink::WGC3Dboolean; | 23 using blink::WGC3Dboolean; |
25 using blink::WGC3Dbyte; | 24 using blink::WGC3Dbyte; |
(...skipping 1179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1205 } | 1204 } |
1206 | 1205 |
1207 bool WebGraphicsContext3DImpl::isContextLost() { | 1206 bool WebGraphicsContext3DImpl::isContextLost() { |
1208 return getGraphicsResetStatusARB() != GL_NO_ERROR; | 1207 return getGraphicsResetStatusARB() != GL_NO_ERROR; |
1209 } | 1208 } |
1210 | 1209 |
1211 blink::WGC3Denum WebGraphicsContext3DImpl::getGraphicsResetStatusARB() { | 1210 blink::WGC3Denum WebGraphicsContext3DImpl::getGraphicsResetStatusARB() { |
1212 return gl_->GetGraphicsResetStatusKHR(); | 1211 return gl_->GetGraphicsResetStatusKHR(); |
1213 } | 1212 } |
1214 | 1213 |
1215 GrGLInterface* WebGraphicsContext3DImpl::createGrGLInterface() { | |
1216 return skia_bindings::CreateCommandBufferSkiaGLBinding(); | |
1217 } | |
1218 | |
1219 ::gpu::gles2::GLES2ImplementationErrorMessageCallback* | 1214 ::gpu::gles2::GLES2ImplementationErrorMessageCallback* |
1220 WebGraphicsContext3DImpl::getErrorMessageCallback() { | 1215 WebGraphicsContext3DImpl::getErrorMessageCallback() { |
1221 if (!client_error_message_callback_) { | 1216 if (!client_error_message_callback_) { |
1222 client_error_message_callback_.reset( | 1217 client_error_message_callback_.reset( |
1223 new WebGraphicsContext3DErrorMessageCallback(this)); | 1218 new WebGraphicsContext3DErrorMessageCallback(this)); |
1224 } | 1219 } |
1225 return client_error_message_callback_.get(); | 1220 return client_error_message_callback_.get(); |
1226 } | 1221 } |
1227 | 1222 |
1228 void WebGraphicsContext3DImpl::OnErrorMessage( | 1223 void WebGraphicsContext3DImpl::OnErrorMessage( |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1279 output_attribs->context_type = ::gpu::gles2::CONTEXT_TYPE_WEBGL2; | 1274 output_attribs->context_type = ::gpu::gles2::CONTEXT_TYPE_WEBGL2; |
1280 break; | 1275 break; |
1281 default: | 1276 default: |
1282 NOTREACHED(); | 1277 NOTREACHED(); |
1283 output_attribs->context_type = ::gpu::gles2::CONTEXT_TYPE_OPENGLES2; | 1278 output_attribs->context_type = ::gpu::gles2::CONTEXT_TYPE_OPENGLES2; |
1284 break; | 1279 break; |
1285 } | 1280 } |
1286 } | 1281 } |
1287 | 1282 |
1288 } // namespace gpu_blink | 1283 } // namespace gpu_blink |
OLD | NEW |