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

Unified Diff: ui/views/view.cc

Issue 10412044: layers: Consolidate the ownership of layers in views::View and aura::Window. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/view.h ('k') | ui/views/view_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/view.cc
diff --git a/ui/views/view.cc b/ui/views/view.cc
index cbcb45cf99a9ef2b973e5ce77d71ddecadb11539..1d47f067493a867cf121d522ead1c7c61fceff26 100644
--- a/ui/views/view.cc
+++ b/ui/views/view.cc
@@ -456,6 +456,12 @@ void View::SetPaintToLayer(bool paint_to_layer) {
}
}
+ui::Layer* View::RecreateLayer() {
+ ui::Layer* layer = AcquireLayer();
+ CreateLayer();
+ return layer;
+}
+
// RTL positioning -------------------------------------------------------------
gfx::Rect View::GetMirroredBounds() const {
@@ -1781,7 +1787,8 @@ void View::CreateLayer() {
for (int i = 0, count = child_count(); i < count; ++i)
child_at(i)->UpdateChildLayerVisibility(true);
- layer_.reset(new ui::Layer());
+ layer_ = new ui::Layer();
+ layer_owner_.reset(layer_);
layer_->set_delegate(this);
#if !defined(NDEBUG)
layer_->set_name(GetClassName());
@@ -1856,7 +1863,8 @@ void View::DestroyLayer() {
new_parent->Add(children[i]);
}
- layer_.reset();
+ layer_ = NULL;
+ layer_owner_.reset();
if (new_parent)
ReorderLayers();
« no previous file with comments | « ui/views/view.h ('k') | ui/views/view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698