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

Side by Side Diff: services/ui/ws/display.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: Fixes. 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 | « no previous file | services/ui/ws/frame_generator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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.h" 5 #include "services/ui/ws/display.h"
6 6
7 #include <set> 7 #include <set>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 if (display_root) 300 if (display_root)
301 display_root->window_manager_state()->SetCapture(nullptr, kInvalidClientId); 301 display_root->window_manager_state()->SetCapture(nullptr, kInvalidClientId);
302 } 302 }
303 303
304 void Display::OnDisplayClosed() { 304 void Display::OnDisplayClosed() {
305 display_manager()->DestroyDisplay(this); 305 display_manager()->DestroyDisplay(this);
306 } 306 }
307 307
308 void Display::OnViewportMetricsChanged(const ViewportMetrics& old_metrics, 308 void Display::OnViewportMetricsChanged(const ViewportMetrics& old_metrics,
309 const ViewportMetrics& new_metrics) { 309 const ViewportMetrics& new_metrics) {
310 gfx::Rect new_bounds(new_metrics.bounds.size());
310 if (!root_) { 311 if (!root_) {
311 root_.reset(window_server_->CreateServerWindow( 312 root_.reset(window_server_->CreateServerWindow(
312 display_manager()->GetAndAdvanceNextRootId(), 313 display_manager()->GetAndAdvanceNextRootId(),
313 ServerWindow::Properties())); 314 ServerWindow::Properties()));
314 root_->SetBounds(new_metrics.bounds); 315 root_->SetBounds(new_bounds);
315 root_->SetVisible(true); 316 root_->SetVisible(true);
316 focus_controller_.reset(new FocusController(this, root_.get())); 317 focus_controller_.reset(new FocusController(this, root_.get()));
317 focus_controller_->AddObserver(this); 318 focus_controller_->AddObserver(this);
318 InitWindowManagerDisplayRootsIfNecessary(); 319 InitWindowManagerDisplayRootsIfNecessary();
319 } else { 320 } else {
320 root_->SetBounds(new_metrics.bounds); 321 root_->SetBounds(new_bounds);
321 for (auto& pair : window_manager_display_root_map_) 322 for (auto& pair : window_manager_display_root_map_)
322 pair.second->root()->SetBounds(new_metrics.bounds); 323 pair.second->root()->SetBounds(new_bounds);
323 } 324 }
324 display_manager()->OnDisplayUpdate(this); 325 display_manager()->OnDisplayUpdate(this);
325 } 326 }
326 327
327 void Display::OnCompositorFrameDrawn() { 328 void Display::OnCompositorFrameDrawn() {
328 std::set<ServerWindow*> windows; 329 std::set<ServerWindow*> windows;
329 windows.swap(windows_needing_frame_destruction_); 330 windows.swap(windows_needing_frame_destruction_);
330 for (ServerWindow* window : windows) { 331 for (ServerWindow* window : windows) {
331 window->RemoveObserver(this); 332 window->RemoveObserver(this);
332 window->DestroySurfacesScheduledForDestruction(); 333 window->DestroySurfacesScheduledForDestruction();
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 } 420 }
420 421
421 void Display::OnWindowManagerWindowTreeFactoryReady( 422 void Display::OnWindowManagerWindowTreeFactoryReady(
422 WindowManagerWindowTreeFactory* factory) { 423 WindowManagerWindowTreeFactory* factory) {
423 if (!binding_) 424 if (!binding_)
424 CreateWindowManagerDisplayRootFromFactory(factory); 425 CreateWindowManagerDisplayRootFromFactory(factory);
425 } 426 }
426 427
427 } // namespace ws 428 } // namespace ws
428 } // namespace ui 429 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | services/ui/ws/frame_generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698