Index: ui/gfx/compositor/compositor.h |
diff --git a/ui/gfx/compositor/compositor.h b/ui/gfx/compositor/compositor.h |
index 01e20e79014dee9da0175472b9086ab1eb316770..eafd6fb0db8295b51b21f152589ad225669caf46 100644 |
--- a/ui/gfx/compositor/compositor.h |
+++ b/ui/gfx/compositor/compositor.h |
@@ -63,6 +63,13 @@ class COMPOSITOR_EXPORT Texture : public base::RefCounted<Texture> { |
friend class base::RefCounted<Texture>; |
}; |
+// An interface to allow the compositor to communicate with its owner. |
+class COMPOSITOR_EXPORT CompositorDelegate { |
+ public: |
+ // Requests the owner to schedule a paint. |
+ virtual void ScheduleCompositorPaint() = 0; |
+}; |
+ |
// Compositor object to take care of GPU painting. |
// A Browser compositor object is responsible for generating the final |
// displayable form of pixels comprising a single widget's contents. It draws an |
@@ -71,7 +78,8 @@ class COMPOSITOR_EXPORT Texture : public base::RefCounted<Texture> { |
class COMPOSITOR_EXPORT Compositor : public base::RefCounted<Compositor> { |
public: |
// Create a compositor from the provided handle. |
- static Compositor* Create(gfx::AcceleratedWidget widget, |
+ static Compositor* Create(CompositorDelegate* delegate, |
+ gfx::AcceleratedWidget widget, |
const gfx::Size& size); |
// Creates a new texture. The caller owns the returned object. |
@@ -100,12 +108,17 @@ class COMPOSITOR_EXPORT Compositor : public base::RefCounted<Compositor> { |
const gfx::Size& size() { return size_; } |
protected: |
- explicit Compositor(const gfx::Size& size) : size_(size) {} |
+ Compositor(CompositorDelegate* delegate, const gfx::Size& size) |
+ : delegate_(delegate), |
+ size_(size) {} |
virtual ~Compositor() {} |
virtual void OnWidgetSizeChanged() = 0; |
+ CompositorDelegate* delegate() { return delegate_; } |
+ |
private: |
+ CompositorDelegate* delegate_; |
gfx::Size size_; |
friend class base::RefCounted<Compositor>; |