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

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

Issue 2755573002: Add FrameGenerator Unit Tests (Closed)
Patch Set: Clean up Created 3 years, 9 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
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 <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "cc/output/compositor_frame.h" 10 #include "cc/output/compositor_frame.h"
(...skipping 21 matching lines...) Expand all
32 } 32 }
33 33
34 FrameGenerator::~FrameGenerator() { 34 FrameGenerator::~FrameGenerator() {
35 compositor_frame_sink_->DetachFromClient(); 35 compositor_frame_sink_->DetachFromClient();
36 } 36 }
37 37
38 void FrameGenerator::SetDeviceScaleFactor(float device_scale_factor) { 38 void FrameGenerator::SetDeviceScaleFactor(float device_scale_factor) {
39 if (device_scale_factor_ == device_scale_factor) 39 if (device_scale_factor_ == device_scale_factor)
40 return; 40 return;
41 device_scale_factor_ = device_scale_factor; 41 device_scale_factor_ = device_scale_factor;
42 if (window_manager_surface_info_.is_valid()) 42 if (window_manager_surface_info_.is_valid()) {
Fady Samuel 2017/03/15 17:47:00 nit: this change is unnecessary.
Alex Z. 2017/03/15 20:37:12 Done.
43 SetNeedsBeginFrame(true); 43 SetNeedsBeginFrame(true);
44 }
44 } 45 }
45 46
46 void FrameGenerator::OnSurfaceCreated(const cc::SurfaceInfo& surface_info) { 47 void FrameGenerator::OnSurfaceCreated(const cc::SurfaceInfo& surface_info) {
47 DCHECK(surface_info.is_valid()); 48 DCHECK(surface_info.is_valid());
48 49
49 // Only handle embedded surfaces changing here. The display root surface 50 // Only handle embedded surfaces changing here. The display root surface
50 // changing is handled immediately after the CompositorFrame is submitted. 51 // changing is handled immediately after the CompositorFrame is submitted.
51 if (surface_info != window_manager_surface_info_) { 52 if (surface_info != window_manager_surface_info_) {
52 window_manager_surface_info_ = surface_info; 53 window_manager_surface_info_ = surface_info;
53 SetNeedsBeginFrame(true); 54 SetNeedsBeginFrame(true);
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 return; 193 return;
193 } 194 }
194 195
195 begin_frame_source_->RemoveObserver(this); 196 begin_frame_source_->RemoveObserver(this);
196 observing_begin_frames_ = false; 197 observing_begin_frames_ = false;
197 } 198 }
198 199
199 } // namespace ws 200 } // namespace ws
200 201
201 } // namespace ui 202 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698