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/layer_tree_host_impl.h" | 5 #include "cc/layer_tree_host_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
793 { | 793 { |
794 TRACE_EVENT0("cc", "LayerTreeHostImpl::drawLayers"); | 794 TRACE_EVENT0("cc", "LayerTreeHostImpl::drawLayers"); |
795 DCHECK(canDraw()); | 795 DCHECK(canDraw()); |
796 DCHECK(!frame.renderPasses.empty()); | 796 DCHECK(!frame.renderPasses.empty()); |
797 | 797 |
798 // FIXME: use the frame begin time from the overall compositor scheduler. | 798 // FIXME: use the frame begin time from the overall compositor scheduler. |
799 // This value is currently inaccessible because it is up in Chromium's | 799 // This value is currently inaccessible because it is up in Chromium's |
800 // RenderWidget. | 800 // RenderWidget. |
801 m_fpsCounter->markBeginningOfFrame(base::TimeTicks::Now()); | 801 m_fpsCounter->markBeginningOfFrame(base::TimeTicks::Now()); |
802 | 802 |
803 // Get the TranslateY value for a sanity-check on scrolling benchmark | |
804 // metrics. Specifically, we want to make sure | |
805 // BasicMouseWheelSmoothScrollGesture has proper scroll curves. | |
806 TRACE_COUNTER_ID1("gpu", "frame_counter_translate_y", this, | |
nduca
2012/11/27 23:50:27
maybe root_layer_y_translate?
shawnsingh
2012/11/27 23:59:58
I also like nduca's proposed rename.
What assumpt
| |
807 m_rootScrollLayerImpl->drawTransform().matrix().getDouble( | |
jamesr
2012/11/28 00:02:16
cc::LayerImpl has a scrollOffset, can't you use th
| |
808 1, 3)); | |
809 | |
803 if (m_settings.showDebugRects()) | 810 if (m_settings.showDebugRects()) |
804 m_debugRectHistory->saveDebugRectsForCurrentFrame(m_rootLayerImpl.get(), *frame.renderSurfaceLayerList, frame.occludingScreenSpaceRects, frame.nonOcclud ingScreenSpaceRects, settings()); | 811 m_debugRectHistory->saveDebugRectsForCurrentFrame(m_rootLayerImpl.get(), *frame.renderSurfaceLayerList, frame.occludingScreenSpaceRects, frame.nonOcclud ingScreenSpaceRects, settings()); |
805 | 812 |
806 // Because the contents of the HUD depend on everything else in the frame, t he contents | 813 // Because the contents of the HUD depend on everything else in the frame, t he contents |
807 // of its texture are updated as the last thing before the frame is drawn. | 814 // of its texture are updated as the last thing before the frame is drawn. |
808 if (m_hudLayerImpl) | 815 if (m_hudLayerImpl) |
809 m_hudLayerImpl->updateHudTexture(m_resourceProvider.get()); | 816 m_hudLayerImpl->updateHudTexture(m_resourceProvider.get()); |
810 | 817 |
811 m_renderer->drawFrame(frame.renderPasses, frame.renderPassesById); | 818 m_renderer->drawFrame(frame.renderPasses, frame.renderPassesById); |
812 | 819 |
(...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1598 ScrollbarAnimationController* scrollbarController = layer->scrollbarAnimatio nController(); | 1605 ScrollbarAnimationController* scrollbarController = layer->scrollbarAnimatio nController(); |
1599 double monotonicTime = (time - base::TimeTicks()).InSecondsF(); | 1606 double monotonicTime = (time - base::TimeTicks()).InSecondsF(); |
1600 if (scrollbarController && scrollbarController->animate(monotonicTime)) | 1607 if (scrollbarController && scrollbarController->animate(monotonicTime)) |
1601 m_client->setNeedsRedrawOnImplThread(); | 1608 m_client->setNeedsRedrawOnImplThread(); |
1602 | 1609 |
1603 for (size_t i = 0; i < layer->children().size(); ++i) | 1610 for (size_t i = 0; i < layer->children().size(); ++i) |
1604 animateScrollbarsRecursive(layer->children()[i], time); | 1611 animateScrollbarsRecursive(layer->children()[i], time); |
1605 } | 1612 } |
1606 | 1613 |
1607 } // namespace cc | 1614 } // namespace cc |
OLD | NEW |