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

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

Issue 2527443002: Display Compositor: Allocate LocalFrameId in client. (Closed)
Patch Set: Addressed sadrul's comment 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
Index: services/ui/ws/gpu_compositor_frame_sink.cc
diff --git a/services/ui/ws/gpu_compositor_frame_sink.cc b/services/ui/ws/gpu_compositor_frame_sink.cc
index f6357580e4433d05e95ec8f9d04083f6a462aeec..74d87303249ce55656c19fbaed5ac208a74e02c7 100644
--- a/services/ui/ws/gpu_compositor_frame_sink.cc
+++ b/services/ui/ws/gpu_compositor_frame_sink.cc
@@ -65,17 +65,22 @@ 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_) {
+ gfx::Size frame_size;
+ if (!frame.render_pass_list.empty())
+ frame_size = frame.render_pass_list[0]->output_rect.size();
display_->Resize(frame_size);
sadrul 2016/11/22 19:53:29 Do this Resize only if |frame_size| is non-empty?
Fady Samuel 2016/11/22 20:17:26 Done.
+ }
}
++ack_pending_count_;
surface_factory_.SubmitCompositorFrame(
@@ -86,7 +91,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() {

Powered by Google App Engine
This is Rietveld 408576698