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/thread_proxy.h" | 5 #include "cc/trees/thread_proxy.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "cc/base/thread.h" | 10 #include "cc/base/thread.h" |
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 | 448 |
449 layer_tree_host_impl_->SendManagedMemoryStats( | 449 layer_tree_host_impl_->SendManagedMemoryStats( |
450 layer_tree_host_->contents_texture_manager()->MemoryVisibleBytes(), | 450 layer_tree_host_->contents_texture_manager()->MemoryVisibleBytes(), |
451 layer_tree_host_->contents_texture_manager()-> | 451 layer_tree_host_->contents_texture_manager()-> |
452 MemoryVisibleAndNearbyBytes(), | 452 MemoryVisibleAndNearbyBytes(), |
453 layer_tree_host_->contents_texture_manager()->MemoryUseBytes()); | 453 layer_tree_host_->contents_texture_manager()->MemoryUseBytes()); |
454 } | 454 } |
455 | 455 |
456 bool ThreadProxy::IsInsideDraw() { return inside_draw_; } | 456 bool ThreadProxy::IsInsideDraw() { return inside_draw_; } |
457 | 457 |
458 void ThreadProxy::SetNeedsRedraw(const gfx::Rect& damage_rect) { | 458 void ThreadProxy::SetNeedsRedraw(gfx::Rect damage_rect) { |
459 DCHECK(IsMainThread()); | 459 DCHECK(IsMainThread()); |
460 TRACE_EVENT0("cc", "ThreadProxy::SetNeedsRedraw"); | 460 TRACE_EVENT0("cc", "ThreadProxy::SetNeedsRedraw"); |
461 Proxy::ImplThread()->PostTask(base::Bind( | 461 Proxy::ImplThread()->PostTask(base::Bind( |
462 &ThreadProxy::SetViewportDamageOnImplThread, | 462 &ThreadProxy::SetViewportDamageOnImplThread, |
463 impl_thread_weak_ptr_, damage_rect)); | 463 impl_thread_weak_ptr_, damage_rect)); |
464 Proxy::ImplThread()->PostTask(base::Bind( | 464 Proxy::ImplThread()->PostTask(base::Bind( |
465 &ThreadProxy::SetNeedsRedrawOnImplThread, impl_thread_weak_ptr_)); | 465 &ThreadProxy::SetNeedsRedrawOnImplThread, impl_thread_weak_ptr_)); |
466 } | 466 } |
467 | 467 |
468 void ThreadProxy::SetDeferCommits(bool defer_commits) { | 468 void ThreadProxy::SetDeferCommits(bool defer_commits) { |
(...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1155 layer_tree_host_impl_->resource_provider()); | 1155 layer_tree_host_impl_->resource_provider()); |
1156 layer_tree_host_impl_->EnableVSyncNotification(false); | 1156 layer_tree_host_impl_->EnableVSyncNotification(false); |
1157 input_handler_on_impl_thread_.reset(); | 1157 input_handler_on_impl_thread_.reset(); |
1158 layer_tree_host_impl_.reset(); | 1158 layer_tree_host_impl_.reset(); |
1159 scheduler_on_impl_thread_.reset(); | 1159 scheduler_on_impl_thread_.reset(); |
1160 weak_factory_on_impl_thread_.InvalidateWeakPtrs(); | 1160 weak_factory_on_impl_thread_.InvalidateWeakPtrs(); |
1161 vsync_client_ = NULL; | 1161 vsync_client_ = NULL; |
1162 completion->Signal(); | 1162 completion->Signal(); |
1163 } | 1163 } |
1164 | 1164 |
1165 void ThreadProxy::SetViewportDamageOnImplThread(const gfx::Rect& damage_rect) { | 1165 void ThreadProxy::SetViewportDamageOnImplThread(gfx::Rect damage_rect) { |
1166 DCHECK(IsImplThread()); | 1166 DCHECK(IsImplThread()); |
1167 layer_tree_host_impl_->SetViewportDamage(damage_rect); | 1167 layer_tree_host_impl_->SetViewportDamage(damage_rect); |
1168 } | 1168 } |
1169 | 1169 |
1170 size_t ThreadProxy::MaxPartialTextureUpdates() const { | 1170 size_t ThreadProxy::MaxPartialTextureUpdates() const { |
1171 return ResourceUpdateController::MaxPartialTextureUpdates(); | 1171 return ResourceUpdateController::MaxPartialTextureUpdates(); |
1172 } | 1172 } |
1173 | 1173 |
1174 void ThreadProxy::RecreateOutputSurfaceOnImplThread( | 1174 void ThreadProxy::RecreateOutputSurfaceOnImplThread( |
1175 CompletionEvent* completion, | 1175 CompletionEvent* completion, |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1349 | 1349 |
1350 void ThreadProxy::DidReceiveLastInputEventForVSync( | 1350 void ThreadProxy::DidReceiveLastInputEventForVSync( |
1351 base::TimeTicks frame_time) { | 1351 base::TimeTicks frame_time) { |
1352 if (render_vsync_notification_enabled_) { | 1352 if (render_vsync_notification_enabled_) { |
1353 TRACE_EVENT0("cc", "ThreadProxy::DidReceiveLastInputEventForVSync"); | 1353 TRACE_EVENT0("cc", "ThreadProxy::DidReceiveLastInputEventForVSync"); |
1354 DidVSync(frame_time); | 1354 DidVSync(frame_time); |
1355 } | 1355 } |
1356 } | 1356 } |
1357 | 1357 |
1358 } // namespace cc | 1358 } // namespace cc |
OLD | NEW |