diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-24 00:44:54 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-24 00:44:54 +0000 |
commit | fb4d9d1d2d0dc061167b93303f5fa50255843bf6 (patch) | |
tree | af1bbc62f9630efff6e1c8bcd56eb432493f3362 /ui/compositor | |
parent | 50efccb9963f1524a069dab4ae1ddc2eccf50bca (diff) | |
download | chromium_src-fb4d9d1d2d0dc061167b93303f5fa50255843bf6.zip chromium_src-fb4d9d1d2d0dc061167b93303f5fa50255843bf6.tar.gz chromium_src-fb4d9d1d2d0dc061167b93303f5fa50255843bf6.tar.bz2 |
Random set of changes for workspace2 code:
. Makes Layer::GetCombinedOpacity() public so I can use in tests.
. Makes some debugging functions in Window public, extends what they
output and makes iteration consistant with View.
. Adds WindowAnimationDelegate. Its used to decide if a window should
be animated. I need this so that workspace code can selectively
disable some window animations.
. Makes WindowWatcher work with old workspace code.
. Installs a default background for ash_shell.
BUG=137342
TEST=none
R=ben@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10872024
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@153124 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/compositor')
-rw-r--r-- | ui/compositor/layer.cc | 20 | ||||
-rw-r--r-- | ui/compositor/layer.h | 10 |
2 files changed, 14 insertions, 16 deletions
diff --git a/ui/compositor/layer.cc b/ui/compositor/layer.cc index b1e8f8f..be4e7c9 100644 --- a/ui/compositor/layer.cc +++ b/ui/compositor/layer.cc @@ -239,6 +239,16 @@ void Layer::SetOpacity(float opacity) { GetAnimator()->SetOpacity(opacity); } +float Layer::GetCombinedOpacity() const { + float opacity = opacity_; + Layer* current = this->parent_; + while (current) { + opacity *= current->opacity_; + current = current->parent_; + } + return opacity; +} + void Layer::SetBackgroundBlur(int blur_radius) { background_blur_radius_ = blur_radius; @@ -607,16 +617,6 @@ void Layer::SetForceRenderSurface(bool force) { #endif } -float Layer::GetCombinedOpacity() const { - float opacity = opacity_; - Layer* current = this->parent_; - while (current) { - opacity *= current->opacity_; - current = current->parent_; - } - return opacity; -} - void Layer::StackRelativeTo(Layer* child, Layer* other, bool above) { DCHECK_NE(child, other); DCHECK_EQ(this, child->parent()); diff --git a/ui/compositor/layer.h b/ui/compositor/layer.h index a999de8..9035559 100644 --- a/ui/compositor/layer.h +++ b/ui/compositor/layer.h @@ -131,6 +131,10 @@ class COMPOSITOR_EXPORT Layer float opacity() const { return opacity_; } void SetOpacity(float opacity); + // Returns the actual opacity, which the opacity of this layer multipled by + // the combined opacity of the parent. + float GetCombinedOpacity() const; + // Blur pixels by this amount in anything below the layer and visible through // the layer. int background_blur() const { return background_blur_radius_; } @@ -275,12 +279,6 @@ class COMPOSITOR_EXPORT Layer bool force_render_surface() const { return force_render_surface_; } private: - // TODO(vollick): Eventually, if a non-leaf node has an opacity of less than - // 1.0, we'll render to a separate texture, and then apply the alpha. - // Currently, we multiply our opacity by all our ancestor's opacities and - // use the combined result, but this is only temporary. - float GetCombinedOpacity() const; - // Stacks |child| above or below |other|. Helper method for StackAbove() and // StackBelow(). void StackRelativeTo(Layer* child, Layer* other, bool above); |