| 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 #include "content/renderer/pepper_platform_context_3d_impl.h" | 5 #include "content/renderer/pepper_platform_context_3d_impl.h" |
| 6 | 6 |
| 7 #include "content/renderer/render_thread.h" | 7 #include "content/renderer/render_thread_impl.h" |
| 8 #include "content/renderer/gpu/renderer_gl_context.h" | 8 #include "content/renderer/gpu/renderer_gl_context.h" |
| 9 #include "content/renderer/gpu/gpu_channel_host.h" | 9 #include "content/renderer/gpu/gpu_channel_host.h" |
| 10 #include "content/renderer/gpu/command_buffer_proxy.h" | 10 #include "content/renderer/gpu/command_buffer_proxy.h" |
| 11 #include "googleurl/src/gurl.h" | 11 #include "googleurl/src/gurl.h" |
| 12 #include "gpu/command_buffer/client/gles2_cmd_helper.h" | 12 #include "gpu/command_buffer/client/gles2_cmd_helper.h" |
| 13 #include "gpu/command_buffer/client/gles2_implementation.h" | 13 #include "gpu/command_buffer/client/gles2_implementation.h" |
| 14 | 14 |
| 15 #ifdef ENABLE_GPU | 15 #ifdef ENABLE_GPU |
| 16 | 16 |
| 17 PlatformContext3DImpl::PlatformContext3DImpl(RendererGLContext* parent_context) | 17 PlatformContext3DImpl::PlatformContext3DImpl(RendererGLContext* parent_context) |
| (...skipping 24 matching lines...) Expand all Loading... |
| 42 | 42 |
| 43 bool PlatformContext3DImpl::Init(const int32* attrib_list) { | 43 bool PlatformContext3DImpl::Init(const int32* attrib_list) { |
| 44 // Ignore initializing more than once. | 44 // Ignore initializing more than once. |
| 45 if (command_buffer_) | 45 if (command_buffer_) |
| 46 return true; | 46 return true; |
| 47 | 47 |
| 48 // Parent may already have been deleted. | 48 // Parent may already have been deleted. |
| 49 if (!parent_context_.get()) | 49 if (!parent_context_.get()) |
| 50 return false; | 50 return false; |
| 51 | 51 |
| 52 RenderThread* render_thread = RenderThread::current(); | 52 RenderThreadImpl* render_thread = RenderThreadImpl::current(); |
| 53 if (!render_thread) | 53 if (!render_thread) |
| 54 return false; | 54 return false; |
| 55 | 55 |
| 56 channel_ = render_thread->GetGpuChannel(); | 56 channel_ = render_thread->GetGpuChannel(); |
| 57 if (!channel_.get()) | 57 if (!channel_.get()) |
| 58 return false; | 58 return false; |
| 59 | 59 |
| 60 DCHECK(channel_->state() == GpuChannelHost::kConnected); | 60 DCHECK(channel_->state() == GpuChannelHost::kConnected); |
| 61 | 61 |
| 62 // Flush any remaining commands in the parent context to make sure the | 62 // Flush any remaining commands in the parent context to make sure the |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 } | 134 } |
| 135 | 135 |
| 136 void PlatformContext3DImpl::OnContextLost() { | 136 void PlatformContext3DImpl::OnContextLost() { |
| 137 DCHECK(command_buffer_); | 137 DCHECK(command_buffer_); |
| 138 | 138 |
| 139 if (context_lost_callback_.get()) | 139 if (context_lost_callback_.get()) |
| 140 context_lost_callback_->Run(); | 140 context_lost_callback_->Run(); |
| 141 } | 141 } |
| 142 | 142 |
| 143 #endif // ENABLE_GPU | 143 #endif // ENABLE_GPU |
| OLD | NEW |