| 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 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 1.0) | 412 1.0) |
| 413 .get()); | 413 .get()); |
| 414 EXPECT_FALSE(isCandidateForAnimationOnCompositor( | 414 EXPECT_FALSE(isCandidateForAnimationOnCompositor( |
| 415 m_timing, | 415 m_timing, |
| 416 *AnimatableValueKeyframeEffectModel::create(framesMixedProperties))); | 416 *AnimatableValueKeyframeEffectModel::create(framesMixedProperties))); |
| 417 } | 417 } |
| 418 | 418 |
| 419 TEST_F(AnimationCompositorAnimationsTest, AnimatedBoundingBox) { | 419 TEST_F(AnimationCompositorAnimationsTest, AnimatedBoundingBox) { |
| 420 Vector<TransformOperations> transformVector; | 420 Vector<TransformOperations> transformVector; |
| 421 transformVector.append(TransformOperations()); | 421 transformVector.append(TransformOperations()); |
| 422 transformVector.last().operations().append( | 422 transformVector.back().operations().append( |
| 423 TranslateTransformOperation::create(Length(0, Fixed), Length(0, Fixed), | 423 TranslateTransformOperation::create(Length(0, Fixed), Length(0, Fixed), |
| 424 0.0, | 424 0.0, |
| 425 TransformOperation::Translate3D)); | 425 TransformOperation::Translate3D)); |
| 426 transformVector.append(TransformOperations()); | 426 transformVector.append(TransformOperations()); |
| 427 transformVector.last().operations().append( | 427 transformVector.back().operations().append( |
| 428 TranslateTransformOperation::create(Length(200, Fixed), | 428 TranslateTransformOperation::create(Length(200, Fixed), |
| 429 Length(200, Fixed), 0.0, | 429 Length(200, Fixed), 0.0, |
| 430 TransformOperation::Translate3D)); | 430 TransformOperation::Translate3D)); |
| 431 std::unique_ptr<AnimatableValueKeyframeVector> frames = | 431 std::unique_ptr<AnimatableValueKeyframeVector> frames = |
| 432 createCompositableTransformKeyframeVector(transformVector); | 432 createCompositableTransformKeyframeVector(transformVector); |
| 433 FloatBox bounds; | 433 FloatBox bounds; |
| 434 EXPECT_TRUE(getAnimationBounds( | 434 EXPECT_TRUE(getAnimationBounds( |
| 435 bounds, *AnimatableValueKeyframeEffectModel::create(*frames), 0, 1)); | 435 bounds, *AnimatableValueKeyframeEffectModel::create(*frames), 0, 1)); |
| 436 EXPECT_EQ(FloatBox(0.0f, 0.f, 0.0f, 200.0f, 200.0f, 0.0f), bounds); | 436 EXPECT_EQ(FloatBox(0.0f, 0.f, 0.0f, 200.0f, 200.0f, 0.0f), bounds); |
| 437 bounds = FloatBox(); | 437 bounds = FloatBox(); |
| 438 EXPECT_TRUE(getAnimationBounds( | 438 EXPECT_TRUE(getAnimationBounds( |
| 439 bounds, *AnimatableValueKeyframeEffectModel::create(*frames), -1, 1)); | 439 bounds, *AnimatableValueKeyframeEffectModel::create(*frames), -1, 1)); |
| 440 EXPECT_EQ(FloatBox(-200.0f, -200.0, 0.0, 400.0f, 400.0f, 0.0f), bounds); | 440 EXPECT_EQ(FloatBox(-200.0f, -200.0, 0.0, 400.0f, 400.0f, 0.0f), bounds); |
| 441 transformVector.append(TransformOperations()); | 441 transformVector.append(TransformOperations()); |
| 442 transformVector.last().operations().append( | 442 transformVector.back().operations().append( |
| 443 TranslateTransformOperation::create(Length(-300, Fixed), | 443 TranslateTransformOperation::create(Length(-300, Fixed), |
| 444 Length(-400, Fixed), 1.0f, | 444 Length(-400, Fixed), 1.0f, |
| 445 TransformOperation::Translate3D)); | 445 TransformOperation::Translate3D)); |
| 446 bounds = FloatBox(); | 446 bounds = FloatBox(); |
| 447 frames = createCompositableTransformKeyframeVector(transformVector); | 447 frames = createCompositableTransformKeyframeVector(transformVector); |
| 448 EXPECT_TRUE(getAnimationBounds( | 448 EXPECT_TRUE(getAnimationBounds( |
| 449 bounds, *AnimatableValueKeyframeEffectModel::create(*frames), 0, 1)); | 449 bounds, *AnimatableValueKeyframeEffectModel::create(*frames), 0, 1)); |
| 450 EXPECT_EQ(FloatBox(-300.0f, -400.f, 0.0f, 500.0f, 600.0f, 1.0f), bounds); | 450 EXPECT_EQ(FloatBox(-300.0f, -400.f, 0.0f, 500.0f, 600.0f, 1.0f), bounds); |
| 451 bounds = FloatBox(); | 451 bounds = FloatBox(); |
| 452 EXPECT_TRUE(getAnimationBounds( | 452 EXPECT_TRUE(getAnimationBounds( |
| (...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1244 simulateFrame(1.); | 1244 simulateFrame(1.); |
| 1245 | 1245 |
| 1246 element->setLayoutObject(nullptr); | 1246 element->setLayoutObject(nullptr); |
| 1247 LayoutObjectProxy::dispose(layoutObject); | 1247 LayoutObjectProxy::dispose(layoutObject); |
| 1248 | 1248 |
| 1249 ThreadState::current()->collectAllGarbage(); | 1249 ThreadState::current()->collectAllGarbage(); |
| 1250 EXPECT_TRUE(element->elementAnimations()->animations().isEmpty()); | 1250 EXPECT_TRUE(element->elementAnimations()->animations().isEmpty()); |
| 1251 } | 1251 } |
| 1252 | 1252 |
| 1253 } // namespace blink | 1253 } // namespace blink |
| OLD | NEW |