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_impl.h" | 5 #include "cc/trees/layer_tree_host_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 1627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1638 } | 1638 } |
| 1639 | 1639 |
| 1640 const RendererCapabilitiesImpl& | 1640 const RendererCapabilitiesImpl& |
| 1641 LayerTreeHostImpl::GetRendererCapabilities() const { | 1641 LayerTreeHostImpl::GetRendererCapabilities() const { |
| 1642 return renderer_->Capabilities(); | 1642 return renderer_->Capabilities(); |
| 1643 } | 1643 } |
| 1644 | 1644 |
| 1645 bool LayerTreeHostImpl::SwapBuffers(const LayerTreeHostImpl::FrameData& frame) { | 1645 bool LayerTreeHostImpl::SwapBuffers(const LayerTreeHostImpl::FrameData& frame) { |
| 1646 ResetRequiresHighResToDraw(); | 1646 ResetRequiresHighResToDraw(); |
| 1647 if (frame.has_no_damage) { | 1647 if (frame.has_no_damage) { |
| 1648 active_tree()->BreakSwapPromises(SwapPromise::SWAP_FAILS); | 1648 active_tree()->BreakSwapPromises(Promise::DidNotSwap::SWAP_FAILS); |
| 1649 return false; | 1649 return false; |
| 1650 } | 1650 } |
| 1651 CompositorFrameMetadata metadata = MakeCompositorFrameMetadata(); | 1651 CompositorFrameMetadata metadata = MakeCompositorFrameMetadata(); |
| 1652 active_tree()->FinishSwapPromises(&metadata); | 1652 active_tree()->FinishSwapPromises(&metadata); |
| 1653 for (auto& latency : metadata.latency_info) { | 1653 for (auto& latency : metadata.latency_info) { |
| 1654 TRACE_EVENT_FLOW_STEP0( | 1654 TRACE_EVENT_FLOW_STEP0( |
| 1655 "input,benchmark", | 1655 "input,benchmark", |
| 1656 "LatencyInfo.Flow", | 1656 "LatencyInfo.Flow", |
| 1657 TRACE_ID_DONT_MANGLE(latency.trace_id), | 1657 TRACE_ID_DONT_MANGLE(latency.trace_id), |
| 1658 "SwapBuffers"); | 1658 "SwapBuffers"); |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1855 // priorities. | 1855 // priorities. |
| 1856 if (!active_tree_->picture_layers().empty()) | 1856 if (!active_tree_->picture_layers().empty()) |
| 1857 DidModifyTilePriorities(); | 1857 DidModifyTilePriorities(); |
| 1858 } | 1858 } |
| 1859 | 1859 |
| 1860 client_->OnCanDrawStateChanged(CanDraw()); | 1860 client_->OnCanDrawStateChanged(CanDraw()); |
| 1861 client_->DidActivateSyncTree(); | 1861 client_->DidActivateSyncTree(); |
| 1862 if (!tree_activation_callback_.is_null()) | 1862 if (!tree_activation_callback_.is_null()) |
| 1863 tree_activation_callback_.Run(); | 1863 tree_activation_callback_.Run(); |
| 1864 | 1864 |
| 1865 CompositorFrameMetadata metadata = MakeCompositorFrameMetadata(); | |
|
boliu
2015/05/08 04:27:23
There's no frame for activation. DidActivate shoul
| |
| 1866 active_tree_->FinishActivationPromises(&metadata); | |
| 1867 | |
| 1865 if (debug_state_.continuous_painting) { | 1868 if (debug_state_.continuous_painting) { |
| 1866 const RenderingStats& stats = | 1869 const RenderingStats& stats = |
| 1867 rendering_stats_instrumentation_->GetRenderingStats(); | 1870 rendering_stats_instrumentation_->GetRenderingStats(); |
| 1868 // TODO(hendrikw): This requires a different metric when we commit directly | 1871 // TODO(hendrikw): This requires a different metric when we commit directly |
| 1869 // to the active tree. See crbug.com/429311. | 1872 // to the active tree. See crbug.com/429311. |
| 1870 paint_time_counter_->SavePaintTime( | 1873 paint_time_counter_->SavePaintTime( |
| 1871 stats.commit_to_activate_duration.GetLastTimeDelta() + | 1874 stats.commit_to_activate_duration.GetLastTimeDelta() + |
| 1872 stats.draw_duration.GetLastTimeDelta()); | 1875 stats.draw_duration.GetLastTimeDelta()); |
| 1873 } | 1876 } |
| 1874 | 1877 |
| (...skipping 1523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3398 new_target.SetToMin(layer_impl->MaxScrollOffset()); | 3401 new_target.SetToMin(layer_impl->MaxScrollOffset()); |
| 3399 | 3402 |
| 3400 curve->UpdateTarget( | 3403 curve->UpdateTarget( |
| 3401 animation->TrimTimeToCurrentIteration(CurrentBeginFrameArgs().frame_time) | 3404 animation->TrimTimeToCurrentIteration(CurrentBeginFrameArgs().frame_time) |
| 3402 .InSecondsF(), | 3405 .InSecondsF(), |
| 3403 new_target); | 3406 new_target); |
| 3404 | 3407 |
| 3405 return true; | 3408 return true; |
| 3406 } | 3409 } |
| 3407 } // namespace cc | 3410 } // namespace cc |
| OLD | NEW |