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

Unified Diff: ui/gfx/compositor/layer.h

Issue 7273073: Animated Rotation (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Move compositing notifications to Layer Created 9 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
Index: ui/gfx/compositor/layer.h
diff --git a/ui/gfx/compositor/layer.h b/ui/gfx/compositor/layer.h
index d523c9cf6e7de57acec60f623992d1a889ed0459..7679ca2524de3177394e858d1754e20606a2b532 100644
--- a/ui/gfx/compositor/layer.h
+++ b/ui/gfx/compositor/layer.h
@@ -9,6 +9,7 @@
#include <vector>
#include "base/memory/ref_counted.h"
+#include "base/observer_list.h"
#include "ui/gfx/rect.h"
#include "ui/gfx/transform.h"
#include "ui/gfx/compositor/compositor.h"
@@ -18,6 +19,7 @@ class SkCanvas;
namespace ui {
class Compositor;
+class LayerObserver;
class Texture;
// Layer manages a texture, transform and a set of child Layers. Any View that
@@ -79,6 +81,11 @@ class COMPOSITOR_EXPORT Layer {
// Resets the canvas of the texture.
void SetCanvas(const SkCanvas& canvas, const gfx::Point& origin);
+ // Layers do not own observers. It is the responsibility of the observer to
+ // remove itself when it is done observing.
+ void AddObserver(LayerObserver* observer);
+ void RemoveObserver(LayerObserver* observer);
+
// Draws the layer with hole if hole is non empty.
// hole looks like:
//
@@ -134,6 +141,8 @@ class COMPOSITOR_EXPORT Layer {
gfx::Rect hole_rect_;
+ ObserverList<LayerObserver> observer_list_;
+
DISALLOW_COPY_AND_ASSIGN(Layer);
};
« no previous file with comments | « ui/gfx/compositor/compositor_gl.cc ('k') | ui/gfx/compositor/layer.cc » ('j') | views/view.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698