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

Side by Side Diff: cc/layer_tree_host_impl.cc

Issue 11472004: cc: Add receiver for CompositorFrameAck in LayerTreeHostImpl and forward it to the renderer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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 | Annotate | Revision Log
« no previous file with comments | « cc/layer_tree_host_impl.h ('k') | cc/renderer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 798 matching lines...) Expand 10 before | Expand all | Expand 10 after
809 m_client->setNeedsCommitOnImplThread(); 809 m_client->setNeedsCommitOnImplThread();
810 } 810 }
811 811
812 void LayerTreeHostImpl::onVSyncParametersChanged(double monotonicTimebase, doubl e intervalInSeconds) 812 void LayerTreeHostImpl::onVSyncParametersChanged(double monotonicTimebase, doubl e intervalInSeconds)
813 { 813 {
814 base::TimeTicks timebase = base::TimeTicks::FromInternalValue(monotonicTimeb ase * base::Time::kMicrosecondsPerSecond); 814 base::TimeTicks timebase = base::TimeTicks::FromInternalValue(monotonicTimeb ase * base::Time::kMicrosecondsPerSecond);
815 base::TimeDelta interval = base::TimeDelta::FromMicroseconds(intervalInSecon ds * base::Time::kMicrosecondsPerSecond); 815 base::TimeDelta interval = base::TimeDelta::FromMicroseconds(intervalInSecon ds * base::Time::kMicrosecondsPerSecond);
816 m_client->onVSyncParametersChanged(timebase, interval); 816 m_client->onVSyncParametersChanged(timebase, interval);
817 } 817 }
818 818
819 void LayerTreeHostImpl::onSendFrameToParentCompositorAck(const WebKit::WebCompos itorFrameAck& webAck)
820 {
821 if (!m_renderer)
822 return;
823
824 // TODO(piman): We may need to do some validation on this ack before process ing it.
825 // TODO(danakj): This cast goes away when we move WebCompositorOutputSurface to cc::OutputSurface.
826 const CompositorFrameAck& ack = reinterpret_cast<const CompositorFrameAck&>( webAck);
piman 2012/12/06 18:07:05 In the mean time, can we just make CompositorFrame
827 m_renderer->receiveCompositorFrameAck(ack);
828 }
829
819 void LayerTreeHostImpl::drawLayers(FrameData& frame) 830 void LayerTreeHostImpl::drawLayers(FrameData& frame)
820 { 831 {
821 TRACE_EVENT0("cc", "LayerTreeHostImpl::drawLayers"); 832 TRACE_EVENT0("cc", "LayerTreeHostImpl::drawLayers");
822 DCHECK(canDraw()); 833 DCHECK(canDraw());
823 DCHECK(!frame.renderPasses.empty()); 834 DCHECK(!frame.renderPasses.empty());
824 835
825 // FIXME: use the frame begin time from the overall compositor scheduler. 836 // FIXME: use the frame begin time from the overall compositor scheduler.
826 // This value is currently inaccessible because it is up in Chromium's 837 // This value is currently inaccessible because it is up in Chromium's
827 // RenderWidget. 838 // RenderWidget.
828 m_fpsCounter->markBeginningOfFrame(base::TimeTicks::Now()); 839 m_fpsCounter->markBeginningOfFrame(base::TimeTicks::Now());
(...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after
1632 ScrollbarAnimationController* scrollbarController = layer->scrollbarAnimatio nController(); 1643 ScrollbarAnimationController* scrollbarController = layer->scrollbarAnimatio nController();
1633 double monotonicTime = (time - base::TimeTicks()).InSecondsF(); 1644 double monotonicTime = (time - base::TimeTicks()).InSecondsF();
1634 if (scrollbarController && scrollbarController->animate(monotonicTime)) 1645 if (scrollbarController && scrollbarController->animate(monotonicTime))
1635 m_client->setNeedsRedrawOnImplThread(); 1646 m_client->setNeedsRedrawOnImplThread();
1636 1647
1637 for (size_t i = 0; i < layer->children().size(); ++i) 1648 for (size_t i = 0; i < layer->children().size(); ++i)
1638 animateScrollbarsRecursive(layer->children()[i], time); 1649 animateScrollbarsRecursive(layer->children()[i], time);
1639 } 1650 }
1640 1651
1641 } // namespace cc 1652 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layer_tree_host_impl.h ('k') | cc/renderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698