OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013, Google Inc. All rights reserved. | 2 * Copyright (c) 2013, Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 { | 175 { |
176 KeyframeEffectModel::KeyframeVector frames; | 176 KeyframeEffectModel::KeyframeVector frames; |
177 for (size_t i = 0; i < values.size(); i++) { | 177 for (size_t i = 0; i < values.size(); i++) { |
178 double offset = 1.0 / (values.size() - 1) * i; | 178 double offset = 1.0 / (values.size() - 1) * i; |
179 RefPtr<AnimatableDouble> value = AnimatableDouble::create(values[i])
; | 179 RefPtr<AnimatableDouble> value = AnimatableDouble::create(values[i])
; |
180 frames.append(createReplaceOpKeyframe(CSSPropertyOpacity, value.get(
), offset).get()); | 180 frames.append(createReplaceOpKeyframe(CSSPropertyOpacity, value.get(
), offset).get()); |
181 } | 181 } |
182 return frames; | 182 return frames; |
183 } | 183 } |
184 | 184 |
185 PassRefPtr<KeyframeEffectModel> createKeyframeEffectModel(PassRefPtr<Keyfram
e> prpFrom, PassRefPtr<Keyframe> prpTo, PassRefPtr<Keyframe> prpC = 0, PassRefPt
r<Keyframe> prpD = 0) | 185 PassRefPtr<KeyframeEffectModel> createKeyframeEffectModel(PassRefPtr<Keyfram
e> prpFrom, PassRefPtr<Keyframe> prpTo, PassRefPtr<Keyframe> prpC = nullptr, Pas
sRefPtr<Keyframe> prpD = nullptr) |
186 { | 186 { |
187 RefPtr<Keyframe> from = prpFrom; | 187 RefPtr<Keyframe> from = prpFrom; |
188 RefPtr<Keyframe> to = prpTo; | 188 RefPtr<Keyframe> to = prpTo; |
189 RefPtr<Keyframe> c = prpC; | 189 RefPtr<Keyframe> c = prpC; |
190 RefPtr<Keyframe> d = prpD; | 190 RefPtr<Keyframe> d = prpD; |
191 | 191 |
192 EXPECT_EQ(from->offset(), 0); | 192 EXPECT_EQ(from->offset(), 0); |
193 KeyframeEffectModel::KeyframeVector frames; | 193 KeyframeEffectModel::KeyframeVector frames; |
194 frames.append(from); | 194 frames.append(from); |
195 EXPECT_LE(from->offset(), to->offset()); | 195 EXPECT_LE(from->offset(), to->offset()); |
(...skipping 840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1036 // Go! | 1036 // Go! |
1037 setCompositorForTesting(mockCompositor); | 1037 setCompositorForTesting(mockCompositor); |
1038 Vector<OwnPtr<blink::WebAnimation> > result; | 1038 Vector<OwnPtr<blink::WebAnimation> > result; |
1039 getAnimationOnCompositor(m_timing, *effect.get(), result); | 1039 getAnimationOnCompositor(m_timing, *effect.get(), result); |
1040 EXPECT_EQ(1U, result.size()); | 1040 EXPECT_EQ(1U, result.size()); |
1041 result[0].clear(); | 1041 result[0].clear(); |
1042 } | 1042 } |
1043 | 1043 |
1044 | 1044 |
1045 } // namespace WebCore | 1045 } // namespace WebCore |
OLD | NEW |