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 814 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
825 void DelegatedFrameHost::UnlockResources() { | 825 void DelegatedFrameHost::UnlockResources() { |
826 DCHECK(local_surface_id_.is_valid()); | 826 DCHECK(local_surface_id_.is_valid()); |
827 delegated_frame_evictor_->UnlockFrame(); | 827 delegated_frame_evictor_->UnlockFrame(); |
828 } | 828 } |
829 | 829 |
830 void DelegatedFrameHost::OnNeedsBeginFrames(bool needs_begin_frames) { | 830 void DelegatedFrameHost::OnNeedsBeginFrames(bool needs_begin_frames) { |
831 needs_begin_frame_ = needs_begin_frames; | 831 needs_begin_frame_ = needs_begin_frames; |
832 support_->SetNeedsBeginFrame(needs_begin_frames); | 832 support_->SetNeedsBeginFrame(needs_begin_frames); |
833 } | 833 } |
834 | 834 |
835 void DelegatedFrameHost::OnDidFinishFrame(const cc::BeginFrameAck& ack) {} | 835 void DelegatedFrameHost::OnDidFinishFrame(const cc::BeginFrameAck& ack) { |
| 836 support_->DidFinishFrame(ack); |
| 837 } |
836 | 838 |
837 void DelegatedFrameHost::CreateCompositorFrameSinkSupport() { | 839 void DelegatedFrameHost::CreateCompositorFrameSinkSupport() { |
838 DCHECK(!support_); | 840 DCHECK(!support_); |
839 ImageTransportFactory* factory = ImageTransportFactory::GetInstance(); | 841 ImageTransportFactory* factory = ImageTransportFactory::GetInstance(); |
840 support_ = base::MakeUnique<cc::CompositorFrameSinkSupport>( | 842 support_ = base::MakeUnique<cc::CompositorFrameSinkSupport>( |
841 this, factory->GetContextFactoryPrivate()->GetSurfaceManager(), | 843 this, factory->GetContextFactoryPrivate()->GetSurfaceManager(), |
842 frame_sink_id_, false /* is_root */, | 844 frame_sink_id_, false /* is_root */, |
843 false /* handles_frame_sink_id_invalidation */, | 845 false /* handles_frame_sink_id_invalidation */, |
844 true /* needs_sync_points */); | 846 true /* needs_sync_points */); |
845 if (compositor_) | 847 if (compositor_) |
846 compositor_->AddFrameSink(frame_sink_id_); | 848 compositor_->AddFrameSink(frame_sink_id_); |
847 if (needs_begin_frame_) | 849 if (needs_begin_frame_) |
848 support_->SetNeedsBeginFrame(true); | 850 support_->SetNeedsBeginFrame(true); |
849 } | 851 } |
850 | 852 |
851 void DelegatedFrameHost::ResetCompositorFrameSinkSupport() { | 853 void DelegatedFrameHost::ResetCompositorFrameSinkSupport() { |
852 if (!support_) | 854 if (!support_) |
853 return; | 855 return; |
854 if (compositor_) | 856 if (compositor_) |
855 compositor_->RemoveFrameSink(frame_sink_id_); | 857 compositor_->RemoveFrameSink(frame_sink_id_); |
856 support_.reset(); | 858 support_.reset(); |
857 } | 859 } |
858 | 860 |
859 } // namespace content | 861 } // namespace content |
OLD | NEW |