diff options
author | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-20 01:58:33 +0000 |
---|---|---|
committer | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-20 01:58:33 +0000 |
commit | 5ba9d5f9a061f5fb345ce651908ff67bfef80a71 (patch) | |
tree | 140b74f127492ad5b8299795438598bccd1f6b5a /ui/gfx | |
parent | 1b2747da8cf41299c56b60a87fc3200eceb8c002 (diff) | |
download | chromium_src-5ba9d5f9a061f5fb345ce651908ff67bfef80a71.zip chromium_src-5ba9d5f9a061f5fb345ce651908ff67bfef80a71.tar.gz chromium_src-5ba9d5f9a061f5fb345ce651908ff67bfef80a71.tar.bz2 |
Add GetTargetBounds to window/layer.
This is necessary for WindowManager to deterimne the window's layout even when window is animating.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/8357023
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106438 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gfx')
-rw-r--r-- | ui/gfx/compositor/layer.cc | 6 | ||||
-rw-r--r-- | ui/gfx/compositor/layer.h | 4 |
2 files changed, 10 insertions, 0 deletions
diff --git a/ui/gfx/compositor/layer.cc b/ui/gfx/compositor/layer.cc index 8266bff..34444ec 100644 --- a/ui/gfx/compositor/layer.cc +++ b/ui/gfx/compositor/layer.cc @@ -136,6 +136,12 @@ void Layer::SetBounds(const gfx::Rect& bounds) { SetBoundsImmediately(bounds); } +gfx::Rect Layer::GetTargetBounds() const { + if (animator_.get() && animator_->IsRunning()) + return gfx::Rect(animator_->GetTargetPoint(), bounds_.size()); + return bounds_; +} + void Layer::SetOpacity(float opacity) { StopAnimatingIfNecessary(LayerAnimator::OPACITY); if (animator_.get() && animator_->IsRunning()) { diff --git a/ui/gfx/compositor/layer.h b/ui/gfx/compositor/layer.h index c449e88..86ae4fd 100644 --- a/ui/gfx/compositor/layer.h +++ b/ui/gfx/compositor/layer.h @@ -97,6 +97,10 @@ class COMPOSITOR_EXPORT Layer : public LayerAnimatorDelegate { void SetBounds(const gfx::Rect& bounds); const gfx::Rect& bounds() const { return bounds_; } + // Return the target bounds if animator is running, or the current bounds + // otherwise. + gfx::Rect GetTargetBounds() const; + // The opacity of the layer. The opacity is applied to each pixel of the // texture (resulting alpha = opacity * alpha). float opacity() const { return opacity_; } |