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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 } | 68 } |
69 | 69 |
70 //////////////////////////////////////////////////////////////////////////////// | 70 //////////////////////////////////////////////////////////////////////////////// |
71 // cc::ExternalBeginFrameSourceClient overrides: | 71 // cc::ExternalBeginFrameSourceClient overrides: |
72 | 72 |
73 void CompositorFrameSinkHolder::OnNeedsBeginFrames(bool needs_begin_frames) { | 73 void CompositorFrameSinkHolder::OnNeedsBeginFrames(bool needs_begin_frames) { |
74 frame_sink_->SetNeedsBeginFrame(needs_begin_frames); | 74 frame_sink_->SetNeedsBeginFrame(needs_begin_frames); |
75 } | 75 } |
76 | 76 |
77 void CompositorFrameSinkHolder::OnDidFinishFrame(const cc::BeginFrameAck& ack) { | 77 void CompositorFrameSinkHolder::OnDidFinishFrame(const cc::BeginFrameAck& ack) { |
78 // TODO(eseckler): Pass on the ack to frame_sink_. | 78 // If there was damage, the submitted CompositorFrame includes the ack. |
| 79 if (!ack.has_damage) |
| 80 frame_sink_->BeginFrameDidNotSwap(ack); |
79 } | 81 } |
80 | 82 |
81 //////////////////////////////////////////////////////////////////////////////// | 83 //////////////////////////////////////////////////////////////////////////////// |
82 // SurfaceObserver overrides: | 84 // SurfaceObserver overrides: |
83 | 85 |
84 void CompositorFrameSinkHolder::OnSurfaceDestroying(Surface* surface) { | 86 void CompositorFrameSinkHolder::OnSurfaceDestroying(Surface* surface) { |
85 surface_->RemoveSurfaceObserver(this); | 87 surface_->RemoveSurfaceObserver(this); |
86 surface_ = nullptr; | 88 surface_ = nullptr; |
87 } | 89 } |
88 | 90 |
89 //////////////////////////////////////////////////////////////////////////////// | 91 //////////////////////////////////////////////////////////////////////////////// |
90 // ExoComopositorFrameSink, private: | 92 // ExoComopositorFrameSink, private: |
91 | 93 |
92 CompositorFrameSinkHolder::~CompositorFrameSinkHolder() { | 94 CompositorFrameSinkHolder::~CompositorFrameSinkHolder() { |
93 if (surface_) | 95 if (surface_) |
94 surface_->RemoveSurfaceObserver(this); | 96 surface_->RemoveSurfaceObserver(this); |
95 } | 97 } |
96 | 98 |
97 } // namespace exo | 99 } // namespace exo |
OLD | NEW |