| 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 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 | 259 |
| 260 bool RendererGLContext::IsCommandBufferContextLost() { | 260 bool RendererGLContext::IsCommandBufferContextLost() { |
| 261 gpu::CommandBuffer::State state = command_buffer_->GetLastState(); | 261 gpu::CommandBuffer::State state = command_buffer_->GetLastState(); |
| 262 return state.error == gpu::error::kLostContext; | 262 return state.error == gpu::error::kLostContext; |
| 263 } | 263 } |
| 264 | 264 |
| 265 CommandBufferProxy* RendererGLContext::GetCommandBufferProxy() { | 265 CommandBufferProxy* RendererGLContext::GetCommandBufferProxy() { |
| 266 return command_buffer_; | 266 return command_buffer_; |
| 267 } | 267 } |
| 268 | 268 |
| 269 bool RendererGLContext::SetSurfaceVisible(bool visible) { |
| 270 return GetCommandBufferProxy()->SetSurfaceVisible(visible); |
| 271 } |
| 272 |
| 269 // TODO(gman): Remove This | 273 // TODO(gman): Remove This |
| 270 void RendererGLContext::DisableShaderTranslation() { | 274 void RendererGLContext::DisableShaderTranslation() { |
| 271 NOTREACHED(); | 275 NOTREACHED(); |
| 272 } | 276 } |
| 273 | 277 |
| 274 gpu::gles2::GLES2Implementation* RendererGLContext::GetImplementation() { | 278 gpu::gles2::GLES2Implementation* RendererGLContext::GetImplementation() { |
| 275 return gles2_implementation_; | 279 return gles2_implementation_; |
| 276 } | 280 } |
| 277 | 281 |
| 278 RendererGLContext::RendererGLContext(GpuChannelHost* channel) | 282 RendererGLContext::RendererGLContext(GpuChannelHost* channel) |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 456 void RendererGLContext::OnContextLost() { | 460 void RendererGLContext::OnContextLost() { |
| 457 if (!context_lost_callback_.is_null()) { | 461 if (!context_lost_callback_.is_null()) { |
| 458 RendererGLContext::ContextLostReason reason = kUnknown; | 462 RendererGLContext::ContextLostReason reason = kUnknown; |
| 459 if (command_buffer_) { | 463 if (command_buffer_) { |
| 460 reason = ConvertReason( | 464 reason = ConvertReason( |
| 461 command_buffer_->GetLastState().context_lost_reason); | 465 command_buffer_->GetLastState().context_lost_reason); |
| 462 } | 466 } |
| 463 context_lost_callback_.Run(reason); | 467 context_lost_callback_.Run(reason); |
| 464 } | 468 } |
| 465 } | 469 } |
| OLD | NEW |