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

Side by Side Diff: cc/layer_tree_host_impl.cc

Issue 11833009: Provide a vsync notification to the renderer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 7 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « cc/layer_tree_host_impl.h ('k') | cc/layer_tree_host_impl_unittest.cc » ('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 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 return false; 231 return false;
232 } 232 }
233 return true; 233 return true;
234 } 234 }
235 235
236 OutputSurface* LayerTreeHostImpl::outputSurface() const 236 OutputSurface* LayerTreeHostImpl::outputSurface() const
237 { 237 {
238 return m_outputSurface.get(); 238 return m_outputSurface.get();
239 } 239 }
240 240
241 void LayerTreeHostImpl::enableVSyncNotification(bool enable)
242 {
243 m_outputSurface->EnableVSyncNotification(enable);
244 }
245
241 void LayerTreeHostImpl::animate(base::TimeTicks monotonicTime, base::Time wallCl ockTime) 246 void LayerTreeHostImpl::animate(base::TimeTicks monotonicTime, base::Time wallCl ockTime)
242 { 247 {
243 animatePageScale(monotonicTime); 248 animatePageScale(monotonicTime);
244 animateLayers(monotonicTime, wallClockTime); 249 animateLayers(monotonicTime, wallClockTime);
245 animateScrollbars(monotonicTime); 250 animateScrollbars(monotonicTime);
246 if (m_topControlsManager) 251 if (m_topControlsManager)
247 m_topControlsManager->Animate(monotonicTime); 252 m_topControlsManager->Animate(monotonicTime);
248 } 253 }
249 254
250 void LayerTreeHostImpl::manageTiles() 255 void LayerTreeHostImpl::manageTiles()
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after
746 751
747 void LayerTreeHostImpl::OnSendFrameToParentCompositorAck(const CompositorFrameAc k& ack) 752 void LayerTreeHostImpl::OnSendFrameToParentCompositorAck(const CompositorFrameAc k& ack)
748 { 753 {
749 if (!m_renderer) 754 if (!m_renderer)
750 return; 755 return;
751 756
752 // TODO(piman): We may need to do some validation on this ack before process ing it. 757 // TODO(piman): We may need to do some validation on this ack before process ing it.
753 m_renderer->receiveCompositorFrameAck(ack); 758 m_renderer->receiveCompositorFrameAck(ack);
754 } 759 }
755 760
761 void LayerTreeHostImpl::DidVSync(base::TimeTicks frameTime)
762 {
763 m_client->didVSync(frameTime);
764 }
765
756 void LayerTreeHostImpl::OnCanDrawStateChangedForTree(LayerTreeImpl*) 766 void LayerTreeHostImpl::OnCanDrawStateChangedForTree(LayerTreeImpl*)
757 { 767 {
758 m_client->onCanDrawStateChanged(canDraw()); 768 m_client->onCanDrawStateChanged(canDraw());
759 } 769 }
760 770
761 CompositorFrameMetadata LayerTreeHostImpl::makeCompositorFrameMetadata() const 771 CompositorFrameMetadata LayerTreeHostImpl::makeCompositorFrameMetadata() const
762 { 772 {
763 CompositorFrameMetadata metadata; 773 CompositorFrameMetadata metadata;
764 metadata.page_scale_factor = activeTree()->total_page_scale_factor(); 774 metadata.page_scale_factor = activeTree()->total_page_scale_factor();
765 metadata.viewport_size = activeTree()->ScrollableViewportSize(); 775 metadata.viewport_size = activeTree()->ScrollableViewportSize();
(...skipping 938 matching lines...) Expand 10 before | Expand all | Expand 10 after
1704 LayerImpl* layer = getNonCompositedContentLayerRecursive(tree->RootLayer()); 1714 LayerImpl* layer = getNonCompositedContentLayerRecursive(tree->RootLayer());
1705 return layer ? layer->getPicture() : skia::RefPtr<SkPicture>(); 1715 return layer ? layer->getPicture() : skia::RefPtr<SkPicture>();
1706 } 1716 }
1707 1717
1708 void LayerTreeHostImpl::savePaintTime(const base::TimeDelta& totalPaintTime) 1718 void LayerTreeHostImpl::savePaintTime(const base::TimeDelta& totalPaintTime)
1709 { 1719 {
1710 m_paintTimeCounter->SavePaintTime(totalPaintTime); 1720 m_paintTimeCounter->SavePaintTime(totalPaintTime);
1711 } 1721 }
1712 1722
1713 } // namespace cc 1723 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layer_tree_host_impl.h ('k') | cc/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698