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

Unified Diff: services/ui/surfaces/gpu_compositor_frame_sink.cc

Issue 2527443002: Display Compositor: Allocate LocalFrameId in client. (Closed)
Patch Set: Rebased + Restored BUILD files 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 | « services/ui/surfaces/gpu_compositor_frame_sink.h ('k') | services/ui/ws/frame_generator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/surfaces/gpu_compositor_frame_sink.cc
diff --git a/services/ui/surfaces/gpu_compositor_frame_sink.cc b/services/ui/surfaces/gpu_compositor_frame_sink.cc
index 3126f6e70c97b19136a1e3993525b135e7e7c5d2..eaea6249a5c76eddce8d266402eb03ca95814cfc 100644
--- a/services/ui/surfaces/gpu_compositor_frame_sink.cc
+++ b/services/ui/surfaces/gpu_compositor_frame_sink.cc
@@ -73,17 +73,20 @@ void GpuCompositorFrameSink::SetNeedsBeginFrame(bool needs_begin_frame) {
UpdateNeedsBeginFramesInternal();
}
-void GpuCompositorFrameSink::SubmitCompositorFrame(cc::CompositorFrame frame) {
- gfx::Size frame_size = frame.render_pass_list[0]->output_rect.size();
+void GpuCompositorFrameSink::SubmitCompositorFrame(
+ const cc::LocalFrameId& local_frame_id,
+ cc::CompositorFrame frame) {
// If the size of the CompostiorFrame has changed then destroy the existing
// Surface and create a new one of the appropriate size.
- if (!local_frame_id_.is_valid() || frame_size != last_submitted_frame_size_) {
+ if (local_frame_id_ != local_frame_id) {
if (local_frame_id_.is_valid())
surface_factory_.Destroy(local_frame_id_);
- local_frame_id_ = surface_id_allocator_.GenerateId();
+ local_frame_id_ = local_frame_id;
surface_factory_.Create(local_frame_id_);
- if (display_)
+ if (display_ && !frame.render_pass_list.empty()) {
+ gfx::Size frame_size = frame.render_pass_list[0]->output_rect.size();
display_->Resize(frame_size);
+ }
}
++ack_pending_count_;
surface_factory_.SubmitCompositorFrame(
@@ -94,7 +97,6 @@ void GpuCompositorFrameSink::SubmitCompositorFrame(cc::CompositorFrame frame) {
display_->SetLocalFrameId(local_frame_id_,
frame.metadata.device_scale_factor);
}
- last_submitted_frame_size_ = frame_size;
}
void GpuCompositorFrameSink::DidReceiveCompositorFrameAck() {
« no previous file with comments | « services/ui/surfaces/gpu_compositor_frame_sink.h ('k') | services/ui/ws/frame_generator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698