| 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 767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 778 | 778 |
| 779 void LayerTreeHostImpl::drawLayers(FrameData& frame) | 779 void LayerTreeHostImpl::drawLayers(FrameData& frame) |
| 780 { | 780 { |
| 781 TRACE_EVENT0("cc", "LayerTreeHostImpl::drawLayers"); | 781 TRACE_EVENT0("cc", "LayerTreeHostImpl::drawLayers"); |
| 782 DCHECK(canDraw()); | 782 DCHECK(canDraw()); |
| 783 DCHECK(!frame.renderPasses.empty()); | 783 DCHECK(!frame.renderPasses.empty()); |
| 784 | 784 |
| 785 // FIXME: use the frame begin time from the overall compositor scheduler. | 785 // FIXME: use the frame begin time from the overall compositor scheduler. |
| 786 // This value is currently inaccessible because it is up in Chromium's | 786 // This value is currently inaccessible because it is up in Chromium's |
| 787 // RenderWidget. | 787 // RenderWidget. |
| 788 m_fpsCounter->markBeginningOfFrame(base::TimeTicks::Now()); | 788 m_fpsCounter->saveTimeStamp(base::TimeTicks::Now()); |
| 789 | 789 |
| 790 if (m_debugState.showHudRects()) | 790 if (m_debugState.showHudRects()) |
| 791 m_debugRectHistory->saveDebugRectsForCurrentFrame(rootLayer(), *frame.re
nderSurfaceLayerList, frame.occludingScreenSpaceRects, frame.nonOccludingScreenS
paceRects, m_debugState); | 791 m_debugRectHistory->saveDebugRectsForCurrentFrame(rootLayer(), *frame.re
nderSurfaceLayerList, frame.occludingScreenSpaceRects, frame.nonOccludingScreenS
paceRects, m_debugState); |
| 792 | 792 |
| 793 // Because the contents of the HUD depend on everything else in the frame, t
he contents | 793 // Because the contents of the HUD depend on everything else in the frame, t
he contents |
| 794 // of its texture are updated as the last thing before the frame is drawn. | 794 // of its texture are updated as the last thing before the frame is drawn. |
| 795 if (m_activeTree->hud_layer()) | 795 if (m_activeTree->hud_layer()) |
| 796 m_activeTree->hud_layer()->updateHudTexture(m_resourceProvider.get()); | 796 m_activeTree->hud_layer()->updateHudTexture(m_resourceProvider.get()); |
| 797 | 797 |
| 798 m_renderer->drawFrame(frame.renderPasses); | 798 m_renderer->drawFrame(frame.renderPasses); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 828 } | 828 } |
| 829 | 829 |
| 830 const RendererCapabilities& LayerTreeHostImpl::rendererCapabilities() const | 830 const RendererCapabilities& LayerTreeHostImpl::rendererCapabilities() const |
| 831 { | 831 { |
| 832 return m_renderer->capabilities(); | 832 return m_renderer->capabilities(); |
| 833 } | 833 } |
| 834 | 834 |
| 835 bool LayerTreeHostImpl::swapBuffers() | 835 bool LayerTreeHostImpl::swapBuffers() |
| 836 { | 836 { |
| 837 DCHECK(m_renderer); | 837 DCHECK(m_renderer); |
| 838 | |
| 839 m_fpsCounter->markEndOfFrame(); | |
| 840 return m_renderer->swapBuffers(); | 838 return m_renderer->swapBuffers(); |
| 841 } | 839 } |
| 842 | 840 |
| 843 const gfx::Size& LayerTreeHostImpl::deviceViewportSize() const | 841 const gfx::Size& LayerTreeHostImpl::deviceViewportSize() const |
| 844 { | 842 { |
| 845 return m_deviceViewportSize; | 843 return m_deviceViewportSize; |
| 846 } | 844 } |
| 847 | 845 |
| 848 const LayerTreeSettings& LayerTreeHostImpl::settings() const | 846 const LayerTreeSettings& LayerTreeHostImpl::settings() const |
| 849 { | 847 { |
| (...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1631 } | 1629 } |
| 1632 | 1630 |
| 1633 skia::RefPtr<SkPicture> LayerTreeHostImpl::capturePicture() | 1631 skia::RefPtr<SkPicture> LayerTreeHostImpl::capturePicture() |
| 1634 { | 1632 { |
| 1635 LayerTreeImpl* tree = pendingTree() ? pendingTree() : activeTree(); | 1633 LayerTreeImpl* tree = pendingTree() ? pendingTree() : activeTree(); |
| 1636 LayerImpl* layer = getNonCompositedContentLayerRecursive(tree->RootLayer()); | 1634 LayerImpl* layer = getNonCompositedContentLayerRecursive(tree->RootLayer()); |
| 1637 return layer ? layer->getPicture() : skia::RefPtr<SkPicture>(); | 1635 return layer ? layer->getPicture() : skia::RefPtr<SkPicture>(); |
| 1638 } | 1636 } |
| 1639 | 1637 |
| 1640 } // namespace cc | 1638 } // namespace cc |
| OLD | NEW |