summaryrefslogtreecommitdiffstats
path: root/ui/gfx/compositor/compositor.cc
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-27 19:14:38 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-27 19:14:38 +0000
commit993d6b32443cada86407e252087d72823abdda54 (patch)
treeb6da59774b30b94dabd34886866cfb50b2c0eb5e /ui/gfx/compositor/compositor.cc
parent200210f5b91d642c424112cca35a5201143eaafd (diff)
downloadchromium_src-993d6b32443cada86407e252087d72823abdda54.zip
chromium_src-993d6b32443cada86407e252087d72823abdda54.tar.gz
chromium_src-993d6b32443cada86407e252087d72823abdda54.tar.bz2
Allow layers to be created without a compositor, creating this association when they are associated with a root layer/added to a hierarchy parented to a root layer.This allows us to configure a layer associated with a view before the view is attached to a widget.BUG=noneTEST=unittests
Review URL: http://codereview.chromium.org/8036026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102989 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gfx/compositor/compositor.cc')
-rw-r--r--ui/gfx/compositor/compositor.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/ui/gfx/compositor/compositor.cc b/ui/gfx/compositor/compositor.cc
index 516031e..fa37e03 100644
--- a/ui/gfx/compositor/compositor.cc
+++ b/ui/gfx/compositor/compositor.cc
@@ -18,6 +18,12 @@ Compositor::Compositor(CompositorDelegate* delegate, const gfx::Size& size)
Compositor::~Compositor() {
}
+void Compositor::SetRootLayer(Layer* root_layer) {
+ root_layer_ = root_layer;
+ if (!root_layer_->GetCompositor())
+ root_layer_->SetCompositor(this);
+}
+
void Compositor::Draw(bool force_clear) {
if (!root_layer_)
return;