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

Side by Side Diff: content/renderer/android/synchronous_compositor_frame_sink.cc

Issue 2468633002: Replaced cc::Display::SetSurfaceId() with SetLocalFrameId() (Closed)
Patch Set: rebase and minor bug fixes Created 4 years, 1 month 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "content/renderer/android/synchronous_compositor_frame_sink.h" 5 #include "content/renderer/android/synchronous_compositor_frame_sink.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 base::MakeUnique<SoftwareDevice>(&current_sw_canvas_)); 177 base::MakeUnique<SoftwareDevice>(&current_sw_canvas_));
178 software_output_surface_ = output_surface.get(); 178 software_output_surface_ = output_surface.get();
179 179
180 // The shared_bitmap_manager and gpu_memory_buffer_manager here are null as 180 // The shared_bitmap_manager and gpu_memory_buffer_manager here are null as
181 // this Display is only used for resourcesless software draws, where no 181 // this Display is only used for resourcesless software draws, where no
182 // resources are included in the frame swapped from the compositor. So there 182 // resources are included in the frame swapped from the compositor. So there
183 // is no need for these. 183 // is no need for these.
184 display_.reset(new cc::Display( 184 display_.reset(new cc::Display(
185 nullptr /* shared_bitmap_manager */, 185 nullptr /* shared_bitmap_manager */,
186 nullptr /* gpu_memory_buffer_manager */, software_renderer_settings, 186 nullptr /* gpu_memory_buffer_manager */, software_renderer_settings,
187 nullptr /* begin_frame_source */, std::move(output_surface), 187 kFrameSinkId, nullptr /* begin_frame_source */, std::move(output_surface),
188 nullptr /* scheduler */, nullptr /* texture_mailbox_deleter */)); 188 nullptr /* scheduler */, nullptr /* texture_mailbox_deleter */));
189 display_->Initialize(&display_client_, surface_manager_.get(), kFrameSinkId); 189 display_->Initialize(&display_client_, surface_manager_.get());
190 display_->SetVisible(true); 190 display_->SetVisible(true);
191 return true; 191 return true;
192 } 192 }
193 193
194 void SynchronousCompositorFrameSink::DetachFromClient() { 194 void SynchronousCompositorFrameSink::DetachFromClient() {
195 DCHECK(CalledOnValidThread()); 195 DCHECK(CalledOnValidThread());
196 client_->SetBeginFrameSource(nullptr); 196 client_->SetBeginFrameSource(nullptr);
197 // Destroy the begin frame source on the same thread it was bound on. 197 // Destroy the begin frame source on the same thread it was bound on.
198 begin_frame_source_ = nullptr; 198 begin_frame_source_ = nullptr;
199 registry_->UnregisterCompositorFrameSink(routing_id_, this); 199 registry_->UnregisterCompositorFrameSink(routing_id_, this);
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 // the |frame| for the software path below. 235 // the |frame| for the software path below.
236 submit_frame.metadata = frame.metadata.Clone(); 236 submit_frame.metadata = frame.metadata.Clone();
237 237
238 if (!root_local_frame_id_.is_valid()) { 238 if (!root_local_frame_id_.is_valid()) {
239 root_local_frame_id_ = surface_id_allocator_->GenerateId(); 239 root_local_frame_id_ = surface_id_allocator_->GenerateId();
240 surface_factory_->Create(root_local_frame_id_); 240 surface_factory_->Create(root_local_frame_id_);
241 child_local_frame_id_ = surface_id_allocator_->GenerateId(); 241 child_local_frame_id_ = surface_id_allocator_->GenerateId();
242 surface_factory_->Create(child_local_frame_id_); 242 surface_factory_->Create(child_local_frame_id_);
243 } 243 }
244 244
245 display_->SetSurfaceId(cc::SurfaceId(kFrameSinkId, root_local_frame_id_), 245 display_->SetLocalFrameId(root_local_frame_id_,
246 frame.metadata.device_scale_factor); 246 frame.metadata.device_scale_factor);
247 247
248 // The layer compositor should be giving a frame that covers the 248 // The layer compositor should be giving a frame that covers the
249 // |sw_viewport_for_current_draw_| but at 0,0. 249 // |sw_viewport_for_current_draw_| but at 0,0.
250 gfx::Size child_size = sw_viewport_for_current_draw_.size(); 250 gfx::Size child_size = sw_viewport_for_current_draw_.size();
251 DCHECK(gfx::Rect(child_size) == frame.render_pass_list.back()->output_rect); 251 DCHECK(gfx::Rect(child_size) == frame.render_pass_list.back()->output_rect);
252 252
253 // Make a size that covers from 0,0 and includes the area coming from the 253 // Make a size that covers from 0,0 and includes the area coming from the
254 // layer compositor. 254 // layer compositor.
255 gfx::Size display_size(sw_viewport_for_current_draw_.right(), 255 gfx::Size display_size(sw_viewport_for_current_draw_.right(),
256 sw_viewport_for_current_draw_.bottom()); 256 sw_viewport_for_current_draw_.bottom());
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 client_->ReclaimResources(resources); 462 client_->ReclaimResources(resources);
463 } 463 }
464 464
465 void SynchronousCompositorFrameSink::SetBeginFrameSource( 465 void SynchronousCompositorFrameSink::SetBeginFrameSource(
466 cc::BeginFrameSource* begin_frame_source) { 466 cc::BeginFrameSource* begin_frame_source) {
467 // Software output is synchronous and doesn't use a BeginFrameSource. 467 // Software output is synchronous and doesn't use a BeginFrameSource.
468 NOTREACHED(); 468 NOTREACHED();
469 } 469 }
470 470
471 } // namespace content 471 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/compositor_impl_android.cc ('k') | services/ui/ws/server_window_compositor_frame_sink.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698