| 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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 } | 214 } |
| 215 | 215 |
| 216 PassOwnPtr<AnimatableValueKeyframeVector> createCompositableFloatKeyframeVec
tor(Vector<double>& values) | 216 PassOwnPtr<AnimatableValueKeyframeVector> createCompositableFloatKeyframeVec
tor(Vector<double>& values) |
| 217 { | 217 { |
| 218 OwnPtr<AnimatableValueKeyframeVector> frames = adoptPtr(new AnimatableVa
lueKeyframeVector); | 218 OwnPtr<AnimatableValueKeyframeVector> frames = adoptPtr(new AnimatableVa
lueKeyframeVector); |
| 219 for (size_t i = 0; i < values.size(); i++) { | 219 for (size_t i = 0; i < values.size(); i++) { |
| 220 double offset = 1.0 / (values.size() - 1) * i; | 220 double offset = 1.0 / (values.size() - 1) * i; |
| 221 RefPtr<AnimatableDouble> value = AnimatableDouble::create(values[i])
; | 221 RefPtr<AnimatableDouble> value = AnimatableDouble::create(values[i])
; |
| 222 frames->append(createReplaceOpKeyframe(CSSPropertyOpacity, value.get
(), offset).get()); | 222 frames->append(createReplaceOpKeyframe(CSSPropertyOpacity, value.get
(), offset).get()); |
| 223 } | 223 } |
| 224 return frames.release(); | 224 return frames; |
| 225 } | 225 } |
| 226 | 226 |
| 227 PassOwnPtr<AnimatableValueKeyframeVector> createCompositableTransformKeyfram
eVector(const Vector<TransformOperations>& values) | 227 PassOwnPtr<AnimatableValueKeyframeVector> createCompositableTransformKeyfram
eVector(const Vector<TransformOperations>& values) |
| 228 { | 228 { |
| 229 OwnPtr<AnimatableValueKeyframeVector> frames = adoptPtr(new AnimatableVa
lueKeyframeVector); | 229 OwnPtr<AnimatableValueKeyframeVector> frames = adoptPtr(new AnimatableVa
lueKeyframeVector); |
| 230 for (size_t i = 0; i < values.size(); ++i) { | 230 for (size_t i = 0; i < values.size(); ++i) { |
| 231 double offset = 1.0f / (values.size() - 1) * i; | 231 double offset = 1.0f / (values.size() - 1) * i; |
| 232 RefPtr<AnimatableTransform> value = AnimatableTransform::create(valu
es[i], 1); | 232 RefPtr<AnimatableTransform> value = AnimatableTransform::create(valu
es[i], 1); |
| 233 frames->append(createReplaceOpKeyframe(CSSPropertyTransform, value.g
et(), offset).get()); | 233 frames->append(createReplaceOpKeyframe(CSSPropertyTransform, value.g
et(), offset).get()); |
| 234 } | 234 } |
| 235 return frames.release(); | 235 return frames; |
| 236 } | 236 } |
| 237 | 237 |
| 238 AnimatableValueKeyframeEffectModel* createKeyframeEffectModel(PassRefPtr<Ani
matableValueKeyframe> prpFrom, PassRefPtr<AnimatableValueKeyframe> prpTo, PassRe
fPtr<AnimatableValueKeyframe> prpC = nullptr, PassRefPtr<AnimatableValueKeyframe
> prpD = nullptr) | 238 AnimatableValueKeyframeEffectModel* createKeyframeEffectModel(PassRefPtr<Ani
matableValueKeyframe> prpFrom, PassRefPtr<AnimatableValueKeyframe> prpTo, PassRe
fPtr<AnimatableValueKeyframe> prpC = nullptr, PassRefPtr<AnimatableValueKeyframe
> prpD = nullptr) |
| 239 { | 239 { |
| 240 RefPtr<AnimatableValueKeyframe> from = prpFrom; | 240 RefPtr<AnimatableValueKeyframe> from = prpFrom; |
| 241 RefPtr<AnimatableValueKeyframe> to = prpTo; | 241 RefPtr<AnimatableValueKeyframe> to = prpTo; |
| 242 RefPtr<AnimatableValueKeyframe> c = prpC; | 242 RefPtr<AnimatableValueKeyframe> c = prpC; |
| 243 RefPtr<AnimatableValueKeyframe> d = prpD; | 243 RefPtr<AnimatableValueKeyframe> d = prpD; |
| 244 | 244 |
| 245 EXPECT_EQ(from->offset(), 0); | 245 EXPECT_EQ(from->offset(), 0); |
| (...skipping 979 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1225 simulateFrame(1.); | 1225 simulateFrame(1.); |
| 1226 | 1226 |
| 1227 element->setLayoutObject(nullptr); | 1227 element->setLayoutObject(nullptr); |
| 1228 LayoutObjectProxy::dispose(layoutObject); | 1228 LayoutObjectProxy::dispose(layoutObject); |
| 1229 | 1229 |
| 1230 ThreadHeap::collectAllGarbage(); | 1230 ThreadHeap::collectAllGarbage(); |
| 1231 EXPECT_TRUE(element->elementAnimations()->animations().isEmpty()); | 1231 EXPECT_TRUE(element->elementAnimations()->animations().isEmpty()); |
| 1232 } | 1232 } |
| 1233 | 1233 |
| 1234 } // namespace blink | 1234 } // namespace blink |
| OLD | NEW |