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 1215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1226 EXPECT_TRUE(animation1->hasActiveAnimationsOnCompositor()); | 1226 EXPECT_TRUE(animation1->hasActiveAnimationsOnCompositor()); |
1227 | 1227 |
1228 // The second animation for opacity is not ok to run on compositor. | 1228 // The second animation for opacity is not ok to run on compositor. |
1229 KeyframeEffect* keyframeEffect2 = | 1229 KeyframeEffect* keyframeEffect2 = |
1230 KeyframeEffect::create(element.get(), animationEffect2, timing); | 1230 KeyframeEffect::create(element.get(), animationEffect2, timing); |
1231 Animation* animation2 = m_timeline->play(keyframeEffect2); | 1231 Animation* animation2 = m_timeline->play(keyframeEffect2); |
1232 EXPECT_FALSE(CompositorAnimations::isCandidateForAnimationOnCompositor( | 1232 EXPECT_FALSE(CompositorAnimations::isCandidateForAnimationOnCompositor( |
1233 timing, *element.get(), animation2, *animationEffect2, 1)); | 1233 timing, *element.get(), animation2, *animationEffect2, 1)); |
1234 EXPECT_FALSE(animation2->hasActiveAnimationsOnCompositor()); | 1234 EXPECT_FALSE(animation2->hasActiveAnimationsOnCompositor()); |
1235 | 1235 |
1236 // A fallback to blink implementation needed, so cancel all compositor-side op
acity animations for this element. | 1236 // A fallback to blink implementation needed, so cancel all compositor-side |
| 1237 // opacity animations for this element. |
1237 animation2->cancelIncompatibleAnimationsOnCompositor(); | 1238 animation2->cancelIncompatibleAnimationsOnCompositor(); |
1238 | 1239 |
1239 EXPECT_FALSE(animation1->hasActiveAnimationsOnCompositor()); | 1240 EXPECT_FALSE(animation1->hasActiveAnimationsOnCompositor()); |
1240 EXPECT_FALSE(animation2->hasActiveAnimationsOnCompositor()); | 1241 EXPECT_FALSE(animation2->hasActiveAnimationsOnCompositor()); |
1241 | 1242 |
1242 simulateFrame(0); | 1243 simulateFrame(0); |
1243 EXPECT_EQ(2U, element->elementAnimations()->animations().size()); | 1244 EXPECT_EQ(2U, element->elementAnimations()->animations().size()); |
1244 simulateFrame(1.); | 1245 simulateFrame(1.); |
1245 | 1246 |
1246 element->setLayoutObject(nullptr); | 1247 element->setLayoutObject(nullptr); |
1247 LayoutObjectProxy::dispose(layoutObject); | 1248 LayoutObjectProxy::dispose(layoutObject); |
1248 | 1249 |
1249 ThreadState::current()->collectAllGarbage(); | 1250 ThreadState::current()->collectAllGarbage(); |
1250 EXPECT_TRUE(element->elementAnimations()->animations().isEmpty()); | 1251 EXPECT_TRUE(element->elementAnimations()->animations().isEmpty()); |
1251 } | 1252 } |
1252 | 1253 |
1253 } // namespace blink | 1254 } // namespace blink |
OLD | NEW |