| Index: services/ui/public/cpp/client_compositor_frame_sink.cc
|
| diff --git a/services/ui/public/cpp/client_compositor_frame_sink.cc b/services/ui/public/cpp/client_compositor_frame_sink.cc
|
| index ef014e05ae77d58a8dbc11cf528072e859106aa0..830321a6d4aff4afee6cef97dc8395203032c3d5 100644
|
| --- a/services/ui/public/cpp/client_compositor_frame_sink.cc
|
| +++ b/services/ui/public/cpp/client_compositor_frame_sink.cc
|
| @@ -38,6 +38,12 @@ std::unique_ptr<ClientCompositorFrameSink> ClientCompositorFrameSink::Create(
|
|
|
| ClientCompositorFrameSink::~ClientCompositorFrameSink() {}
|
|
|
| +void ClientCompositorFrameSink::SetSurfaceChangedCallback(
|
| + const SurfaceChangedCallback& callback) {
|
| + DCHECK(!surface_changed_callback_);
|
| + surface_changed_callback_ = callback;
|
| +}
|
| +
|
| bool ClientCompositorFrameSink::BindToClient(
|
| cc::CompositorFrameSinkClient* client) {
|
| if (!cc::CompositorFrameSink::BindToClient(client))
|
| @@ -81,15 +87,21 @@ void ClientCompositorFrameSink::SubmitCompositorFrame(
|
| DCHECK_LE(cc::BeginFrameArgs::kStartingFrameNumber,
|
| frame.metadata.begin_frame_ack.sequence_number);
|
|
|
| + bool surface_changed = false;
|
| gfx::Size frame_size = frame.render_pass_list.back()->output_rect.size();
|
| if (!enable_surface_synchronization_ &&
|
| (!local_surface_id_.is_valid() ||
|
| frame_size != last_submitted_frame_size_)) {
|
| local_surface_id_ = id_allocator_.GenerateId();
|
| + last_submitted_frame_size_ = frame_size;
|
| + surface_changed = true;
|
| }
|
| compositor_frame_sink_->SubmitCompositorFrame(local_surface_id_,
|
| std::move(frame));
|
| - last_submitted_frame_size_ = frame_size;
|
| + if (surface_changed && surface_changed_callback_) {
|
| + surface_changed_callback_.Run(
|
| + cc::SurfaceId(frame_sink_id_, local_surface_id_), frame_size);
|
| + }
|
| }
|
|
|
| ClientCompositorFrameSink::ClientCompositorFrameSink(
|
|
|