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