OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "cc/trees/single_thread_proxy.h" | 5 #include "cc/trees/single_thread_proxy.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "cc/debug/benchmark_instrumentation.h" | 9 #include "cc/debug/benchmark_instrumentation.h" |
10 #include "cc/output/context_provider.h" | 10 #include "cc/output/context_provider.h" |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 ResourceProvider* resource_provider = | 290 ResourceProvider* resource_provider = |
291 layer_tree_host_impl_->resource_provider(); | 291 layer_tree_host_impl_->resource_provider(); |
292 | 292 |
293 if (!contents_texture_manager || !resource_provider) | 293 if (!contents_texture_manager || !resource_provider) |
294 return false; | 294 return false; |
295 | 295 |
296 return contents_texture_manager->ReduceMemoryOnImplThread( | 296 return contents_texture_manager->ReduceMemoryOnImplThread( |
297 limit_bytes, priority_cutoff, resource_provider); | 297 limit_bytes, priority_cutoff, resource_provider); |
298 } | 298 } |
299 | 299 |
300 void SingleThreadProxy::SendManagedMemoryStats() { | |
301 DCHECK(Proxy::IsImplThread()); | |
302 if (!layer_tree_host_impl_) | |
303 return; | |
304 PrioritizedResourceManager* contents_texture_manager = | |
305 layer_tree_host_->contents_texture_manager(); | |
306 if (!contents_texture_manager) | |
307 return; | |
308 | |
309 layer_tree_host_impl_->SendManagedMemoryStats( | |
310 contents_texture_manager->MemoryVisibleBytes(), | |
311 contents_texture_manager->MemoryVisibleAndNearbyBytes(), | |
312 contents_texture_manager->MemoryUseBytes()); | |
313 } | |
314 | |
315 bool SingleThreadProxy::IsInsideDraw() { return inside_draw_; } | 300 bool SingleThreadProxy::IsInsideDraw() { return inside_draw_; } |
316 | 301 |
317 void SingleThreadProxy::UpdateRendererCapabilitiesOnImplThread() { | 302 void SingleThreadProxy::UpdateRendererCapabilitiesOnImplThread() { |
318 DCHECK(IsImplThread()); | 303 DCHECK(IsImplThread()); |
319 renderer_capabilities_for_main_thread_ = | 304 renderer_capabilities_for_main_thread_ = |
320 layer_tree_host_impl_->GetRendererCapabilities().MainThreadCapabilities(); | 305 layer_tree_host_impl_->GetRendererCapabilities().MainThreadCapabilities(); |
321 } | 306 } |
322 | 307 |
323 void SingleThreadProxy::DidLoseOutputSurfaceOnImplThread() { | 308 void SingleThreadProxy::DidLoseOutputSurfaceOnImplThread() { |
324 TRACE_EVENT0("cc", "SingleThreadProxy::DidLoseOutputSurfaceOnImplThread"); | 309 TRACE_EVENT0("cc", "SingleThreadProxy::DidLoseOutputSurfaceOnImplThread"); |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 void SingleThreadProxy::DidSwapFrame() { | 451 void SingleThreadProxy::DidSwapFrame() { |
467 if (next_frame_is_newly_committed_frame_) { | 452 if (next_frame_is_newly_committed_frame_) { |
468 next_frame_is_newly_committed_frame_ = false; | 453 next_frame_is_newly_committed_frame_ = false; |
469 layer_tree_host_->DidCommitAndDrawFrame(); | 454 layer_tree_host_->DidCommitAndDrawFrame(); |
470 } | 455 } |
471 } | 456 } |
472 | 457 |
473 bool SingleThreadProxy::CommitPendingForTesting() { return false; } | 458 bool SingleThreadProxy::CommitPendingForTesting() { return false; } |
474 | 459 |
475 } // namespace cc | 460 } // namespace cc |
OLD | NEW |