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

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

Issue 7273073: Animated Rotation (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Address reviewer comments 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
« no previous file with comments | « chrome/common/url_constants.cc ('k') | ui/gfx/compositor/compositor.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/compositor/compositor.h
diff --git a/ui/gfx/compositor/compositor.h b/ui/gfx/compositor/compositor.h
index 42bb770cd756f0958b3a5db73b2f4e88310a5026..4bcc743edd7301b32c14559ad754d732ec1d08f3 100644
--- a/ui/gfx/compositor/compositor.h
+++ b/ui/gfx/compositor/compositor.h
@@ -7,6 +7,7 @@
#pragma once
#include "base/memory/ref_counted.h"
+#include "base/observer_list.h"
#include "ui/gfx/compositor/compositor_export.h"
#include "ui/gfx/transform.h"
#include "ui/gfx/native_widget_types.h"
@@ -20,6 +21,8 @@ class Rect;
namespace ui {
+class CompositorObserver;
+
struct TextureDrawParams {
TextureDrawParams() : transform(), blend(false), compositor_size() {}
@@ -81,10 +84,10 @@ class COMPOSITOR_EXPORT Compositor : public base::RefCounted<Compositor> {
virtual Texture* CreateTexture() = 0;
// Notifies the compositor that compositing is about to start.
- virtual void NotifyStart() = 0;
+ void NotifyStart();
// Notifies the compositor that compositing is complete.
- virtual void NotifyEnd() = 0;
+ void NotifyEnd();
// Blurs the specific region in the compositor.
virtual void Blur(const gfx::Rect& bounds) = 0;
@@ -102,15 +105,28 @@ class COMPOSITOR_EXPORT Compositor : public base::RefCounted<Compositor> {
// Returns the size of the widget that is being drawn to.
const gfx::Size& size() { return size_; }
+ // Layers do not own observers. It is the responsibility of the observer to
+ // remove itself when it is done observing.
+ void AddObserver(CompositorObserver* observer);
+ void RemoveObserver(CompositorObserver* observer);
+
protected:
explicit Compositor(const gfx::Size& size) : size_(size) {}
virtual ~Compositor() {}
+ // Notifies the compositor that compositing is about to start.
+ virtual void OnNotifyStart() = 0;
+
+ // Notifies the compositor that compositing is complete.
+ virtual void OnNotifyEnd() = 0;
+
virtual void OnWidgetSizeChanged() = 0;
private:
gfx::Size size_;
+ ObserverList<CompositorObserver> observer_list_;
+
friend class base::RefCounted<Compositor>;
};
« no previous file with comments | « chrome/common/url_constants.cc ('k') | ui/gfx/compositor/compositor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698