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 "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" | 5 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" |
6 | 6 |
7 #include "third_party/khronos/GLES2/gl2.h" | 7 #include "third_party/khronos/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 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 transfer_buffer_ .reset(new gpu::TransferBuffer(gles2_helper_.get())); | 422 transfer_buffer_ .reset(new gpu::TransferBuffer(gles2_helper_.get())); |
423 | 423 |
424 DCHECK(host_.get()); | 424 DCHECK(host_.get()); |
425 | 425 |
426 // Create the object exposing the OpenGL API. | 426 // Create the object exposing the OpenGL API. |
427 real_gl_.reset(new gpu::gles2::GLES2Implementation( | 427 real_gl_.reset(new gpu::gles2::GLES2Implementation( |
428 gles2_helper_.get(), | 428 gles2_helper_.get(), |
429 gles2_share_group, | 429 gles2_share_group, |
430 transfer_buffer_.get(), | 430 transfer_buffer_.get(), |
431 bind_generates_resources_, | 431 bind_generates_resources_, |
432 command_buffer_.get())); | 432 command_buffer_.get(), |
| 433 command_buffer_->capabilities())); |
433 gl_ = real_gl_.get(); | 434 gl_ = real_gl_.get(); |
434 | 435 |
435 if (!real_gl_->Initialize( | 436 if (!real_gl_->Initialize( |
436 mem_limits_.start_transfer_buffer_size, | 437 mem_limits_.start_transfer_buffer_size, |
437 mem_limits_.min_transfer_buffer_size, | 438 mem_limits_.min_transfer_buffer_size, |
438 mem_limits_.max_transfer_buffer_size, | 439 mem_limits_.max_transfer_buffer_size, |
439 mem_limits_.mapped_memory_reclaim_limit)) { | 440 mem_limits_.mapped_memory_reclaim_limit)) { |
440 LOG(ERROR) << "Failed to initialize GLES2Implementation."; | 441 LOG(ERROR) << "Failed to initialize GLES2Implementation."; |
441 return false; | 442 return false; |
442 } | 443 } |
(...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1391 | 1392 |
1392 void WebGraphicsContext3DCommandBufferImpl::OnErrorMessage( | 1393 void WebGraphicsContext3DCommandBufferImpl::OnErrorMessage( |
1393 const std::string& message, int id) { | 1394 const std::string& message, int id) { |
1394 if (error_message_callback_) { | 1395 if (error_message_callback_) { |
1395 blink::WebString str = blink::WebString::fromUTF8(message.c_str()); | 1396 blink::WebString str = blink::WebString::fromUTF8(message.c_str()); |
1396 error_message_callback_->onErrorMessage(str, id); | 1397 error_message_callback_->onErrorMessage(str, id); |
1397 } | 1398 } |
1398 } | 1399 } |
1399 | 1400 |
1400 } // namespace content | 1401 } // namespace content |
OLD | NEW |