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

Unified Diff: blimp/client/core/compositor/blimp_compositor.cc

Issue 2388753003: Introduce cc::LocalFrameId and use in SurfaceFactory (Closed)
Patch Set: Fix exo_unittests Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: blimp/client/core/compositor/blimp_compositor.cc
diff --git a/blimp/client/core/compositor/blimp_compositor.cc b/blimp/client/core/compositor/blimp_compositor.cc
index 292caf7226510e771b0519e9384a99426e7f5941..e1e094f680fab81eaa40fa1b11035c4a27c1e1e9 100644
--- a/blimp/client/core/compositor/blimp_compositor.cc
+++ b/blimp/client/core/compositor/blimp_compositor.cc
@@ -74,8 +74,7 @@ BlimpCompositor::BlimpCompositor(
weak_ptr_factory_(this) {
DCHECK(thread_checker_.CalledOnValidThread());
- surface_id_allocator_ =
- base::MakeUnique<cc::SurfaceIdAllocator>(frame_sink_id_);
+ surface_id_allocator_ = base::MakeUnique<cc::SurfaceIdAllocator>();
GetEmbedderDeps()->GetSurfaceManager()->RegisterFrameSinkId(frame_sink_id_);
CreateLayerTreeHost();
}
@@ -222,12 +221,12 @@ void BlimpCompositor::SwapCompositorFrame(cc::CompositorFrame frame) {
frame.delegated_frame_data->render_pass_list.back().get();
gfx::Size surface_size = root_pass->output_rect.size();
- if (surface_id_.is_null() || current_surface_size_ != surface_size) {
+ if (local_frame_id_.is_null() || current_surface_size_ != surface_size) {
DestroyDelegatedContent();
DCHECK(layer_->children().empty());
- surface_id_ = surface_id_allocator_->GenerateId();
- surface_factory_->Create(surface_id_);
+ local_frame_id_ = surface_id_allocator_->GenerateId();
+ surface_factory_->Create(local_frame_id_);
current_surface_size_ = surface_size;
// manager must outlive compositors using it.
@@ -236,7 +235,9 @@ void BlimpCompositor::SwapCompositorFrame(cc::CompositorFrame frame) {
scoped_refptr<cc::SurfaceLayer> content_layer = cc::SurfaceLayer::Create(
base::Bind(&SatisfyCallback, base::Unretained(surface_manager)),
base::Bind(&RequireCallback, base::Unretained(surface_manager)));
- content_layer->SetSurfaceId(surface_id_, 1.f, surface_size);
+ content_layer->SetSurfaceId(
+ cc::SurfaceId(surface_factory_->frame_sink_id(), local_frame_id_), 1.f,
+ surface_size);
content_layer->SetBounds(current_surface_size_);
content_layer->SetIsDrawable(true);
content_layer->SetContentsOpaque(true);
@@ -244,7 +245,7 @@ void BlimpCompositor::SwapCompositorFrame(cc::CompositorFrame frame) {
layer_->AddChild(content_layer);
}
- surface_factory_->SubmitCompositorFrame(surface_id_, std::move(frame),
+ surface_factory_->SubmitCompositorFrame(local_frame_id_, std::move(frame),
base::Closure());
}
@@ -272,13 +273,14 @@ CompositorDependencies* BlimpCompositor::GetEmbedderDeps() {
}
void BlimpCompositor::DestroyDelegatedContent() {
- if (surface_id_.is_null())
+ if (local_frame_id_.is_null())
return;
- // Remove any references for the surface layer that uses this |surface_id_|.
+ // Remove any references for the surface layer that uses this
+ // |local_frame_id_|.
layer_->RemoveAllChildren();
- surface_factory_->Destroy(surface_id_);
- surface_id_ = cc::SurfaceId();
+ surface_factory_->Destroy(local_frame_id_);
+ local_frame_id_ = cc::LocalFrameId();
}
void BlimpCompositor::CreateLayerTreeHost() {

Powered by Google App Engine
This is Rietveld 408576698