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

Unified Diff: ash/wm/window_animations.cc

Issue 10837211: Draw web content area correctly on a phantom window for window dragging (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove WindowPainter Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ash/wm/window_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/window_animations.cc
diff --git a/ash/wm/window_animations.cc b/ash/wm/window_animations.cc
index 6ff62b62481b92a00e1644d27ab8dd49e4876511..6f1bca355de533afdf3b98259225c53ec14420f3 100644
--- a/ash/wm/window_animations.cc
+++ b/ash/wm/window_animations.cc
@@ -13,6 +13,7 @@
#include "ash/launcher/launcher.h"
#include "ash/screen_ash.h"
#include "ash/shell.h"
+#include "ash/wm/window_util.h"
#include "base/command_line.h"
#include "base/compiler_specific.h"
#include "base/logging.h"
@@ -616,35 +617,6 @@ bool AnimateHideWindow(aura::Window* window) {
}
}
-// Recreates a fresh layer for |window| and all its child windows. Does not
-// recreate shadows or other non-window layers. Returns the old layer and its
-// children, maintaining the hierarchy.
-Layer* RecreateWindowLayers(Window* window) {
- Layer* old_layer = window->RecreateLayer();
- DCHECK(old_layer);
- for (Window::Windows::const_iterator it = window->children().begin();
- it != window->children().end();
- ++it) {
- aura::Window* child = *it;
- Layer* old_child_layer = RecreateWindowLayers(child);
- // Maintain the hierarchy of the detached layers.
- old_layer->Add(old_child_layer);
- }
- return old_layer;
-}
-
-// Deletes |layer| and all its child layers.
-void DeepDelete(Layer* layer) {
- std::vector<Layer*> children = layer->children();
- for (std::vector<Layer*>::const_iterator it = children.begin();
- it != children.end();
- ++it) {
- Layer* child = *it;
- DeepDelete(child);
- }
- delete layer;
-}
-
// Observer for a window cross-fade animation. If either the window closes or
// the layer's animation completes or compositing is aborted due to GPU crash,
// it deletes the layer and removes itself as an observer.
@@ -710,7 +682,7 @@ class CrossFadeObserver : public ui::CompositorObserver,
}
if (layer_) {
layer_->GetCompositor()->RemoveObserver(this);
- DeepDelete(layer_);
+ wm::DeepDeleteLayers(layer_);
layer_ = NULL;
}
}
@@ -768,7 +740,7 @@ void CrossFadeToBounds(aura::Window* window, const gfx::Rect& new_bounds) {
// Create fresh layers for the window and all its children to paint into.
// Takes ownership of the old layer and all its children, which will be
// cleaned up after the animation completes.
- ui::Layer* old_layer = internal::RecreateWindowLayers(window);
+ ui::Layer* old_layer = wm::RecreateWindowLayers(window);
ui::Layer* new_layer = window->layer();
// Ensure the higher-resolution layer is on top.
« no previous file with comments | « no previous file | ash/wm/window_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698