diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-14 04:16:48 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-14 04:16:48 +0000 |
commit | ed8de92d4a7cac32184381d55a37a5bc8011c979 (patch) | |
tree | 53f049c29cae9edea9948012f67a0613b445c813 /ui/gfx/compositor/compositor.h | |
parent | 0a2648d2e3998f01e7e54cc8ca2dafacb0519247 (diff) | |
download | chromium_src-ed8de92d4a7cac32184381d55a37a5bc8011c979.zip chromium_src-ed8de92d4a7cac32184381d55a37a5bc8011c979.tar.gz chromium_src-ed8de92d4a7cac32184381d55a37a5bc8011c979.tar.bz2 |
The Compositor should own drawing the root layer.
Also fixes rendering.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/7889017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@101027 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gfx/compositor/compositor.h')
-rw-r--r-- | ui/gfx/compositor/compositor.h | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/ui/gfx/compositor/compositor.h b/ui/gfx/compositor/compositor.h index f0c370a..ba3a0a9 100644 --- a/ui/gfx/compositor/compositor.h +++ b/ui/gfx/compositor/compositor.h @@ -22,6 +22,7 @@ class Rect; namespace ui { class CompositorObserver; +class Layer; struct TextureDrawParams { TextureDrawParams() : transform(), blend(false), compositor_size() {} @@ -88,13 +89,6 @@ class COMPOSITOR_EXPORT Compositor : public base::RefCounted<Compositor> { // Creates a new texture. The caller owns the returned object. virtual Texture* CreateTexture() = 0; - // Notifies the compositor that compositing is about to start. If |clear| is - // true, this will cause the compositor to clear before compositing. - void NotifyStart(bool clear); - - // Notifies the compositor that compositing is complete. - void NotifyEnd(); - // Blurs the specific region in the compositor. virtual void Blur(const gfx::Rect& bounds) = 0; @@ -103,6 +97,17 @@ class COMPOSITOR_EXPORT Compositor : public base::RefCounted<Compositor> { delegate_->ScheduleCompositorPaint(); } + // Sets the root of the layer tree drawn by this Compositor. + // The Compositor does not own the root layer. + void set_root_layer(Layer* root_layer) { + root_layer_ = root_layer; + } + + // Draws the scene created by the layer tree and any visual effects. If + // |force_clear| is true, this will cause the compositor to clear before + // compositing. + void Draw(bool force_clear); + // Notifies the compositor that the size of the widget that it is // drawing to has changed. void WidgetSizeChanged(const gfx::Size& size) { @@ -133,9 +138,19 @@ class COMPOSITOR_EXPORT Compositor : public base::RefCounted<Compositor> { CompositorDelegate* delegate() { return delegate_; } private: + // Notifies the compositor that compositing is about to start. See Draw() for + // notes about |force_clear|. + void NotifyStart(bool force_clear); + + // Notifies the compositor that compositing is complete. + void NotifyEnd(); + CompositorDelegate* delegate_; gfx::Size size_; + // The root of the Layer tree drawn by this compositor. + Layer* root_layer_; + ObserverList<CompositorObserver> observer_list_; friend class base::RefCounted<Compositor>; |