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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 2965103003: Test
Patch Set: c Created 3 years, 5 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
« no previous file with comments | « cc/resources/shared_bitmap.h ('k') | components/viz/client/client_shared_bitmap_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_impl.cc
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index 707d7a759f40516c7fa507bdf8d0e30970fd3342..443ad4f3addab32ac23c4b51ff7af61d0bf462be 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -1758,6 +1758,22 @@ bool LayerTreeHostImpl::DrawLayers(FrameData* frame) {
}
}
+ std::vector<SharedBitmap*> shared_bitmaps_to_register =
+ resource_provider_->TakeSharedBitmapsToRegister();
+
+ for (SharedBitmap* shared_bitmap : shared_bitmaps_to_register) {
+ base::SharedMemory* shared_memory = shared_bitmap->GetSharedMemory();
+ if (shared_memory && shared_memory->handle().IsValid()) {
+ metadata.shared_bitmaps_to_register.push_back(
+ {shared_bitmap->id(),
+ shared_memory->handle().Duplicate(),
+ shared_memory->mapped_size()});
+ DCHECK(shared_memory->handle().IsValid());
+ shared_memory->Close();
+ DCHECK(!shared_memory->handle().IsValid());
+ }
+ }
+
DCHECK_LE(BeginFrameArgs::kStartingFrameNumber,
frame->begin_frame_ack.sequence_number);
metadata.begin_frame_ack = frame->begin_frame_ack;
@@ -1774,6 +1790,7 @@ bool LayerTreeHostImpl::DrawLayers(FrameData* frame) {
layer_tree_frame_sink_->SetLocalSurfaceId(
active_tree()->local_surface_id());
}
+
layer_tree_frame_sink_->SubmitCompositorFrame(std::move(compositor_frame));
// Clears the list of swap promises after calling DidSwap on each of them to
« no previous file with comments | « cc/resources/shared_bitmap.h ('k') | components/viz/client/client_shared_bitmap_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698