OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/browser/renderer_host/delegated_frame_host.h" | 5 #include "content/browser/renderer_host/delegated_frame_host.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
824 void DelegatedFrameHost::UnlockResources() { | 824 void DelegatedFrameHost::UnlockResources() { |
825 DCHECK(local_surface_id_.is_valid()); | 825 DCHECK(local_surface_id_.is_valid()); |
826 delegated_frame_evictor_->UnlockFrame(); | 826 delegated_frame_evictor_->UnlockFrame(); |
827 } | 827 } |
828 | 828 |
829 void DelegatedFrameHost::OnNeedsBeginFrames(bool needs_begin_frames) { | 829 void DelegatedFrameHost::OnNeedsBeginFrames(bool needs_begin_frames) { |
830 needs_begin_frame_ = needs_begin_frames; | 830 needs_begin_frame_ = needs_begin_frames; |
831 support_->SetNeedsBeginFrame(needs_begin_frames); | 831 support_->SetNeedsBeginFrame(needs_begin_frames); |
832 } | 832 } |
833 | 833 |
834 void DelegatedFrameHost::OnDidFinishFrame(const cc::BeginFrameAck& ack) {} | 834 void DelegatedFrameHost::OnDidFinishFrame(const cc::BeginFrameAck& ack) { |
| 835 support_->DidFinishFrame(ack); |
| 836 } |
835 | 837 |
836 void DelegatedFrameHost::CreateCompositorFrameSinkSupport() { | 838 void DelegatedFrameHost::CreateCompositorFrameSinkSupport() { |
837 DCHECK(!support_); | 839 DCHECK(!support_); |
838 ImageTransportFactory* factory = ImageTransportFactory::GetInstance(); | 840 ImageTransportFactory* factory = ImageTransportFactory::GetInstance(); |
839 support_ = base::MakeUnique<cc::CompositorFrameSinkSupport>( | 841 support_ = base::MakeUnique<cc::CompositorFrameSinkSupport>( |
840 this, factory->GetContextFactoryPrivate()->GetSurfaceManager(), | 842 this, factory->GetContextFactoryPrivate()->GetSurfaceManager(), |
841 frame_sink_id_, false /* is_root */, | 843 frame_sink_id_, false /* is_root */, |
842 false /* handles_frame_sink_id_invalidation */, | 844 false /* handles_frame_sink_id_invalidation */, |
843 true /* needs_sync_points */); | 845 true /* needs_sync_points */); |
844 if (compositor_) | 846 if (compositor_) |
845 compositor_->AddFrameSink(frame_sink_id_); | 847 compositor_->AddFrameSink(frame_sink_id_); |
846 if (needs_begin_frame_) | 848 if (needs_begin_frame_) |
847 support_->SetNeedsBeginFrame(true); | 849 support_->SetNeedsBeginFrame(true); |
848 } | 850 } |
849 | 851 |
850 void DelegatedFrameHost::ResetCompositorFrameSinkSupport() { | 852 void DelegatedFrameHost::ResetCompositorFrameSinkSupport() { |
851 if (!support_) | 853 if (!support_) |
852 return; | 854 return; |
853 if (compositor_) | 855 if (compositor_) |
854 compositor_->RemoveFrameSink(frame_sink_id_); | 856 compositor_->RemoveFrameSink(frame_sink_id_); |
855 support_.reset(); | 857 support_.reset(); |
856 } | 858 } |
857 | 859 |
858 } // namespace content | 860 } // namespace content |
OLD | NEW |