OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef UI_GFX_COMPOSITOR_LAYER_H_ | 5 #ifndef UI_GFX_COMPOSITOR_LAYER_H_ |
6 #define UI_GFX_COMPOSITOR_LAYER_H_ | 6 #define UI_GFX_COMPOSITOR_LAYER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/message_loop.h" | 14 #include "base/message_loop.h" |
15 #include "ui/gfx/rect.h" | 15 #include "ui/gfx/rect.h" |
16 #include "ui/gfx/transform.h" | 16 #include "ui/gfx/transform.h" |
17 #include "ui/gfx/compositor/compositor.h" | 17 #include "ui/gfx/compositor/compositor.h" |
18 #include "ui/gfx/compositor/layer_animator.h" | 18 #include "ui/gfx/compositor/layer_animation_manager.h" |
19 #include "ui/gfx/compositor/layer_animator_delegate.h" | 19 #include "ui/gfx/compositor/layer_animator_delegate.h" |
20 #include "ui/gfx/compositor/layer_delegate.h" | 20 #include "ui/gfx/compositor/layer_delegate.h" |
21 | 21 |
22 class SkCanvas; | 22 class SkCanvas; |
23 | 23 |
24 namespace ui { | 24 namespace ui { |
25 | 25 |
26 class Animation; | 26 class Animation; |
27 class Compositor; | 27 class Compositor; |
28 class Texture; | 28 class Texture; |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 Transform* transform) const; | 215 Transform* transform) const; |
216 | 216 |
217 // The only externally updated layers are ones that get their pixels from | 217 // The only externally updated layers are ones that get their pixels from |
218 // WebKit and WebKit does not produce valid alpha values. All other layers | 218 // WebKit and WebKit does not produce valid alpha values. All other layers |
219 // should have valid alpha. | 219 // should have valid alpha. |
220 bool has_valid_alpha_channel() const { return !layer_updated_externally_; } | 220 bool has_valid_alpha_channel() const { return !layer_updated_externally_; } |
221 | 221 |
222 // If the animation is running and has progressed, it is stopped and all | 222 // If the animation is running and has progressed, it is stopped and all |
223 // properties that are animated (except |property|) are immediately set to | 223 // properties that are animated (except |property|) are immediately set to |
224 // their target value. | 224 // their target value. |
225 void StopAnimatingIfNecessary(LayerAnimator::AnimationProperty property); | 225 void StopAnimatingIfNecessary( |
| 226 LayerAnimationManager::AnimationProperty property); |
226 | 227 |
227 // Following are invoked from the animation or if no animation exists to | 228 // Following are invoked from the animation or if no animation exists to |
228 // update the values immediately. | 229 // update the values immediately. |
229 void SetBoundsImmediately(const gfx::Rect& bounds); | 230 void SetBoundsImmediately(const gfx::Rect& bounds); |
230 void SetTransformImmediately(const ui::Transform& transform); | 231 void SetTransformImmediately(const ui::Transform& transform); |
231 void SetOpacityImmediately(float opacity); | 232 void SetOpacityImmediately(float opacity); |
232 | 233 |
233 // LayerAnimatorDelegate overrides: | 234 // LayerAnimatorDelegate overrides: |
234 virtual void SetBoundsFromAnimator(const gfx::Rect& bounds) OVERRIDE; | 235 virtual void SetBoundsFromAnimator(const gfx::Rect& bounds) OVERRIDE; |
235 virtual void SetTransformFromAnimator(const Transform& transform) OVERRIDE; | 236 virtual void SetTransformFromAnimator(const Transform& transform) OVERRIDE; |
(...skipping 22 matching lines...) Expand all Loading... |
258 | 259 |
259 gfx::Rect invalid_rect_; | 260 gfx::Rect invalid_rect_; |
260 | 261 |
261 // If true the layer is always up to date. | 262 // If true the layer is always up to date. |
262 bool layer_updated_externally_; | 263 bool layer_updated_externally_; |
263 | 264 |
264 float opacity_; | 265 float opacity_; |
265 | 266 |
266 LayerDelegate* delegate_; | 267 LayerDelegate* delegate_; |
267 | 268 |
268 scoped_ptr<LayerAnimator> animator_; | 269 scoped_ptr<LayerAnimationManager> animator_; |
269 | 270 |
270 DISALLOW_COPY_AND_ASSIGN(Layer); | 271 DISALLOW_COPY_AND_ASSIGN(Layer); |
271 }; | 272 }; |
272 | 273 |
273 } // namespace ui | 274 } // namespace ui |
274 | 275 |
275 #endif // UI_GFX_COMPOSITOR_LAYER_H_ | 276 #endif // UI_GFX_COMPOSITOR_LAYER_H_ |
OLD | NEW |