| Index: cc/surfaces/direct_compositor_frame_sink.cc
|
| diff --git a/cc/surfaces/direct_compositor_frame_sink.cc b/cc/surfaces/direct_compositor_frame_sink.cc
|
| index 7ddddceaa8d68cddcf0cb68d0bbe1be5e4f20296..fe40b4d66f030fc3884ca10813e055e834084d96 100644
|
| --- a/cc/surfaces/direct_compositor_frame_sink.cc
|
| +++ b/cc/surfaces/direct_compositor_frame_sink.cc
|
| @@ -25,7 +25,6 @@ DirectCompositorFrameSink::DirectCompositorFrameSink(
|
| std::move(worker_context_provider)),
|
| frame_sink_id_(frame_sink_id),
|
| surface_manager_(surface_manager),
|
| - surface_id_allocator_(frame_sink_id),
|
| display_(display),
|
| factory_(frame_sink_id, surface_manager, this) {
|
| DCHECK(thread_checker_.CalledOnValidThread());
|
| @@ -44,7 +43,6 @@ DirectCompositorFrameSink::DirectCompositorFrameSink(
|
| : CompositorFrameSink(std::move(vulkan_context_provider)),
|
| frame_sink_id_(frame_sink_id),
|
| surface_manager_(surface_manager),
|
| - surface_id_allocator_(frame_sink_id_),
|
| display_(display),
|
| factory_(frame_sink_id_, surface_manager, this) {
|
| DCHECK(thread_checker_.CalledOnValidThread());
|
| @@ -83,8 +81,8 @@ void DirectCompositorFrameSink::DetachFromClient() {
|
| // Unregister the SurfaceFactoryClient here instead of the dtor so that only
|
| // one client is alive for this namespace at any given time.
|
| surface_manager_->UnregisterSurfaceFactoryClient(frame_sink_id_);
|
| - if (!delegated_surface_id_.is_null())
|
| - factory_.Destroy(delegated_surface_id_);
|
| + if (!delegated_local_frame_id_.is_null())
|
| + factory_.Destroy(delegated_local_frame_id_);
|
|
|
| CompositorFrameSink::DetachFromClient();
|
| }
|
| @@ -93,25 +91,25 @@ void DirectCompositorFrameSink::SwapBuffers(CompositorFrame frame) {
|
| gfx::Size frame_size =
|
| frame.delegated_frame_data->render_pass_list.back()->output_rect.size();
|
| if (frame_size.IsEmpty() || frame_size != last_swap_frame_size_) {
|
| - if (!delegated_surface_id_.is_null()) {
|
| - factory_.Destroy(delegated_surface_id_);
|
| + if (!delegated_local_frame_id_.is_null()) {
|
| + factory_.Destroy(delegated_local_frame_id_);
|
| }
|
| - delegated_surface_id_ = surface_id_allocator_.GenerateId();
|
| - factory_.Create(delegated_surface_id_);
|
| + delegated_local_frame_id_ = surface_id_allocator_.GenerateId();
|
| + factory_.Create(delegated_local_frame_id_);
|
| last_swap_frame_size_ = frame_size;
|
| }
|
| - display_->SetSurfaceId(delegated_surface_id_,
|
| + display_->SetSurfaceId(SurfaceId(frame_sink_id_, delegated_local_frame_id_),
|
| frame.metadata.device_scale_factor);
|
|
|
| factory_.SubmitCompositorFrame(
|
| - delegated_surface_id_, std::move(frame),
|
| + delegated_local_frame_id_, std::move(frame),
|
| base::Bind(&DirectCompositorFrameSink::DidDrawCallback,
|
| base::Unretained(this)));
|
| }
|
|
|
| void DirectCompositorFrameSink::ForceReclaimResources() {
|
| - if (!delegated_surface_id_.is_null()) {
|
| - factory_.SubmitCompositorFrame(delegated_surface_id_, CompositorFrame(),
|
| + if (!delegated_local_frame_id_.is_null()) {
|
| + factory_.SubmitCompositorFrame(delegated_local_frame_id_, CompositorFrame(),
|
| SurfaceFactory::DrawCallback());
|
| }
|
| }
|
|
|