| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #if defined(ENABLE_GPU) | 5 #if defined(ENABLE_GPU) |
| 6 | 6 |
| 7 #include "webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h" | 7 #include "webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h" |
| 8 | 8 |
| 9 #include <GLES2/gl2.h> | 9 #include <GLES2/gl2.h> |
| 10 #ifndef GL_GLEXT_PROTOTYPES | 10 #ifndef GL_GLEXT_PROTOTYPES |
| (...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 | 401 |
| 402 bool GLInProcessContext::Initialize(bool onscreen, | 402 bool GLInProcessContext::Initialize(bool onscreen, |
| 403 gfx::PluginWindowHandle render_surface, | 403 gfx::PluginWindowHandle render_surface, |
| 404 const gfx::Size& size, | 404 const gfx::Size& size, |
| 405 GLInProcessContext* context_group, | 405 GLInProcessContext* context_group, |
| 406 const char* allowed_extensions, | 406 const char* allowed_extensions, |
| 407 const int32* attrib_list, | 407 const int32* attrib_list, |
| 408 const GURL& active_url, | 408 const GURL& active_url, |
| 409 gfx::GpuPreference gpu_preference) { | 409 gfx::GpuPreference gpu_preference) { |
| 410 // Use one share group for all contexts. | 410 // Use one share group for all contexts. |
| 411 static scoped_refptr<gfx::GLShareGroup> share_group(new gfx::GLShareGroup); | 411 CR_DEFINE_STATIC_LOCAL(scoped_refptr<gfx::GLShareGroup>, share_group, |
| 412 (new gfx::GLShareGroup)); |
| 412 | 413 |
| 413 DCHECK(size.width() >= 0 && size.height() >= 0); | 414 DCHECK(size.width() >= 0 && size.height() >= 0); |
| 414 | 415 |
| 415 // Ensure the gles2 library is initialized first in a thread safe way. | 416 // Ensure the gles2 library is initialized first in a thread safe way. |
| 416 g_gles2_initializer.Get(); | 417 g_gles2_initializer.Get(); |
| 417 | 418 |
| 418 // Allocate a frame buffer ID with respect to the parent. | 419 // Allocate a frame buffer ID with respect to the parent. |
| 419 if (parent_.get()) { | 420 if (parent_.get()) { |
| 420 // Flush any remaining commands in the parent context to make sure the | 421 // Flush any remaining commands in the parent context to make sure the |
| 421 // texture id accounting stays consistent. | 422 // texture id accounting stays consistent. |
| (...skipping 1249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1671 context_lost_reason_ = GL_UNKNOWN_CONTEXT_RESET_ARB; | 1672 context_lost_reason_ = GL_UNKNOWN_CONTEXT_RESET_ARB; |
| 1672 if (context_lost_callback_) { | 1673 if (context_lost_callback_) { |
| 1673 context_lost_callback_->onContextLost(); | 1674 context_lost_callback_->onContextLost(); |
| 1674 } | 1675 } |
| 1675 } | 1676 } |
| 1676 | 1677 |
| 1677 } // namespace gpu | 1678 } // namespace gpu |
| 1678 } // namespace webkit | 1679 } // namespace webkit |
| 1679 | 1680 |
| 1680 #endif // defined(ENABLE_GPU) | 1681 #endif // defined(ENABLE_GPU) |
| OLD | NEW |