OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 | 115 |
116 OwnPtr<CompositorAnimationPlayer> m_compositorPlayer; | 116 OwnPtr<CompositorAnimationPlayer> m_compositorPlayer; |
117 }; | 117 }; |
118 | 118 |
119 TEST_F(GraphicsLayerTest, updateLayerShouldFlattenTransformWithAnimations) | 119 TEST_F(GraphicsLayerTest, updateLayerShouldFlattenTransformWithAnimations) |
120 { | 120 { |
121 ASSERT_FALSE(m_platformLayer->hasActiveAnimation()); | 121 ASSERT_FALSE(m_platformLayer->hasActiveAnimation()); |
122 | 122 |
123 OwnPtr<CompositorFloatAnimationCurve> curve = adoptPtr(CompositorFactory::cu
rrent().createFloatAnimationCurve()); | 123 OwnPtr<CompositorFloatAnimationCurve> curve = adoptPtr(CompositorFactory::cu
rrent().createFloatAnimationCurve()); |
124 curve->add(CompositorFloatKeyframe(0.0, 0.0)); | 124 curve->add(CompositorFloatKeyframe(0.0, 0.0)); |
125 OwnPtr<CompositorAnimation> floatAnimation(adoptPtr(CompositorFactory::curre
nt().createAnimation(*curve, CompositorAnimation::TargetPropertyOpacity))); | 125 OwnPtr<CompositorAnimation> floatAnimation(adoptPtr(CompositorFactory::curre
nt().createAnimation(*curve, CompositorTargetProperty::OPACITY))); |
126 int animationId = floatAnimation->id(); | 126 int animationId = floatAnimation->id(); |
127 | 127 |
128 if (RuntimeEnabledFeatures::compositorAnimationTimelinesEnabled()) { | 128 if (RuntimeEnabledFeatures::compositorAnimationTimelinesEnabled()) { |
129 OwnPtr<CompositorAnimationTimeline> compositorTimeline = adoptPtr(Compos
itorFactory::current().createAnimationTimeline()); | 129 OwnPtr<CompositorAnimationTimeline> compositorTimeline = adoptPtr(Compos
itorFactory::current().createAnimationTimeline()); |
130 AnimationPlayerForTesting player; | 130 AnimationPlayerForTesting player; |
131 | 131 |
132 layerTreeView()->attachCompositorAnimationTimeline(compositorTimeline->a
nimationTimeline()); | 132 layerTreeView()->attachCompositorAnimationTimeline(compositorTimeline->a
nimationTimeline()); |
133 compositorTimeline->playerAttached(player); | 133 compositorTimeline->playerAttached(player); |
134 | 134 |
135 player.compositorPlayer()->attachLayer(m_platformLayer); | 135 player.compositorPlayer()->attachLayer(m_platformLayer); |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 | 231 |
232 WebDoublePoint scrollPosition(7, 9); | 232 WebDoublePoint scrollPosition(7, 9); |
233 m_platformLayer->setScrollPositionDouble(scrollPosition); | 233 m_platformLayer->setScrollPositionDouble(scrollPosition); |
234 m_graphicsLayer->didScroll(); | 234 m_graphicsLayer->didScroll(); |
235 | 235 |
236 EXPECT_FLOAT_EQ(scrollPosition.x, scrollableArea->scrollPositionDouble().x()
); | 236 EXPECT_FLOAT_EQ(scrollPosition.x, scrollableArea->scrollPositionDouble().x()
); |
237 EXPECT_FLOAT_EQ(scrollPosition.y, scrollableArea->scrollPositionDouble().y()
); | 237 EXPECT_FLOAT_EQ(scrollPosition.y, scrollableArea->scrollPositionDouble().y()
); |
238 } | 238 } |
239 | 239 |
240 } // namespace blink | 240 } // namespace blink |
OLD | NEW |