| 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 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 g_all_shared_contexts.Pointer()->empty() ? | 361 g_all_shared_contexts.Pointer()->empty() ? |
| 362 NULL : *g_all_shared_contexts.Pointer()->begin(); | 362 NULL : *g_all_shared_contexts.Pointer()->begin(); |
| 363 | 363 |
| 364 // Create the object exposing the OpenGL API. | 364 // Create the object exposing the OpenGL API. |
| 365 real_gl_ = new gpu::gles2::GLES2Implementation( | 365 real_gl_ = new gpu::gles2::GLES2Implementation( |
| 366 gles2_helper_, | 366 gles2_helper_, |
| 367 share_group_context ? | 367 share_group_context ? |
| 368 share_group_context->GetImplementation()->share_group() : NULL, | 368 share_group_context->GetImplementation()->share_group() : NULL, |
| 369 transfer_buffer_, | 369 transfer_buffer_, |
| 370 attributes_.shareResources, | 370 attributes_.shareResources, |
| 371 bind_generates_resources_); | 371 bind_generates_resources_, |
| 372 NULL); |
| 372 gl_ = real_gl_; | 373 gl_ = real_gl_; |
| 373 | 374 |
| 374 if (!real_gl_->Initialize( | 375 if (!real_gl_->Initialize( |
| 375 kStartTransferBufferSize, | 376 kStartTransferBufferSize, |
| 376 kMinTransferBufferSize, | 377 kMinTransferBufferSize, |
| 377 kMaxTransferBufferSize)) { | 378 kMaxTransferBufferSize)) { |
| 378 return false; | 379 return false; |
| 379 } | 380 } |
| 380 | 381 |
| 381 if (CommandLine::ForCurrentProcess()->HasSwitch( | 382 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| (...skipping 1351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1733 | 1734 |
| 1734 void WebGraphicsContext3DCommandBufferImpl::OnErrorMessage( | 1735 void WebGraphicsContext3DCommandBufferImpl::OnErrorMessage( |
| 1735 const std::string& message, int id) { | 1736 const std::string& message, int id) { |
| 1736 if (error_message_callback_) { | 1737 if (error_message_callback_) { |
| 1737 WebKit::WebString str = WebKit::WebString::fromUTF8(message.c_str()); | 1738 WebKit::WebString str = WebKit::WebString::fromUTF8(message.c_str()); |
| 1738 error_message_callback_->onErrorMessage(str, id); | 1739 error_message_callback_->onErrorMessage(str, id); |
| 1739 } | 1740 } |
| 1740 } | 1741 } |
| 1741 | 1742 |
| 1742 } // namespace content | 1743 } // namespace content |
| OLD | NEW |