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

Side by Side Diff: services/ui/ws/display_client_compositor_frame_sink.cc

Issue 2855723002: Don't submit frames with no render passes in cc tests (Closed)
Patch Set: c Created 3 years, 7 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 unified diff | Download patch
« no previous file with comments | « services/ui/public/cpp/client_compositor_frame_sink.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "services/ui/ws/display_client_compositor_frame_sink.h" 5 #include "services/ui/ws/display_client_compositor_frame_sink.h"
6 6
7 #include "base/threading/thread_checker.h" 7 #include "base/threading/thread_checker.h"
8 #include "cc/output/compositor_frame_sink_client.h" 8 #include "cc/output/compositor_frame_sink_client.h"
9 9
10 namespace ui { 10 namespace ui {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 44
45 void DisplayClientCompositorFrameSink::SubmitCompositorFrame( 45 void DisplayClientCompositorFrameSink::SubmitCompositorFrame(
46 cc::CompositorFrame frame) { 46 cc::CompositorFrame frame) {
47 DCHECK(thread_checker_->CalledOnValidThread()); 47 DCHECK(thread_checker_->CalledOnValidThread());
48 if (!compositor_frame_sink_) 48 if (!compositor_frame_sink_)
49 return; 49 return;
50 50
51 DCHECK_LE(cc::BeginFrameArgs::kStartingFrameNumber, 51 DCHECK_LE(cc::BeginFrameArgs::kStartingFrameNumber,
52 frame.metadata.begin_frame_ack.sequence_number); 52 frame.metadata.begin_frame_ack.sequence_number);
53 53
54 gfx::Size frame_size = last_submitted_frame_size_; 54 gfx::Size frame_size = frame.render_pass_list.back()->output_rect.size();
55 if (!frame.render_pass_list.empty())
56 frame_size = frame.render_pass_list.back()->output_rect.size();
57 55
58 if (!local_surface_id_.is_valid() || 56 if (!local_surface_id_.is_valid() ||
59 frame_size != last_submitted_frame_size_) { 57 frame_size != last_submitted_frame_size_) {
60 local_surface_id_ = id_allocator_.GenerateId(); 58 local_surface_id_ = id_allocator_.GenerateId();
61 display_private_->ResizeDisplay(frame_size); 59 display_private_->ResizeDisplay(frame_size);
62 } 60 }
63 display_private_->SetLocalSurfaceId(local_surface_id_, 61 display_private_->SetLocalSurfaceId(local_surface_id_,
64 frame.metadata.device_scale_factor); 62 frame.metadata.device_scale_factor);
65 compositor_frame_sink_->SubmitCompositorFrame(local_surface_id_, 63 compositor_frame_sink_->SubmitCompositorFrame(local_surface_id_,
66 std::move(frame)); 64 std::move(frame));
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 96
99 void DisplayClientCompositorFrameSink::OnDidFinishFrame( 97 void DisplayClientCompositorFrameSink::OnDidFinishFrame(
100 const cc::BeginFrameAck& ack) { 98 const cc::BeginFrameAck& ack) {
101 // If there was damage, the submitted CompositorFrame includes the ack. 99 // If there was damage, the submitted CompositorFrame includes the ack.
102 if (!ack.has_damage) 100 if (!ack.has_damage)
103 compositor_frame_sink_->BeginFrameDidNotSwap(ack); 101 compositor_frame_sink_->BeginFrameDidNotSwap(ack);
104 } 102 }
105 103
106 } // namespace ws 104 } // namespace ws
107 } // namespace ui 105 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/public/cpp/client_compositor_frame_sink.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698