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

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

Issue 2246593002: Have Display root ServerWindow origin be (0, 0) for all displays. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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/ws/display.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/frame_generator.h" 5 #include "services/ui/ws/frame_generator.h"
6 6
7 #include "base/containers/adapters.h" 7 #include "base/containers/adapters.h"
8 #include "cc/output/compositor_frame.h" 8 #include "cc/output/compositor_frame.h"
9 #include "cc/quads/render_pass.h" 9 #include "cc/quads/render_pass.h"
10 #include "cc/quads/render_pass_draw_quad.h" 10 #include "cc/quads/render_pass_draw_quad.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 draw_timer_.Start( 63 draw_timer_.Start(
64 FROM_HERE, base::TimeDelta(), 64 FROM_HERE, base::TimeDelta(),
65 base::Bind(&FrameGenerator::Draw, weak_factory_.GetWeakPtr())); 65 base::Bind(&FrameGenerator::Draw, weak_factory_.GetWeakPtr()));
66 } 66 }
67 67
68 void FrameGenerator::Draw() { 68 void FrameGenerator::Draw() {
69 if (!delegate_->GetRootWindow()->visible()) 69 if (!delegate_->GetRootWindow()->visible())
70 return; 70 return;
71 71
72 const ViewportMetrics& metrics = delegate_->GetViewportMetrics(); 72 const ViewportMetrics& metrics = delegate_->GetViewportMetrics();
73 const gfx::Rect& output_rect = metrics.bounds; 73 const gfx::Rect& output_rect(metrics.bounds.size());
sky 2016/08/17 18:57:54 remove the & here.
kylechar 2016/08/17 19:10:01 Oh wow, should not have missed that one. Done.
74 dirty_rect_.Intersect(output_rect); 74 dirty_rect_.Intersect(output_rect);
75 // TODO(fsamuel): We should add a trace for generating a top level frame. 75 // TODO(fsamuel): We should add a trace for generating a top level frame.
76 cc::CompositorFrame frame(GenerateCompositorFrame(output_rect)); 76 cc::CompositorFrame frame(GenerateCompositorFrame(output_rect));
77 if (frame.metadata.may_contain_video != may_contain_video_) { 77 if (frame.metadata.may_contain_video != may_contain_video_) {
78 may_contain_video_ = frame.metadata.may_contain_video; 78 may_contain_video_ = frame.metadata.may_contain_video;
79 // TODO(sad): Schedule notifying observers. 79 // TODO(sad): Schedule notifying observers.
80 if (may_contain_video_) { 80 if (may_contain_video_) {
81 // TODO(sad): Start a timer to reset the bit if no new frame with video 81 // TODO(sad): Start a timer to reset the bit if no new frame with video
82 // is submitted 'soon'. 82 // is submitted 'soon'.
83 } 83 }
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 gfx::Rect() /* opaque_rect */, 212 gfx::Rect() /* opaque_rect */,
213 bounds_at_origin /* visible_rect */, true /* needs_blending*/, 213 bounds_at_origin /* visible_rect */, true /* needs_blending*/,
214 underlay_surface->id()); 214 underlay_surface->id());
215 DCHECK(!underlay_surface->may_contain_video()); 215 DCHECK(!underlay_surface->may_contain_video());
216 } 216 }
217 } 217 }
218 218
219 } // namespace ws 219 } // namespace ws
220 220
221 } // namespace ui 221 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/ws/display.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698