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 1435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1446 if (!InnerViewportScrollLayer()) | 1446 if (!InnerViewportScrollLayer()) |
1447 return metadata; | 1447 return metadata; |
1448 | 1448 |
1449 // TODO(miletus) : Change the metadata to hold ScrollOffset. | 1449 // TODO(miletus) : Change the metadata to hold ScrollOffset. |
1450 metadata.root_scroll_offset = gfx::ScrollOffsetToVector2dF( | 1450 metadata.root_scroll_offset = gfx::ScrollOffsetToVector2dF( |
1451 active_tree_->TotalScrollOffset()); | 1451 active_tree_->TotalScrollOffset()); |
1452 | 1452 |
1453 return metadata; | 1453 return metadata; |
1454 } | 1454 } |
1455 | 1455 |
1456 static void LayerTreeHostImplDidBeginTracingCallback(LayerImpl* layer) { | |
1457 layer->DidBeginTracing(); | |
1458 } | |
1459 | |
1460 void LayerTreeHostImpl::DrawLayers(FrameData* frame, | 1456 void LayerTreeHostImpl::DrawLayers(FrameData* frame, |
1461 base::TimeTicks frame_begin_time) { | 1457 base::TimeTicks frame_begin_time) { |
1462 TRACE_EVENT0("cc", "LayerTreeHostImpl::DrawLayers"); | 1458 TRACE_EVENT0("cc", "LayerTreeHostImpl::DrawLayers"); |
1463 DCHECK(CanDraw()); | 1459 DCHECK(CanDraw()); |
1464 | 1460 |
1465 if (!frame->composite_events.empty()) { | 1461 if (!frame->composite_events.empty()) { |
1466 frame_timing_tracker_->SaveTimeStamps(frame_begin_time, | 1462 frame_timing_tracker_->SaveTimeStamps(frame_begin_time, |
1467 frame->composite_events); | 1463 frame->composite_events); |
1468 } | 1464 } |
1469 | 1465 |
(...skipping 29 matching lines...) Expand all Loading... |
1499 paint_time_counter_->SavePaintTime( | 1495 paint_time_counter_->SavePaintTime( |
1500 stats.begin_main_frame_to_commit_duration.GetLastTimeDelta()); | 1496 stats.begin_main_frame_to_commit_duration.GetLastTimeDelta()); |
1501 } | 1497 } |
1502 | 1498 |
1503 bool is_new_trace; | 1499 bool is_new_trace; |
1504 TRACE_EVENT_IS_NEW_TRACE(&is_new_trace); | 1500 TRACE_EVENT_IS_NEW_TRACE(&is_new_trace); |
1505 if (is_new_trace) { | 1501 if (is_new_trace) { |
1506 if (pending_tree_) { | 1502 if (pending_tree_) { |
1507 LayerTreeHostCommon::CallFunctionForSubtree( | 1503 LayerTreeHostCommon::CallFunctionForSubtree( |
1508 pending_tree_->root_layer(), | 1504 pending_tree_->root_layer(), |
1509 base::Bind(&LayerTreeHostImplDidBeginTracingCallback)); | 1505 [](LayerImpl* layer) { layer->DidBeginTracing(); }); |
1510 } | 1506 } |
1511 LayerTreeHostCommon::CallFunctionForSubtree( | 1507 LayerTreeHostCommon::CallFunctionForSubtree( |
1512 active_tree_->root_layer(), | 1508 active_tree_->root_layer(), |
1513 base::Bind(&LayerTreeHostImplDidBeginTracingCallback)); | 1509 [](LayerImpl* layer) { layer->DidBeginTracing(); }); |
1514 } | 1510 } |
1515 | 1511 |
1516 { | 1512 { |
1517 TRACE_EVENT0("cc", "DrawLayers.FrameViewerTracing"); | 1513 TRACE_EVENT0("cc", "DrawLayers.FrameViewerTracing"); |
1518 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID( | 1514 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID( |
1519 TRACE_DISABLED_BY_DEFAULT("cc.debug") "," | 1515 TRACE_DISABLED_BY_DEFAULT("cc.debug") "," |
1520 TRACE_DISABLED_BY_DEFAULT("cc.debug.quads") "," | 1516 TRACE_DISABLED_BY_DEFAULT("cc.debug.quads") "," |
1521 TRACE_DISABLED_BY_DEFAULT("devtools.timeline.layers"), | 1517 TRACE_DISABLED_BY_DEFAULT("devtools.timeline.layers"), |
1522 "cc::LayerTreeHostImpl", | 1518 "cc::LayerTreeHostImpl", |
1523 id_, | 1519 id_, |
(...skipping 1942 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3466 (*it)->OnSetNeedsRedrawOnImpl(); | 3462 (*it)->OnSetNeedsRedrawOnImpl(); |
3467 } | 3463 } |
3468 | 3464 |
3469 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfForwardingToMainThread() { | 3465 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfForwardingToMainThread() { |
3470 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin(); | 3466 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin(); |
3471 for (; it != swap_promise_monitor_.end(); it++) | 3467 for (; it != swap_promise_monitor_.end(); it++) |
3472 (*it)->OnForwardScrollUpdateToMainThreadOnImpl(); | 3468 (*it)->OnForwardScrollUpdateToMainThreadOnImpl(); |
3473 } | 3469 } |
3474 | 3470 |
3475 } // namespace cc | 3471 } // namespace cc |
OLD | NEW |