Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(189)

Side by Side Diff: components/exo/compositor_frame_sink_holder.cc

Issue 2691453002: [cc] Track observer status in ExternalBeginFrameSource. (Closed)
Patch Set: Call DidFinishFrame even when dropped, update tests. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 } 51 }
52 52
53 //////////////////////////////////////////////////////////////////////////////// 53 ////////////////////////////////////////////////////////////////////////////////
54 // cc::mojom::MojoCompositorFrameSinkClient overrides: 54 // cc::mojom::MojoCompositorFrameSinkClient overrides:
55 55
56 void CompositorFrameSinkHolder::DidReceiveCompositorFrameAck() { 56 void CompositorFrameSinkHolder::DidReceiveCompositorFrameAck() {
57 // TODO(staraz): Implement this 57 // TODO(staraz): Implement this
58 } 58 }
59 59
60 void CompositorFrameSinkHolder::OnBeginFrame(const cc::BeginFrameArgs& args) { 60 void CompositorFrameSinkHolder::OnBeginFrame(const cc::BeginFrameArgs& args) {
61 // TODO(eseckler): Hook up exo::Surface to the ExternalBFS.
reveman 2017/02/21 22:40:05 nit: s/exo::Surface/|surface_|/ and s/ExternalBFS/
Eric Seckler 2017/02/22 09:12:34 Done.
61 if (surface_) 62 if (surface_)
62 surface_->BeginFrame(args.frame_time); 63 surface_->BeginFrame(args.frame_time);
63 64
64 begin_frame_source_->OnBeginFrame(args); 65 begin_frame_source_->OnBeginFrame(args);
65 } 66 }
66 67
67 void CompositorFrameSinkHolder::ReclaimResources( 68 void CompositorFrameSinkHolder::ReclaimResources(
68 const cc::ReturnedResourceArray& resources) { 69 const cc::ReturnedResourceArray& resources) {
69 for (auto& resource : resources) { 70 for (auto& resource : resources) {
70 auto it = release_callbacks_.find(resource.id); 71 auto it = release_callbacks_.find(resource.id);
(...skipping 24 matching lines...) Expand all
95 96
96 void CompositorFrameSinkHolder::OnBeginFrameSourcePausedChanged(bool paused) {} 97 void CompositorFrameSinkHolder::OnBeginFrameSourcePausedChanged(bool paused) {}
97 98
98 //////////////////////////////////////////////////////////////////////////////// 99 ////////////////////////////////////////////////////////////////////////////////
99 // cc::ExternalBeginFrameSouceClient overrides: 100 // cc::ExternalBeginFrameSouceClient overrides:
100 101
101 void CompositorFrameSinkHolder::OnNeedsBeginFrames(bool needs_begin_frames) { 102 void CompositorFrameSinkHolder::OnNeedsBeginFrames(bool needs_begin_frames) {
102 frame_sink_->SetNeedsBeginFrame(needs_begin_frames); 103 frame_sink_->SetNeedsBeginFrame(needs_begin_frames);
103 } 104 }
104 105
106 void CompositorFrameSinkHolder::OnDidFinishFrame(const cc::BeginFrameAck& ack) {
107 // TODO(eseckler): Pass on the ack to frame_sink_.
108 }
109
105 //////////////////////////////////////////////////////////////////////////////// 110 ////////////////////////////////////////////////////////////////////////////////
106 // SurfaceObserver overrides: 111 // SurfaceObserver overrides:
107 112
108 void CompositorFrameSinkHolder::OnSurfaceDestroying(Surface* surface) { 113 void CompositorFrameSinkHolder::OnSurfaceDestroying(Surface* surface) {
109 surface_->RemoveSurfaceObserver(this); 114 surface_->RemoveSurfaceObserver(this);
110 surface_ = nullptr; 115 surface_ = nullptr;
111 } 116 }
112 117
113 //////////////////////////////////////////////////////////////////////////////// 118 ////////////////////////////////////////////////////////////////////////////////
114 // ExoComopositorFrameSink, private: 119 // ExoComopositorFrameSink, private:
115 120
116 CompositorFrameSinkHolder::~CompositorFrameSinkHolder() { 121 CompositorFrameSinkHolder::~CompositorFrameSinkHolder() {
117 if (surface_) 122 if (surface_)
118 surface_->RemoveSurfaceObserver(this); 123 surface_->RemoveSurfaceObserver(this);
119 } 124 }
120 125
121 void CompositorFrameSinkHolder::UpdateNeedsBeginFrame() { 126 void CompositorFrameSinkHolder::UpdateNeedsBeginFrame() {
122 if (!begin_frame_source_) 127 if (!begin_frame_source_)
123 return; 128 return;
124 129
125 bool needs_begin_frame = surface_ && surface_->NeedsBeginFrame(); 130 bool needs_begin_frame = surface_ && surface_->NeedsBeginFrame();
126 if (needs_begin_frame == needs_begin_frame_) 131 if (needs_begin_frame == needs_begin_frame_)
127 return; 132 return;
128 133
129 needs_begin_frame_ = needs_begin_frame; 134 needs_begin_frame_ = needs_begin_frame;
130 OnNeedsBeginFrames(needs_begin_frame_); 135 OnNeedsBeginFrames(needs_begin_frame_);
131 } 136 }
132 137
133 } // namespace exo 138 } // namespace exo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698