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 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 1574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1585 bool LayerTreeHostImpl::SwapBuffers(const LayerTreeHostImpl::FrameData& frame) { | 1585 bool LayerTreeHostImpl::SwapBuffers(const LayerTreeHostImpl::FrameData& frame) { |
1586 ResetRequiresHighResToDraw(); | 1586 ResetRequiresHighResToDraw(); |
1587 if (frame.has_no_damage) { | 1587 if (frame.has_no_damage) { |
1588 active_tree()->BreakSwapPromises(SwapPromise::SWAP_FAILS); | 1588 active_tree()->BreakSwapPromises(SwapPromise::SWAP_FAILS); |
1589 return false; | 1589 return false; |
1590 } | 1590 } |
1591 CompositorFrameMetadata metadata = MakeCompositorFrameMetadata(); | 1591 CompositorFrameMetadata metadata = MakeCompositorFrameMetadata(); |
1592 active_tree()->FinishSwapPromises(&metadata); | 1592 active_tree()->FinishSwapPromises(&metadata); |
1593 for (size_t i = 0; i < metadata.latency_info.size(); i++) { | 1593 for (size_t i = 0; i < metadata.latency_info.size(); i++) { |
1594 TRACE_EVENT_FLOW_STEP0( | 1594 TRACE_EVENT_FLOW_STEP0( |
1595 "input", | 1595 "input,benchmark", |
1596 "LatencyInfo.Flow", | 1596 "LatencyInfo.Flow", |
1597 TRACE_ID_DONT_MANGLE(metadata.latency_info[i].trace_id), | 1597 TRACE_ID_DONT_MANGLE(metadata.latency_info[i].trace_id), |
1598 "SwapBuffers"); | 1598 "SwapBuffers"); |
1599 } | 1599 } |
1600 renderer_->SwapBuffers(metadata); | 1600 renderer_->SwapBuffers(metadata); |
1601 return true; | 1601 return true; |
1602 } | 1602 } |
1603 | 1603 |
1604 void LayerTreeHostImpl::WillBeginImplFrame(const BeginFrameArgs& args) { | 1604 void LayerTreeHostImpl::WillBeginImplFrame(const BeginFrameArgs& args) { |
1605 // Sample the frame time now. This time will be used for updating animations | 1605 // Sample the frame time now. This time will be used for updating animations |
(...skipping 1850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3456 } | 3456 } |
3457 | 3457 |
3458 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { | 3458 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { |
3459 std::vector<PictureLayerImpl*>::iterator it = | 3459 std::vector<PictureLayerImpl*>::iterator it = |
3460 std::find(picture_layers_.begin(), picture_layers_.end(), layer); | 3460 std::find(picture_layers_.begin(), picture_layers_.end(), layer); |
3461 DCHECK(it != picture_layers_.end()); | 3461 DCHECK(it != picture_layers_.end()); |
3462 picture_layers_.erase(it); | 3462 picture_layers_.erase(it); |
3463 } | 3463 } |
3464 | 3464 |
3465 } // namespace cc | 3465 } // namespace cc |
OLD | NEW |