Chromium Code Reviews| 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, |
|
apatrick_chromium
2011/11/11 20:05:23
I think I missed the memo. Why?
Nico
2011/11/11 20:07:19
http://groups.google.com/a/chromium.org/group/chro
| |
| 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 1236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1658 context_lost_reason_ = GL_UNKNOWN_CONTEXT_RESET_ARB; | 1659 context_lost_reason_ = GL_UNKNOWN_CONTEXT_RESET_ARB; |
| 1659 if (context_lost_callback_) { | 1660 if (context_lost_callback_) { |
| 1660 context_lost_callback_->onContextLost(); | 1661 context_lost_callback_->onContextLost(); |
| 1661 } | 1662 } |
| 1662 } | 1663 } |
| 1663 | 1664 |
| 1664 } // namespace gpu | 1665 } // namespace gpu |
| 1665 } // namespace webkit | 1666 } // namespace webkit |
| 1666 | 1667 |
| 1667 #endif // defined(ENABLE_GPU) | 1668 #endif // defined(ENABLE_GPU) |
| OLD | NEW |