| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "components/exo/compositor_frame_sink_holder.h" | 5 #include "components/exo/compositor_frame_sink_holder.h" |
| 6 | 6 |
| 7 #include "cc/resources/returned_resource.h" | 7 #include "cc/resources/returned_resource.h" |
| 8 #include "components/exo/surface.h" | 8 #include "components/exo/surface.h" |
| 9 | 9 |
| 10 namespace exo { | 10 namespace exo { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 void CompositorFrameSinkHolder::SetResourceReleaseCallback( | 33 void CompositorFrameSinkHolder::SetResourceReleaseCallback( |
| 34 cc::ResourceId id, | 34 cc::ResourceId id, |
| 35 const cc::ReleaseCallback& callback) { | 35 const cc::ReleaseCallback& callback) { |
| 36 DCHECK(!callback.is_null()); | 36 DCHECK(!callback.is_null()); |
| 37 release_callbacks_[id] = callback; | 37 release_callbacks_[id] = callback; |
| 38 } | 38 } |
| 39 | 39 |
| 40 //////////////////////////////////////////////////////////////////////////////// | 40 //////////////////////////////////////////////////////////////////////////////// |
| 41 // cc::mojom::MojoCompositorFrameSinkClient overrides: | 41 // cc::mojom::MojoCompositorFrameSinkClient overrides: |
| 42 | 42 |
| 43 void CompositorFrameSinkHolder::DidReceiveCompositorFrameAck() { | 43 void CompositorFrameSinkHolder::DidReceiveCompositorFrameAck( |
| 44 const cc::ReturnedResourceArray& resources) { |
| 45 ReclaimResources(resources); |
| 44 if (surface_) | 46 if (surface_) |
| 45 surface_->DidReceiveCompositorFrameAck(); | 47 surface_->DidReceiveCompositorFrameAck(); |
| 46 } | 48 } |
| 47 | 49 |
| 48 void CompositorFrameSinkHolder::OnBeginFrame(const cc::BeginFrameArgs& args) { | 50 void CompositorFrameSinkHolder::OnBeginFrame(const cc::BeginFrameArgs& args) { |
| 49 begin_frame_source_->OnBeginFrame(args); | 51 begin_frame_source_->OnBeginFrame(args); |
| 50 } | 52 } |
| 51 | 53 |
| 52 void CompositorFrameSinkHolder::ReclaimResources( | 54 void CompositorFrameSinkHolder::ReclaimResources( |
| 53 const cc::ReturnedResourceArray& resources) { | 55 const cc::ReturnedResourceArray& resources) { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 84 | 86 |
| 85 //////////////////////////////////////////////////////////////////////////////// | 87 //////////////////////////////////////////////////////////////////////////////// |
| 86 // ExoComopositorFrameSink, private: | 88 // ExoComopositorFrameSink, private: |
| 87 | 89 |
| 88 CompositorFrameSinkHolder::~CompositorFrameSinkHolder() { | 90 CompositorFrameSinkHolder::~CompositorFrameSinkHolder() { |
| 89 if (surface_) | 91 if (surface_) |
| 90 surface_->RemoveSurfaceObserver(this); | 92 surface_->RemoveSurfaceObserver(this); |
| 91 } | 93 } |
| 92 | 94 |
| 93 } // namespace exo | 95 } // namespace exo |
| OLD | NEW |