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 866 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
877 | 877 |
878 void LayerTreeHostImpl::drawLayers(FrameData& frame) | 878 void LayerTreeHostImpl::drawLayers(FrameData& frame) |
879 { | 879 { |
880 TRACE_EVENT0("cc", "LayerTreeHostImpl::drawLayers"); | 880 TRACE_EVENT0("cc", "LayerTreeHostImpl::drawLayers"); |
881 DCHECK(canDraw()); | 881 DCHECK(canDraw()); |
882 DCHECK(!frame.renderPasses.empty()); | 882 DCHECK(!frame.renderPasses.empty()); |
883 | 883 |
884 // FIXME: use the frame begin time from the overall compositor scheduler. | 884 // FIXME: use the frame begin time from the overall compositor scheduler. |
885 // This value is currently inaccessible because it is up in Chromium's | 885 // This value is currently inaccessible because it is up in Chromium's |
886 // RenderWidget. | 886 // RenderWidget. |
887 m_fpsCounter->markBeginningOfFrame(base::TimeTicks::Now()); | 887 m_fpsCounter->saveTimeStamp(base::TimeTicks::Now()); |
888 | 888 |
889 if (m_debugState.showHudRects()) | 889 if (m_debugState.showHudRects()) |
890 m_debugRectHistory->saveDebugRectsForCurrentFrame(rootLayer(), *frame.re
nderSurfaceLayerList, frame.occludingScreenSpaceRects, frame.nonOccludingScreenS
paceRects, m_debugState); | 890 m_debugRectHistory->saveDebugRectsForCurrentFrame(rootLayer(), *frame.re
nderSurfaceLayerList, frame.occludingScreenSpaceRects, frame.nonOccludingScreenS
paceRects, m_debugState); |
891 | 891 |
892 // Because the contents of the HUD depend on everything else in the frame, t
he contents | 892 // Because the contents of the HUD depend on everything else in the frame, t
he contents |
893 // of its texture are updated as the last thing before the frame is drawn. | 893 // of its texture are updated as the last thing before the frame is drawn. |
894 if (m_activeTree->hud_layer()) | 894 if (m_activeTree->hud_layer()) |
895 m_activeTree->hud_layer()->updateHudTexture(m_resourceProvider.get()); | 895 m_activeTree->hud_layer()->updateHudTexture(m_resourceProvider.get()); |
896 | 896 |
897 m_renderer->drawFrame(frame.renderPasses); | 897 m_renderer->drawFrame(frame.renderPasses); |
(...skipping 29 matching lines...) Expand all Loading... |
927 } | 927 } |
928 | 928 |
929 const RendererCapabilities& LayerTreeHostImpl::rendererCapabilities() const | 929 const RendererCapabilities& LayerTreeHostImpl::rendererCapabilities() const |
930 { | 930 { |
931 return m_renderer->capabilities(); | 931 return m_renderer->capabilities(); |
932 } | 932 } |
933 | 933 |
934 bool LayerTreeHostImpl::swapBuffers() | 934 bool LayerTreeHostImpl::swapBuffers() |
935 { | 935 { |
936 DCHECK(m_renderer); | 936 DCHECK(m_renderer); |
937 | |
938 m_fpsCounter->markEndOfFrame(); | |
939 return m_renderer->swapBuffers(); | 937 return m_renderer->swapBuffers(); |
940 } | 938 } |
941 | 939 |
942 const gfx::Size& LayerTreeHostImpl::deviceViewportSize() const | 940 const gfx::Size& LayerTreeHostImpl::deviceViewportSize() const |
943 { | 941 { |
944 return m_deviceViewportSize; | 942 return m_deviceViewportSize; |
945 } | 943 } |
946 | 944 |
947 const LayerTreeSettings& LayerTreeHostImpl::settings() const | 945 const LayerTreeSettings& LayerTreeHostImpl::settings() const |
948 { | 946 { |
(...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1730 } | 1728 } |
1731 | 1729 |
1732 skia::RefPtr<SkPicture> LayerTreeHostImpl::capturePicture() | 1730 skia::RefPtr<SkPicture> LayerTreeHostImpl::capturePicture() |
1733 { | 1731 { |
1734 LayerTreeImpl* tree = pendingTree() ? pendingTree() : activeTree(); | 1732 LayerTreeImpl* tree = pendingTree() ? pendingTree() : activeTree(); |
1735 LayerImpl* layer = getNonCompositedContentLayerRecursive(tree->RootLayer()); | 1733 LayerImpl* layer = getNonCompositedContentLayerRecursive(tree->RootLayer()); |
1736 return layer ? layer->getPicture() : skia::RefPtr<SkPicture>(); | 1734 return layer ? layer->getPicture() : skia::RefPtr<SkPicture>(); |
1737 } | 1735 } |
1738 | 1736 |
1739 } // namespace cc | 1737 } // namespace cc |
OLD | NEW |