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

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

Issue 7770002: gfx::Compositor: SchedulePaint. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 3 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 | « aura/window_unittest.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 01e20e79014dee9da0175472b9086ab1eb316770..a1210cd00b27d74d5eb7e34acd8f7a729039d5ca 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.
@@ -87,7 +95,9 @@ class COMPOSITOR_EXPORT Compositor : public base::RefCounted<Compositor> {
virtual void Blur(const gfx::Rect& bounds) = 0;
// Schedules a paint on the widget this Compositor was created for.
- virtual void SchedulePaint() = 0;
+ virtual void SchedulePaint() {
+ delegate_->ScheduleCompositorPaint();
+ }
// Notifies the compositor that the size of the widget that it is
// drawing to has changed.
@@ -100,12 +110,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>;
« no previous file with comments | « aura/window_unittest.cc ('k') | ui/gfx/compositor/compositor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698