| 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/gpu/renderer_gl_context.h" | 5 #include "content/renderer/gpu/renderer_gl_context.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 | 255 |
| 256 bool RendererGLContext::IsCommandBufferContextLost() { | 256 bool RendererGLContext::IsCommandBufferContextLost() { |
| 257 gpu::CommandBuffer::State state = command_buffer_->GetLastState(); | 257 gpu::CommandBuffer::State state = command_buffer_->GetLastState(); |
| 258 return state.error == gpu::error::kLostContext; | 258 return state.error == gpu::error::kLostContext; |
| 259 } | 259 } |
| 260 | 260 |
| 261 CommandBufferProxy* RendererGLContext::GetCommandBufferProxy() { | 261 CommandBufferProxy* RendererGLContext::GetCommandBufferProxy() { |
| 262 return command_buffer_; | 262 return command_buffer_; |
| 263 } | 263 } |
| 264 | 264 |
| 265 bool RendererGLContext::SetSurfaceVisible(bool visible) { |
| 266 return GetCommandBufferProxy()->SetSurfaceVisible(visible); |
| 267 } |
| 268 |
| 265 // TODO(gman): Remove This | 269 // TODO(gman): Remove This |
| 266 void RendererGLContext::DisableShaderTranslation() { | 270 void RendererGLContext::DisableShaderTranslation() { |
| 267 NOTREACHED(); | 271 NOTREACHED(); |
| 268 } | 272 } |
| 269 | 273 |
| 270 gpu::gles2::GLES2Implementation* RendererGLContext::GetImplementation() { | 274 gpu::gles2::GLES2Implementation* RendererGLContext::GetImplementation() { |
| 271 return gles2_implementation_; | 275 return gles2_implementation_; |
| 272 } | 276 } |
| 273 | 277 |
| 274 RendererGLContext::RendererGLContext(GpuChannelHost* channel) | 278 RendererGLContext::RendererGLContext(GpuChannelHost* channel) |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 void RendererGLContext::OnContextLost() { | 453 void RendererGLContext::OnContextLost() { |
| 450 if (!context_lost_callback_.is_null()) { | 454 if (!context_lost_callback_.is_null()) { |
| 451 RendererGLContext::ContextLostReason reason = kUnknown; | 455 RendererGLContext::ContextLostReason reason = kUnknown; |
| 452 if (command_buffer_) { | 456 if (command_buffer_) { |
| 453 reason = ConvertReason( | 457 reason = ConvertReason( |
| 454 command_buffer_->GetLastState().context_lost_reason); | 458 command_buffer_->GetLastState().context_lost_reason); |
| 455 } | 459 } |
| 456 context_lost_callback_.Run(reason); | 460 context_lost_callback_.Run(reason); |
| 457 } | 461 } |
| 458 } | 462 } |
| OLD | NEW |