Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(29)

Side by Side Diff: cc/layer_tree_host_impl.cc

Issue 11817011: cc: add RingBuffer class for timestamp storing in FrameRateCounter (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 867 matching lines...) Expand 10 before | Expand all | Expand 10 after
878 878
879 void LayerTreeHostImpl::drawLayers(FrameData& frame) 879 void LayerTreeHostImpl::drawLayers(FrameData& frame)
880 { 880 {
881 TRACE_EVENT0("cc", "LayerTreeHostImpl::drawLayers"); 881 TRACE_EVENT0("cc", "LayerTreeHostImpl::drawLayers");
882 DCHECK(canDraw()); 882 DCHECK(canDraw());
883 DCHECK(!frame.renderPasses.isEmpty()); 883 DCHECK(!frame.renderPasses.isEmpty());
884 884
885 // FIXME: use the frame begin time from the overall compositor scheduler. 885 // FIXME: use the frame begin time from the overall compositor scheduler.
886 // This value is currently inaccessible because it is up in Chromium's 886 // This value is currently inaccessible because it is up in Chromium's
887 // RenderWidget. 887 // RenderWidget.
888 m_fpsCounter->markBeginningOfFrame(base::TimeTicks::Now()); 888 m_fpsCounter->saveTimeStamp(base::TimeTicks::Now());
889 889
890 if (m_debugState.showHudRects()) 890 if (m_debugState.showHudRects())
891 m_debugRectHistory->saveDebugRectsForCurrentFrame(rootLayer(), *frame.re nderSurfaceLayerList, frame.occludingScreenSpaceRects, frame.nonOccludingScreenS paceRects, m_debugState); 891 m_debugRectHistory->saveDebugRectsForCurrentFrame(rootLayer(), *frame.re nderSurfaceLayerList, frame.occludingScreenSpaceRects, frame.nonOccludingScreenS paceRects, m_debugState);
892 892
893 // Because the contents of the HUD depend on everything else in the frame, t he contents 893 // Because the contents of the HUD depend on everything else in the frame, t he contents
894 // of its texture are updated as the last thing before the frame is drawn. 894 // of its texture are updated as the last thing before the frame is drawn.
895 if (m_activeTree->hud_layer()) 895 if (m_activeTree->hud_layer())
896 m_activeTree->hud_layer()->updateHudTexture(m_resourceProvider.get()); 896 m_activeTree->hud_layer()->updateHudTexture(m_resourceProvider.get());
897 897
898 m_renderer->drawFrame(frame.renderPasses); 898 m_renderer->drawFrame(frame.renderPasses);
(...skipping 29 matching lines...) Expand all
928 } 928 }
929 929
930 const RendererCapabilities& LayerTreeHostImpl::rendererCapabilities() const 930 const RendererCapabilities& LayerTreeHostImpl::rendererCapabilities() const
931 { 931 {
932 return m_renderer->capabilities(); 932 return m_renderer->capabilities();
933 } 933 }
934 934
935 bool LayerTreeHostImpl::swapBuffers() 935 bool LayerTreeHostImpl::swapBuffers()
936 { 936 {
937 DCHECK(m_renderer); 937 DCHECK(m_renderer);
938
939 m_fpsCounter->markEndOfFrame();
egraether 2013/01/09 02:04:04 I found this call had no real purpose and was lead
940 return m_renderer->swapBuffers(); 938 return m_renderer->swapBuffers();
941 } 939 }
942 940
943 const gfx::Size& LayerTreeHostImpl::deviceViewportSize() const 941 const gfx::Size& LayerTreeHostImpl::deviceViewportSize() const
944 { 942 {
945 return m_deviceViewportSize; 943 return m_deviceViewportSize;
946 } 944 }
947 945
948 const LayerTreeSettings& LayerTreeHostImpl::settings() const 946 const LayerTreeSettings& LayerTreeHostImpl::settings() const
949 { 947 {
(...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after
1703 ScrollbarAnimationController* scrollbarController = layer->scrollbarAnimatio nController(); 1701 ScrollbarAnimationController* scrollbarController = layer->scrollbarAnimatio nController();
1704 double monotonicTime = (time - base::TimeTicks()).InSecondsF(); 1702 double monotonicTime = (time - base::TimeTicks()).InSecondsF();
1705 if (scrollbarController && scrollbarController->animate(monotonicTime)) 1703 if (scrollbarController && scrollbarController->animate(monotonicTime))
1706 m_client->setNeedsRedrawOnImplThread(); 1704 m_client->setNeedsRedrawOnImplThread();
1707 1705
1708 for (size_t i = 0; i < layer->children().size(); ++i) 1706 for (size_t i = 0; i < layer->children().size(); ++i)
1709 animateScrollbarsRecursive(layer->children()[i], time); 1707 animateScrollbarsRecursive(layer->children()[i], time);
1710 } 1708 }
1711 1709
1712 } // namespace cc 1710 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698