| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_BROWSER_ANDROID_EDGE_EFFECT_L_H_ |
| 6 #define CONTENT_BROWSER_ANDROID_EDGE_EFFECT_L_H_ |
| 7 |
| 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "content/browser/android/edge_effect_base.h" |
| 11 #include "ui/gfx/geometry/rect_f.h" |
| 12 #include "ui/gfx/geometry/size.h" |
| 13 |
| 14 namespace cc { |
| 15 class Layer; |
| 16 } |
| 17 |
| 18 namespace content { |
| 19 |
| 20 // |EdgeEffectL| mirrors its Android L counterpart, EdgeEffect.java. |
| 21 // Conscious tradeoffs were made to align this as closely as possible with the |
| 22 // the original Android java version. |
| 23 // All coordinates and dimensions are in device pixels. |
| 24 class EdgeEffectL : public EdgeEffectBase { |
| 25 public: |
| 26 static scoped_ptr<EdgeEffectL> Create(cc::Layer* root_layer); |
| 27 |
| 28 virtual ~EdgeEffectL(); |
| 29 |
| 30 virtual void Pull(base::TimeTicks current_time, |
| 31 float delta_distance) OVERRIDE; |
| 32 virtual void Pull(base::TimeTicks current_time, |
| 33 float delta_distance, |
| 34 float displacement) OVERRIDE; |
| 35 virtual void Absorb(base::TimeTicks current_time, float velocity) OVERRIDE; |
| 36 virtual bool Update(base::TimeTicks current_time) OVERRIDE; |
| 37 virtual void Release(base::TimeTicks current_time) OVERRIDE; |
| 38 |
| 39 virtual void Finish() OVERRIDE; |
| 40 virtual bool IsFinished() const OVERRIDE; |
| 41 |
| 42 virtual void ApplyToLayers(const gfx::SizeF& size, |
| 43 const gfx::Transform& transform) OVERRIDE; |
| 44 |
| 45 // Thread-safe trigger to load resources. |
| 46 static void EnsureResources(); |
| 47 |
| 48 private: |
| 49 explicit EdgeEffectL(const scoped_refptr<cc::Layer>& glow); |
| 50 |
| 51 scoped_refptr<cc::Layer> glow_; |
| 52 |
| 53 float glow_alpha_; |
| 54 float glow_scale_y_; |
| 55 |
| 56 float glow_alpha_start_; |
| 57 float glow_alpha_finish_; |
| 58 float glow_scale_y_start_; |
| 59 float glow_scale_y_finish_; |
| 60 |
| 61 gfx::RectF arc_rect_; |
| 62 gfx::Size bounds_; |
| 63 float displacement_; |
| 64 float target_displacement_; |
| 65 |
| 66 base::TimeTicks start_time_; |
| 67 base::TimeDelta duration_; |
| 68 |
| 69 State state_; |
| 70 |
| 71 float pull_distance_; |
| 72 |
| 73 DISALLOW_COPY_AND_ASSIGN(EdgeEffectL); |
| 74 }; |
| 75 |
| 76 } // namespace content |
| 77 |
| 78 #endif // CONTENT_BROWSER_ANDROID_EDGE_EFFECT_L_H_ |
| OLD | NEW |