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

Unified Diff: cc/surfaces/display.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/surfaces/display.h ('k') | cc/surfaces/display_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/surfaces/display.cc
diff --git a/cc/surfaces/display.cc b/cc/surfaces/display.cc
index bbcf14a104224670d5145825a832be5347e489f4..a0ffb2ce35fce3f46f4c5674d1de15016926f006 100644
--- a/cc/surfaces/display.cc
+++ b/cc/surfaces/display.cc
@@ -33,6 +33,7 @@ namespace cc {
Display::Display(SharedBitmapManager* bitmap_manager,
gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
const RendererSettings& settings,
+ const FrameSinkId& frame_sink_id,
std::unique_ptr<BeginFrameSource> begin_frame_source,
std::unique_ptr<OutputSurface> output_surface,
std::unique_ptr<DisplayScheduler> scheduler,
@@ -40,12 +41,14 @@ Display::Display(SharedBitmapManager* bitmap_manager,
: bitmap_manager_(bitmap_manager),
gpu_memory_buffer_manager_(gpu_memory_buffer_manager),
settings_(settings),
+ frame_sink_id_(frame_sink_id),
begin_frame_source_(std::move(begin_frame_source)),
output_surface_(std::move(output_surface)),
scheduler_(std::move(scheduler)),
texture_mailbox_deleter_(std::move(texture_mailbox_deleter)) {
DCHECK(output_surface_);
DCHECK_EQ(!scheduler_, !begin_frame_source_);
+ DCHECK(frame_sink_id_.is_valid());
if (scheduler_)
scheduler_->SetClient(this);
}
@@ -69,13 +72,11 @@ Display::~Display() {
}
void Display::Initialize(DisplayClient* client,
- SurfaceManager* surface_manager,
- const FrameSinkId& frame_sink_id) {
+ SurfaceManager* surface_manager) {
DCHECK(client);
DCHECK(surface_manager);
client_ = client;
surface_manager_ = surface_manager;
- frame_sink_id_ = frame_sink_id;
surface_manager_->AddObserver(this);
@@ -101,18 +102,20 @@ void Display::Initialize(DisplayClient* client,
}
}
-void Display::SetSurfaceId(const SurfaceId& id, float device_scale_factor) {
- DCHECK(id.frame_sink_id() == frame_sink_id_);
- if (current_surface_id_ == id && device_scale_factor_ == device_scale_factor)
+void Display::SetLocalFrameId(const LocalFrameId& id,
+ float device_scale_factor) {
+ if (current_surface_id_.local_frame_id() == id &&
+ device_scale_factor_ == device_scale_factor) {
return;
+ }
TRACE_EVENT0("cc", "Display::SetSurfaceId");
- current_surface_id_ = id;
+ current_surface_id_ = SurfaceId(frame_sink_id_, id);
device_scale_factor_ = device_scale_factor;
UpdateRootSurfaceResourcesLocked();
if (scheduler_)
- scheduler_->SetNewRootSurface(id);
+ scheduler_->SetNewRootSurface(current_surface_id_);
}
void Display::SetVisible(bool visible) {
« no previous file with comments | « cc/surfaces/display.h ('k') | cc/surfaces/display_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698