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

Side by Side Diff: ash/wm/aura/wm_window_aura.cc

Issue 1992853002: Create a LayerDelegate for recreated layers to draw when their content is invalidated. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 | « ash/rotator/screen_rotation_animator.cc ('k') | ash/wm/drag_window_controller.h » ('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 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 "ash/wm/aura/wm_window_aura.h" 5 #include "ash/wm/aura/wm_window_aura.h"
6 6
7 #include "ash/screen_util.h" 7 #include "ash/screen_util.h"
8 #include "ash/shelf/shelf_util.h" 8 #include "ash/shelf/shelf_util.h"
9 #include "ash/wm/aura/aura_layout_manager_adapter.h" 9 #include "ash/wm/aura/aura_layout_manager_adapter.h"
10 #include "ash/wm/aura/wm_globals_aura.h" 10 #include "ash/wm/aura/wm_globals_aura.h"
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 307
308 void WmWindowAura::SetBoundsDirectCrossFade(const gfx::Rect& bounds) { 308 void WmWindowAura::SetBoundsDirectCrossFade(const gfx::Rect& bounds) {
309 const gfx::Rect old_bounds = window_->bounds(); 309 const gfx::Rect old_bounds = window_->bounds();
310 310
311 // Create fresh layers for the window and all its children to paint into. 311 // Create fresh layers for the window and all its children to paint into.
312 // Takes ownership of the old layer and all its children, which will be 312 // Takes ownership of the old layer and all its children, which will be
313 // cleaned up after the animation completes. 313 // cleaned up after the animation completes.
314 // Specify |set_bounds| to true here to keep the old bounds in the child 314 // Specify |set_bounds| to true here to keep the old bounds in the child
315 // windows of |window|. 315 // windows of |window|.
316 std::unique_ptr<ui::LayerTreeOwner> old_layer_owner = 316 std::unique_ptr<ui::LayerTreeOwner> old_layer_owner =
317 ::wm::RecreateLayers(window_); 317 ::wm::RecreateLayers(window_, nullptr);
318 ui::Layer* old_layer = old_layer_owner->root(); 318 ui::Layer* old_layer = old_layer_owner->root();
319 DCHECK(old_layer); 319 DCHECK(old_layer);
320 ui::Layer* new_layer = window_->layer(); 320 ui::Layer* new_layer = window_->layer();
321 321
322 // Resize the window to the new size, which will force a layout and paint. 322 // Resize the window to the new size, which will force a layout and paint.
323 SetBoundsDirect(bounds); 323 SetBoundsDirect(bounds);
324 324
325 // Ensure the higher-resolution layer is on top. 325 // Ensure the higher-resolution layer is on top.
326 bool old_on_top = (old_bounds.width() > bounds.width()); 326 bool old_on_top = (old_bounds.width() > bounds.width());
327 if (old_on_top) 327 if (old_on_top)
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 } 556 }
557 557
558 void WmWindowAura::OnWindowVisibilityChanging(aura::Window* window, 558 void WmWindowAura::OnWindowVisibilityChanging(aura::Window* window,
559 bool visible) { 559 bool visible) {
560 FOR_EACH_OBSERVER(WmWindowObserver, observers_, 560 FOR_EACH_OBSERVER(WmWindowObserver, observers_,
561 OnWindowVisibilityChanging(this, visible)); 561 OnWindowVisibilityChanging(this, visible));
562 } 562 }
563 563
564 } // namespace wm 564 } // namespace wm
565 } // namespace ash 565 } // namespace ash
OLDNEW
« no previous file with comments | « ash/rotator/screen_rotation_animator.cc ('k') | ash/wm/drag_window_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698