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

Unified Diff: ui/views/view.h

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/compositor/layer_owner.cc ('k') | ui/views/view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/view.h
diff --git a/ui/views/view.h b/ui/views/view.h
index 8492d958b401815548e5400e6539e7f456834af1..dca93be99c8f0ed55eb0a11ef45a7c744ef95105 100644
--- a/ui/views/view.h
+++ b/ui/views/view.h
@@ -20,6 +20,7 @@
#include "ui/base/accelerators/accelerator.h"
#include "ui/base/dragdrop/os_exchange_data.h"
#include "ui/compositor/layer_delegate.h"
+#include "ui/compositor/layer_owner.h"
#include "ui/gfx/native_widget_types.h"
#include "ui/gfx/rect.h"
#include "ui/views/background.h"
@@ -96,6 +97,7 @@ class RootView;
//
/////////////////////////////////////////////////////////////////////////////
class VIEWS_EXPORT View : public ui::LayerDelegate,
+ public ui::LayerOwner,
public ui::AcceleratorTarget {
public:
typedef std::vector<View*> Views;
@@ -278,8 +280,11 @@ class VIEWS_EXPORT View : public ui::LayerDelegate,
// Compositor.
void SetPaintToLayer(bool paint_to_layer);
- const ui::Layer* layer() const { return layer_.get(); }
- ui::Layer* layer() { return layer_.get(); }
+ // Recreates a layer for the view and returns the old layer. After this call,
+ // the View no longer has a pointer to the old layer (so it won't be able to
+ // update the old layer or destroy it). The caller must free the returned
+ // layer.
+ ui::Layer* RecreateLayer() WARN_UNUSED_RESULT;
// RTL positioning -----------------------------------------------------------
@@ -1412,7 +1417,6 @@ class VIEWS_EXPORT View : public ui::LayerDelegate,
// Accelerated painting ------------------------------------------------------
bool paint_to_layer_;
- scoped_ptr<ui::Layer> layer_;
// Accelerators --------------------------------------------------------------
« no previous file with comments | « ui/compositor/layer_owner.cc ('k') | ui/views/view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698