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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 for (auto& resource : resources) { | 54 for (auto& resource : resources) { |
55 auto it = release_callbacks_.find(resource.id); | 55 auto it = release_callbacks_.find(resource.id); |
56 DCHECK(it != release_callbacks_.end()); | 56 DCHECK(it != release_callbacks_.end()); |
57 if (it != release_callbacks_.end()) { | 57 if (it != release_callbacks_.end()) { |
58 it->second.Run(resource.sync_token, resource.lost); | 58 it->second.Run(resource.sync_token, resource.lost); |
59 release_callbacks_.erase(it); | 59 release_callbacks_.erase(it); |
60 } | 60 } |
61 } | 61 } |
62 } | 62 } |
63 | 63 |
64 void CompositorFrameSinkHolder::WillDrawSurface( | |
65 const cc::LocalSurfaceId& local_surface_id, | |
66 const gfx::Rect& damage_rect) {} | |
67 | |
68 //////////////////////////////////////////////////////////////////////////////// | 64 //////////////////////////////////////////////////////////////////////////////// |
69 // cc::ExternalBeginFrameSourceClient overrides: | 65 // cc::ExternalBeginFrameSourceClient overrides: |
70 | 66 |
71 void CompositorFrameSinkHolder::OnNeedsBeginFrames(bool needs_begin_frames) { | 67 void CompositorFrameSinkHolder::OnNeedsBeginFrames(bool needs_begin_frames) { |
72 frame_sink_->SetNeedsBeginFrame(needs_begin_frames); | 68 frame_sink_->SetNeedsBeginFrame(needs_begin_frames); |
73 } | 69 } |
74 | 70 |
75 void CompositorFrameSinkHolder::OnDidFinishFrame(const cc::BeginFrameAck& ack) { | 71 void CompositorFrameSinkHolder::OnDidFinishFrame(const cc::BeginFrameAck& ack) { |
76 // If there was damage, the submitted CompositorFrame includes the ack. | 72 // If there was damage, the submitted CompositorFrame includes the ack. |
77 if (!ack.has_damage) | 73 if (!ack.has_damage) |
(...skipping 10 matching lines...) Expand all Loading... |
88 | 84 |
89 //////////////////////////////////////////////////////////////////////////////// | 85 //////////////////////////////////////////////////////////////////////////////// |
90 // ExoComopositorFrameSink, private: | 86 // ExoComopositorFrameSink, private: |
91 | 87 |
92 CompositorFrameSinkHolder::~CompositorFrameSinkHolder() { | 88 CompositorFrameSinkHolder::~CompositorFrameSinkHolder() { |
93 if (surface_) | 89 if (surface_) |
94 surface_->RemoveSurfaceObserver(this); | 90 surface_->RemoveSurfaceObserver(this); |
95 } | 91 } |
96 | 92 |
97 } // namespace exo | 93 } // namespace exo |
OLD | NEW |