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

Unified Diff: ui/views/view.cc

Issue 204793004: Makes View::RecreateLayer() and Window::RecreateLayer() the same (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review comments Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/compositor/debug_utils.cc ('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 3acd7938c99c52f3bf9a553ea7c9a8145af9ff86..5875c7cee8d1dbf14bdbb8ec1d7b1f6c169bd50e 100644
--- a/ui/views/view.cc
+++ b/ui/views/view.cc
@@ -20,6 +20,7 @@
#include "ui/base/cursor/cursor.h"
#include "ui/base/dragdrop/drag_drop_types.h"
#include "ui/base/ui_base_switches_util.h"
+#include "ui/compositor/clone_layer.h"
#include "ui/compositor/compositor.h"
#include "ui/compositor/layer.h"
#include "ui/compositor/layer_animator.h"
@@ -506,13 +507,7 @@ void View::SetPaintToLayer(bool paint_to_layer) {
}
scoped_ptr<ui::Layer> View::RecreateLayer() {
- scoped_ptr<ui::Layer> acquired(AcquireLayer());
- if (!acquired)
- return acquired.Pass();
-
- CreateLayer();
- layer()->set_scale_content(acquired->scale_content());
- return acquired.Pass();
+ return ui::CloneLayer(this);
}
// RTL positioning -------------------------------------------------------------
« no previous file with comments | « ui/compositor/debug_utils.cc ('k') | ui/views/view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698