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

Unified Diff: ui/compositor/layer_animator.cc

Issue 10800020: Add brightness/grayscale animations and use them for OOBE boot transition (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix hide animation Created 8 years, 5 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 | « ui/compositor/layer_animator.h ('k') | ui/compositor/layer_animator_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/layer_animator.cc
diff --git a/ui/compositor/layer_animator.cc b/ui/compositor/layer_animator.cc
index c1bfd7a4a965494060a1424c427678f1145f9f98..a0d904c30b8d44448fd71e93480b42b4c0dda6c9 100644
--- a/ui/compositor/layer_animator.cc
+++ b/ui/compositor/layer_animator.cc
@@ -119,6 +119,34 @@ bool LayerAnimator::GetTargetVisibility() const {
return target.visibility;
}
+void LayerAnimator::SetBrightness(float brightness) {
+ base::TimeDelta duration = GetTransitionDuration();
+ scoped_ptr<LayerAnimationElement> element(
+ LayerAnimationElement::CreateBrightnessElement(brightness, duration));
+ element->set_tween_type(tween_type_);
+ StartAnimation(new LayerAnimationSequence(element.release()));
+}
+
+float LayerAnimator::GetTargetBrightness() const {
+ LayerAnimationElement::TargetValue target(delegate());
+ GetTargetValue(&target);
+ return target.brightness;
+}
+
+void LayerAnimator::SetGrayscale(float grayscale) {
+ base::TimeDelta duration = GetTransitionDuration();
+ scoped_ptr<LayerAnimationElement> element(
+ LayerAnimationElement::CreateGrayscaleElement(grayscale, duration));
+ element->set_tween_type(tween_type_);
+ StartAnimation(new LayerAnimationSequence(element.release()));
+}
+
+float LayerAnimator::GetTargetGrayscale() const {
+ LayerAnimationElement::TargetValue target(delegate());
+ GetTargetValue(&target);
+ return target.grayscale;
+}
+
void LayerAnimator::SetDelegate(LayerAnimationDelegate* delegate) {
DCHECK(delegate);
delegate_ = delegate;
« no previous file with comments | « ui/compositor/layer_animator.h ('k') | ui/compositor/layer_animator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698