OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/common/gpu/client/content_gl_context.h" | 5 #include "content/common/gpu/client/content_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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 | 273 |
274 int ContentGLContext::GetContextID() { | 274 int ContentGLContext::GetContextID() { |
275 return command_buffer_->route_id(); | 275 return command_buffer_->route_id(); |
276 } | 276 } |
277 | 277 |
278 bool ContentGLContext::SetSurfaceVisible(bool visible) { | 278 bool ContentGLContext::SetSurfaceVisible(bool visible) { |
279 return GetCommandBufferProxy()->SetSurfaceVisible(visible); | 279 return GetCommandBufferProxy()->SetSurfaceVisible(visible); |
280 } | 280 } |
281 | 281 |
282 void ContentGLContext::SetMemoryAllocationChangedCallback( | 282 void ContentGLContext::SetMemoryAllocationChangedCallback( |
283 const base::Callback<void(const GpuMemoryAllocation&)>& callback) { | 283 const base::Callback<void(const GpuMemoryAllocationForRenderer&)>& |
| 284 callback) { |
284 GetCommandBufferProxy()->SetMemoryAllocationChangedCallback(callback); | 285 GetCommandBufferProxy()->SetMemoryAllocationChangedCallback(callback); |
285 } | 286 } |
286 | 287 |
287 // TODO(gman): Remove This | 288 // TODO(gman): Remove This |
288 void ContentGLContext::DisableShaderTranslation() { | 289 void ContentGLContext::DisableShaderTranslation() { |
289 NOTREACHED(); | 290 NOTREACHED(); |
290 } | 291 } |
291 | 292 |
292 gpu::gles2::GLES2Implementation* ContentGLContext::GetImplementation() { | 293 gpu::gles2::GLES2Implementation* ContentGLContext::GetImplementation() { |
293 return gles2_implementation_; | 294 return gles2_implementation_; |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 void ContentGLContext::OnContextLost() { | 468 void ContentGLContext::OnContextLost() { |
468 if (!context_lost_callback_.is_null()) { | 469 if (!context_lost_callback_.is_null()) { |
469 ContentGLContext::ContextLostReason reason = kUnknown; | 470 ContentGLContext::ContextLostReason reason = kUnknown; |
470 if (command_buffer_) { | 471 if (command_buffer_) { |
471 reason = ConvertReason( | 472 reason = ConvertReason( |
472 command_buffer_->GetLastState().context_lost_reason); | 473 command_buffer_->GetLastState().context_lost_reason); |
473 } | 474 } |
474 context_lost_callback_.Run(reason); | 475 context_lost_callback_.Run(reason); |
475 } | 476 } |
476 } | 477 } |
OLD | NEW |