| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 #include "ui/android/edge_effect_l.h" | 5 #include "ui/android/edge_effect_l.h" |
| 6 | 6 |
| 7 #include "cc/layers/layer_settings.h" |
| 7 #include "cc/layers/ui_resource_layer.h" | 8 #include "cc/layers/ui_resource_layer.h" |
| 8 #include "ui/android/animation_utils.h" | 9 #include "ui/android/animation_utils.h" |
| 9 #include "ui/android/resources/resource_manager.h" | 10 #include "ui/android/resources/resource_manager.h" |
| 10 #include "ui/android/resources/system_ui_resource_type.h" | 11 #include "ui/android/resources/system_ui_resource_type.h" |
| 11 #include "ui/android/window_android_compositor.h" | 12 #include "ui/android/window_android_compositor.h" |
| 12 #include "ui/gfx/geometry/rect_f.h" | 13 #include "ui/gfx/geometry/rect_f.h" |
| 13 #include "ui/gfx/geometry/size_conversions.h" | 14 #include "ui/gfx/geometry/size_conversions.h" |
| 14 | 15 |
| 15 namespace ui { | 16 namespace ui { |
| 16 | 17 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 44 const float kPullDistanceAlphaGlowFactor = 0.8f; | 45 const float kPullDistanceAlphaGlowFactor = 0.8f; |
| 45 | 46 |
| 46 const int kVelocityGlowFactor = 6; | 47 const int kVelocityGlowFactor = 6; |
| 47 | 48 |
| 48 const ui::SystemUIResourceType kResourceId = ui::OVERSCROLL_GLOW_L; | 49 const ui::SystemUIResourceType kResourceId = ui::OVERSCROLL_GLOW_L; |
| 49 | 50 |
| 50 } // namespace | 51 } // namespace |
| 51 | 52 |
| 52 EdgeEffectL::EdgeEffectL(ui::ResourceManager* resource_manager) | 53 EdgeEffectL::EdgeEffectL(ui::ResourceManager* resource_manager) |
| 53 : resource_manager_(resource_manager), | 54 : resource_manager_(resource_manager), |
| 54 glow_(cc::UIResourceLayer::Create( | 55 glow_(cc::UIResourceLayer::Create(cc::LayerSettings())), |
| 55 WindowAndroidCompositor::LayerSettings())), | |
| 56 glow_alpha_(0), | 56 glow_alpha_(0), |
| 57 glow_scale_y_(0), | 57 glow_scale_y_(0), |
| 58 glow_alpha_start_(0), | 58 glow_alpha_start_(0), |
| 59 glow_alpha_finish_(0), | 59 glow_alpha_finish_(0), |
| 60 glow_scale_y_start_(0), | 60 glow_scale_y_start_(0), |
| 61 glow_scale_y_finish_(0), | 61 glow_scale_y_finish_(0), |
| 62 displacement_(0.5f), | 62 displacement_(0.5f), |
| 63 target_displacement_(0.5f), | 63 target_displacement_(0.5f), |
| 64 state_(STATE_IDLE), | 64 state_(STATE_IDLE), |
| 65 pull_distance_(0) { | 65 pull_distance_(0) { |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 } | 293 } |
| 294 | 294 |
| 295 // static | 295 // static |
| 296 void EdgeEffectL::PreloadResources(ui::ResourceManager* resource_manager) { | 296 void EdgeEffectL::PreloadResources(ui::ResourceManager* resource_manager) { |
| 297 DCHECK(resource_manager); | 297 DCHECK(resource_manager); |
| 298 resource_manager->PreloadResource(ui::ANDROID_RESOURCE_TYPE_SYSTEM, | 298 resource_manager->PreloadResource(ui::ANDROID_RESOURCE_TYPE_SYSTEM, |
| 299 kResourceId); | 299 kResourceId); |
| 300 } | 300 } |
| 301 | 301 |
| 302 } // namespace ui | 302 } // namespace ui |
| OLD | NEW |