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

Side by Side Diff: ui/android/overscroll_glow.cc

Issue 1747783002: CC Animation: Erase old animation system in Android Compositor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 9 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 unified diff | Download patch
« no previous file with comments | « ui/android/edge_effect_l.cc ('k') | ui/android/ui_android.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/overscroll_glow.h" 5 #include "ui/android/overscroll_glow.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "cc/layers/layer.h" 9 #include "cc/layers/layer.h"
10 #include "cc/layers/layer_settings.h"
10 #include "ui/android/edge_effect_base.h" 11 #include "ui/android/edge_effect_base.h"
11 #include "ui/android/window_android_compositor.h" 12 #include "ui/android/window_android_compositor.h"
12 13
13 using std::max; 14 using std::max;
14 using std::min; 15 using std::min;
15 16
16 namespace ui { 17 namespace ui {
17 18
18 namespace { 19 namespace {
19 20
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 void OverscrollGlow::Detach() { 188 void OverscrollGlow::Detach() {
188 if (root_layer_.get()) 189 if (root_layer_.get())
189 root_layer_->RemoveFromParent(); 190 root_layer_->RemoveFromParent();
190 } 191 }
191 192
192 bool OverscrollGlow::InitializeIfNecessary() { 193 bool OverscrollGlow::InitializeIfNecessary() {
193 if (initialized_) 194 if (initialized_)
194 return true; 195 return true;
195 196
196 DCHECK(!root_layer_.get()); 197 DCHECK(!root_layer_.get());
197 root_layer_ = cc::Layer::Create(WindowAndroidCompositor::LayerSettings()); 198 root_layer_ = cc::Layer::Create(cc::LayerSettings());
198 for (size_t i = 0; i < EDGE_COUNT; ++i) { 199 for (size_t i = 0; i < EDGE_COUNT; ++i) {
199 edge_effects_[i] = client_->CreateEdgeEffect(); 200 edge_effects_[i] = client_->CreateEdgeEffect();
200 DCHECK(edge_effects_[i]); 201 DCHECK(edge_effects_[i]);
201 } 202 }
202 203
203 initialized_ = true; 204 initialized_ = true;
204 return true; 205 return true;
205 } 206 }
206 207
207 void OverscrollGlow::Pull(base::TimeTicks current_time, 208 void OverscrollGlow::Pull(base::TimeTicks current_time,
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 for (size_t i = 0; i < EDGE_COUNT; ++i) 273 for (size_t i = 0; i < EDGE_COUNT; ++i)
273 edge_effects_[i]->Release(current_time); 274 edge_effects_[i]->Release(current_time);
274 } 275 }
275 276
276 EdgeEffectBase* OverscrollGlow::GetOppositeEdge(int edge_index) { 277 EdgeEffectBase* OverscrollGlow::GetOppositeEdge(int edge_index) {
277 DCHECK(initialized_); 278 DCHECK(initialized_);
278 return edge_effects_[(edge_index + 2) % EDGE_COUNT].get(); 279 return edge_effects_[(edge_index + 2) % EDGE_COUNT].get();
279 } 280 }
280 281
281 } // namespace ui 282 } // namespace ui
OLDNEW
« no previous file with comments | « ui/android/edge_effect_l.cc ('k') | ui/android/ui_android.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698