| 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 747 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 758 m_client->onVSyncParametersChanged(timebase, interval); | 758 m_client->onVSyncParametersChanged(timebase, interval); |
| 759 } | 759 } |
| 760 | 760 |
| 761 void LayerTreeHostImpl::OnSendFrameToParentCompositorAck(const CompositorFrameAc
k& ack) | 761 void LayerTreeHostImpl::OnSendFrameToParentCompositorAck(const CompositorFrameAc
k& ack) |
| 762 { | 762 { |
| 763 if (!m_renderer) | 763 if (!m_renderer) |
| 764 return; | 764 return; |
| 765 | 765 |
| 766 // TODO(piman): We may need to do some validation on this ack before process
ing it. | 766 // TODO(piman): We may need to do some validation on this ack before process
ing it. |
| 767 m_renderer->receiveCompositorFrameAck(ack); | 767 m_renderer->receiveCompositorFrameAck(ack); |
| 768 OnSwapBuffersComplete(); |
| 769 } |
| 770 |
| 771 void LayerTreeHostImpl::OnSwapBuffersComplete() |
| 772 { |
| 773 m_client->onSwapBuffersCompleteOnImplThread(); |
| 774 } |
| 775 |
| 776 void LayerTreeHostImpl::DidLoseOutputSurface() |
| 777 { |
| 778 m_client->didLoseOutputSurfaceOnImplThread(); |
| 768 } | 779 } |
| 769 | 780 |
| 770 void LayerTreeHostImpl::OnCanDrawStateChangedForTree(LayerTreeImpl*) | 781 void LayerTreeHostImpl::OnCanDrawStateChangedForTree(LayerTreeImpl*) |
| 771 { | 782 { |
| 772 m_client->onCanDrawStateChanged(canDraw()); | 783 m_client->onCanDrawStateChanged(canDraw()); |
| 773 } | 784 } |
| 774 | 785 |
| 775 CompositorFrameMetadata LayerTreeHostImpl::makeCompositorFrameMetadata() const | 786 CompositorFrameMetadata LayerTreeHostImpl::makeCompositorFrameMetadata() const |
| 776 { | 787 { |
| 777 CompositorFrameMetadata metadata; | 788 CompositorFrameMetadata metadata; |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 872 const gfx::Size& LayerTreeHostImpl::deviceViewportSize() const | 883 const gfx::Size& LayerTreeHostImpl::deviceViewportSize() const |
| 873 { | 884 { |
| 874 return m_deviceViewportSize; | 885 return m_deviceViewportSize; |
| 875 } | 886 } |
| 876 | 887 |
| 877 const LayerTreeSettings& LayerTreeHostImpl::settings() const | 888 const LayerTreeSettings& LayerTreeHostImpl::settings() const |
| 878 { | 889 { |
| 879 return m_settings; | 890 return m_settings; |
| 880 } | 891 } |
| 881 | 892 |
| 882 void LayerTreeHostImpl::didLoseOutputSurface() | |
| 883 { | |
| 884 m_client->didLoseOutputSurfaceOnImplThread(); | |
| 885 } | |
| 886 | |
| 887 void LayerTreeHostImpl::onSwapBuffersComplete() | |
| 888 { | |
| 889 m_client->onSwapBuffersCompleteOnImplThread(); | |
| 890 } | |
| 891 | |
| 892 void LayerTreeHostImpl::readback(void* pixels, const gfx::Rect& rect) | 893 void LayerTreeHostImpl::readback(void* pixels, const gfx::Rect& rect) |
| 893 { | 894 { |
| 894 DCHECK(m_renderer); | 895 DCHECK(m_renderer); |
| 895 m_renderer->getFramebufferPixels(pixels, rect); | 896 m_renderer->getFramebufferPixels(pixels, rect); |
| 896 } | 897 } |
| 897 | 898 |
| 898 bool LayerTreeHostImpl::haveRootScrollLayer() const { | 899 bool LayerTreeHostImpl::haveRootScrollLayer() const { |
| 899 return rootScrollLayer(); | 900 return rootScrollLayer(); |
| 900 } | 901 } |
| 901 | 902 |
| (...skipping 828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1730 m_tileManager->SetRecordRenderingStats(m_debugState.recordRenderingStats
()); | 1731 m_tileManager->SetRecordRenderingStats(m_debugState.recordRenderingStats
()); |
| 1731 } | 1732 } |
| 1732 | 1733 |
| 1733 void LayerTreeHostImpl::savePaintTime(const base::TimeDelta& totalPaintTime, int
commitNumber) | 1734 void LayerTreeHostImpl::savePaintTime(const base::TimeDelta& totalPaintTime, int
commitNumber) |
| 1734 { | 1735 { |
| 1735 DCHECK(m_debugState.continuousPainting); | 1736 DCHECK(m_debugState.continuousPainting); |
| 1736 m_paintTimeCounter->SavePaintTime(totalPaintTime, commitNumber); | 1737 m_paintTimeCounter->SavePaintTime(totalPaintTime, commitNumber); |
| 1737 } | 1738 } |
| 1738 | 1739 |
| 1739 } // namespace cc | 1740 } // namespace cc |
| OLD | NEW |