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

Side by Side Diff: ui/compositor/test/test_layer_animation_delegate.cc

Issue 1531913003: CC Animations: Make ui::LayerAnimator a LayerAnimationEventObserver (instead of ui::Layer) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix LayerAnimator::SetDelegate Created 5 years 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/compositor/test/test_layer_animation_delegate.h ('k') | no next file » | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/compositor/layer.h"
5 #include "ui/compositor/test/test_layer_animation_delegate.h" 6 #include "ui/compositor/test/test_layer_animation_delegate.h"
6 7
7 namespace ui { 8 namespace ui {
8 9
9 TestLayerAnimationDelegate::TestLayerAnimationDelegate() 10 TestLayerAnimationDelegate::TestLayerAnimationDelegate()
10 : opacity_(1.0f), 11 : opacity_(1.0f),
11 visibility_(true), 12 visibility_(true),
12 brightness_(0.0f), 13 brightness_(0.0f),
13 grayscale_(0.0f), 14 grayscale_(0.0f),
14 color_(SK_ColorBLACK) { 15 color_(SK_ColorBLACK) {
16 CreateCcLayer();
15 } 17 }
16 18
17 TestLayerAnimationDelegate::TestLayerAnimationDelegate( 19 TestLayerAnimationDelegate::TestLayerAnimationDelegate(
18 const LayerAnimationDelegate& other) 20 const LayerAnimationDelegate& other)
19 : bounds_(other.GetBoundsForAnimation()), 21 : bounds_(other.GetBoundsForAnimation()),
20 transform_(other.GetTransformForAnimation()), 22 transform_(other.GetTransformForAnimation()),
21 opacity_(other.GetOpacityForAnimation()), 23 opacity_(other.GetOpacityForAnimation()),
22 visibility_(other.GetVisibilityForAnimation()), 24 visibility_(other.GetVisibilityForAnimation()),
23 color_(SK_ColorBLACK) { 25 color_(SK_ColorBLACK) {
26 CreateCcLayer();
24 } 27 }
25 28
26 TestLayerAnimationDelegate::~TestLayerAnimationDelegate() { 29 TestLayerAnimationDelegate::~TestLayerAnimationDelegate() {
27 } 30 }
28 31
29 void TestLayerAnimationDelegate::SetBoundsFromAnimation( 32 void TestLayerAnimationDelegate::SetBoundsFromAnimation(
30 const gfx::Rect& bounds) { 33 const gfx::Rect& bounds) {
31 bounds_ = bounds; 34 bounds_ = bounds;
32 } 35 }
33 36
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 } 99 }
97 100
98 void TestLayerAnimationDelegate::RemoveThreadedAnimation(int animation_id) { 101 void TestLayerAnimationDelegate::RemoveThreadedAnimation(int animation_id) {
99 } 102 }
100 103
101 LayerAnimatorCollection* 104 LayerAnimatorCollection*
102 TestLayerAnimationDelegate::GetLayerAnimatorCollection() { 105 TestLayerAnimationDelegate::GetLayerAnimatorCollection() {
103 return NULL; 106 return NULL;
104 } 107 }
105 108
109 cc::Layer* TestLayerAnimationDelegate::GetCcLayer() const {
110 return cc_layer_.get();
111 }
112
113 void TestLayerAnimationDelegate::CreateCcLayer() {
114 cc_layer_ = cc::Layer::Create(ui::Layer::UILayerSettings());
115 }
116
106 } // namespace ui 117 } // namespace ui
OLDNEW
« no previous file with comments | « ui/compositor/test/test_layer_animation_delegate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698