Chromium Code Reviews| 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/layer_tree_host.h" | 5 #include "cc/trees/layer_tree_host.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 246 proxy_->MainThreadHasStoppedFlinging(); | 246 proxy_->MainThreadHasStoppedFlinging(); |
| 247 } | 247 } |
| 248 | 248 |
| 249 void LayerTreeHost::Layout() { | 249 void LayerTreeHost::Layout() { |
| 250 client_->Layout(); | 250 client_->Layout(); |
| 251 } | 251 } |
| 252 | 252 |
| 253 void LayerTreeHost::BeginCommitOnImplThread(LayerTreeHostImpl* host_impl) { | 253 void LayerTreeHost::BeginCommitOnImplThread(LayerTreeHostImpl* host_impl) { |
| 254 DCHECK(proxy_->IsImplThread()); | 254 DCHECK(proxy_->IsImplThread()); |
| 255 TRACE_EVENT0("cc", "LayerTreeHost::CommitTo"); | 255 TRACE_EVENT0("cc", "LayerTreeHost::CommitTo"); |
| 256 host_impl->SetLatencyInfo(latency_info_); | |
|
jamesr
2013/04/17 23:15:21
To make this work in impl-side painting you want t
| |
| 257 latency_info_.Clear(); | |
| 256 } | 258 } |
| 257 | 259 |
| 258 // This function commits the LayerTreeHost to an impl tree. When modifying | 260 // This function commits the LayerTreeHost to an impl tree. When modifying |
| 259 // this function, keep in mind that the function *runs* on the impl thread! Any | 261 // this function, keep in mind that the function *runs* on the impl thread! Any |
| 260 // code that is logically a main thread operation, e.g. deletion of a Layer, | 262 // code that is logically a main thread operation, e.g. deletion of a Layer, |
| 261 // should be delayed until the LayerTreeHost::CommitComplete, which will run | 263 // should be delayed until the LayerTreeHost::CommitComplete, which will run |
| 262 // after the commit, but on the main thread. | 264 // after the commit, but on the main thread. |
| 263 void LayerTreeHost::FinishCommitOnImplThread(LayerTreeHostImpl* host_impl) { | 265 void LayerTreeHost::FinishCommitOnImplThread(LayerTreeHostImpl* host_impl) { |
| 264 DCHECK(proxy_->IsImplThread()); | 266 DCHECK(proxy_->IsImplThread()); |
| 265 | 267 |
| (...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 668 SetNeedsCommit(); | 670 SetNeedsCommit(); |
| 669 } | 671 } |
| 670 | 672 |
| 671 void LayerTreeHost::SetVisible(bool visible) { | 673 void LayerTreeHost::SetVisible(bool visible) { |
| 672 if (visible_ == visible) | 674 if (visible_ == visible) |
| 673 return; | 675 return; |
| 674 visible_ = visible; | 676 visible_ = visible; |
| 675 proxy_->SetVisible(visible); | 677 proxy_->SetVisible(visible); |
| 676 } | 678 } |
| 677 | 679 |
| 680 void LayerTreeHost::SetLatencyInfo(const LatencyInfo& latency_info) { | |
| 681 latency_info_.MergeWith(latency_info); | |
| 682 } | |
| 683 | |
| 678 void LayerTreeHost::StartPageScaleAnimation(gfx::Vector2d target_offset, | 684 void LayerTreeHost::StartPageScaleAnimation(gfx::Vector2d target_offset, |
| 679 bool use_anchor, | 685 bool use_anchor, |
| 680 float scale, | 686 float scale, |
| 681 base::TimeDelta duration) { | 687 base::TimeDelta duration) { |
| 682 pending_page_scale_animation_.reset(new PendingPageScaleAnimation); | 688 pending_page_scale_animation_.reset(new PendingPageScaleAnimation); |
| 683 pending_page_scale_animation_->target_offset = target_offset; | 689 pending_page_scale_animation_->target_offset = target_offset; |
| 684 pending_page_scale_animation_->use_anchor = use_anchor; | 690 pending_page_scale_animation_->use_anchor = use_anchor; |
| 685 pending_page_scale_animation_->scale = scale; | 691 pending_page_scale_animation_->scale = scale; |
| 686 pending_page_scale_animation_->duration = duration; | 692 pending_page_scale_animation_->duration = duration; |
| 687 | 693 |
| (...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1080 bool start_ready_animations = true; | 1086 bool start_ready_animations = true; |
| 1081 (*iter).second->UpdateState(start_ready_animations, NULL); | 1087 (*iter).second->UpdateState(start_ready_animations, NULL); |
| 1082 } | 1088 } |
| 1083 } | 1089 } |
| 1084 | 1090 |
| 1085 skia::RefPtr<SkPicture> LayerTreeHost::CapturePicture() { | 1091 skia::RefPtr<SkPicture> LayerTreeHost::CapturePicture() { |
| 1086 return proxy_->CapturePicture(); | 1092 return proxy_->CapturePicture(); |
| 1087 } | 1093 } |
| 1088 | 1094 |
| 1089 } // namespace cc | 1095 } // namespace cc |
| OLD | NEW |