Index: ui/gfx/compositor/layer_animation_preemption_strategy.h |
diff --git a/ui/gfx/compositor/layer_animation_preemption_strategy.h b/ui/gfx/compositor/layer_animation_preemption_strategy.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..0fd68568c0fa2f1dfbb11b6df6e315b9b5beb150 |
--- /dev/null |
+++ b/ui/gfx/compositor/layer_animation_preemption_strategy.h |
@@ -0,0 +1,37 @@ |
+// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef UI_GFX_COMPOSITOR_LAYER_ANIMATION_PREEMPTION_STRATEGY_H_ |
+#define UI_GFX_COMPOSITOR_LAYER_ANIMATION_PREEMPTION_STRATEGY_H_ |
+ |
+#include "ui/gfx/compositor/compositor_export.h" |
+#include "ui/gfx/compositor/layer_animator.h" |
+ |
+namespace ui { |
+ |
+class LayerAnimationDelegate; |
+class LayerAnimationSequence; |
+ |
+class COMPOSITOR_EXPORT LayerAnimationPreemptionStrategy { |
sky
2011/10/14 16:39:52
This seems better served by an enum. Is there a re
|
+ public: |
+ // Do not delete these objects, they are singletons. |
+ static LayerAnimationPreemptionStrategy* GetImmediatelySetNewTarget(); |
+ static LayerAnimationPreemptionStrategy* GetImmediatelyAnimateToNewTarget(); |
+ static LayerAnimationPreemptionStrategy* GetEnqueueNewAnimation(); |
+ static LayerAnimationPreemptionStrategy* GetBlendCurrentWithNewAnimation(); |
+ |
+ // Start the sequence |preempting|, modifying the queue and running animations |
+ // as necessary. |
+ virtual void Preempt(LayerAnimationDelegate* delegate, |
+ LayerAnimationSequence* preempting, |
+ LayerAnimator::RunningAnimations* running, |
+ LayerAnimator::AnimationQueue* queue) = 0; |
+ |
+ protected: |
+ virtual ~LayerAnimationPreemptionStrategy() {} |
+}; |
+ |
+} // namespace ui |
+ |
+#endif // UI_GFX_COMPOSITOR_LAYER_ANIMATION_PREEMPTION_STRATEGY_H_ |