| 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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 // Check all the properties can be accelerated | 143 // Check all the properties can be accelerated |
| 144 const PropertySet properties = frames[i]->properties(); // FIXME: proper
ties creates a whole new PropertySet! | 144 const PropertySet properties = frames[i]->properties(); // FIXME: proper
ties creates a whole new PropertySet! |
| 145 | 145 |
| 146 if (properties.isEmpty()) | 146 if (properties.isEmpty()) |
| 147 return false; | 147 return false; |
| 148 | 148 |
| 149 for (PropertySet::const_iterator it = properties.begin(); it != properti
es.end(); ++it) { | 149 for (PropertySet::const_iterator it = properties.begin(); it != properti
es.end(); ++it) { |
| 150 switch (*it) { | 150 switch (*it) { |
| 151 case CSSPropertyOpacity: | 151 case CSSPropertyOpacity: |
| 152 continue; | 152 continue; |
| 153 case CSSPropertyWebkitTransform: | 153 case CSSPropertyTransform: |
| 154 if (toAnimatableTransform(frames[i]->propertyValue(CSSPropertyWe
bkitTransform))->transformOperations().dependsOnBoxSize()) | 154 if (toAnimatableTransform(frames[i]->propertyValue(CSSPropertyTr
ansform))->transformOperations().dependsOnBoxSize()) |
| 155 return false; | 155 return false; |
| 156 continue; | 156 continue; |
| 157 case CSSPropertyWebkitFilter: { | 157 case CSSPropertyWebkitFilter: { |
| 158 const FilterOperations& operations = toAnimatableFilterOperation
s(frames[i]->propertyValue(CSSPropertyWebkitFilter))->operations(); | 158 const FilterOperations& operations = toAnimatableFilterOperation
s(frames[i]->propertyValue(CSSPropertyWebkitFilter))->operations(); |
| 159 if (operations.hasFilterThatMovesPixels()) | 159 if (operations.hasFilterThatMovesPixels()) |
| 160 return false; | 160 return false; |
| 161 for (size_t i = 0; i < operations.size(); i++) { | 161 for (size_t i = 0; i < operations.size(); i++) { |
| 162 const FilterOperation& op = *operations.at(i); | 162 const FilterOperation& op = *operations.at(i); |
| 163 if (op.type() == FilterOperation::VALIDATED_CUSTOM || op.typ
e() == FilterOperation::CUSTOM) | 163 if (op.type() == FilterOperation::VALIDATED_CUSTOM || op.typ
e() == FilterOperation::CUSTOM) |
| 164 return false; | 164 return false; |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 curve = adoptPtr(floatCurve); | 468 curve = adoptPtr(floatCurve); |
| 469 break; | 469 break; |
| 470 } | 470 } |
| 471 case CSSPropertyWebkitFilter: { | 471 case CSSPropertyWebkitFilter: { |
| 472 targetProperty = blink::WebAnimation::TargetPropertyFilter; | 472 targetProperty = blink::WebAnimation::TargetPropertyFilter; |
| 473 blink::WebFilterAnimationCurve* filterCurve = blink::Platform::curre
nt()->compositorSupport()->createFilterAnimationCurve(); | 473 blink::WebFilterAnimationCurve* filterCurve = blink::Platform::curre
nt()->compositorSupport()->createFilterAnimationCurve(); |
| 474 addKeyframesToCurve(*filterCurve, values, compositorTiming.reverse); | 474 addKeyframesToCurve(*filterCurve, values, compositorTiming.reverse); |
| 475 curve = adoptPtr(filterCurve); | 475 curve = adoptPtr(filterCurve); |
| 476 break; | 476 break; |
| 477 } | 477 } |
| 478 case CSSPropertyWebkitTransform: { | 478 case CSSPropertyTransform: { |
| 479 targetProperty = blink::WebAnimation::TargetPropertyTransform; | 479 targetProperty = blink::WebAnimation::TargetPropertyTransform; |
| 480 blink::WebTransformAnimationCurve* transformCurve = blink::Platform:
:current()->compositorSupport()->createTransformAnimationCurve(); | 480 blink::WebTransformAnimationCurve* transformCurve = blink::Platform:
:current()->compositorSupport()->createTransformAnimationCurve(); |
| 481 addKeyframesToCurve(*transformCurve, values, compositorTiming.revers
e); | 481 addKeyframesToCurve(*transformCurve, values, compositorTiming.revers
e); |
| 482 curve = adoptPtr(transformCurve); | 482 curve = adoptPtr(transformCurve); |
| 483 break; | 483 break; |
| 484 } | 484 } |
| 485 default: | 485 default: |
| 486 ASSERT_NOT_REACHED(); | 486 ASSERT_NOT_REACHED(); |
| 487 continue; | 487 continue; |
| 488 } | 488 } |
| 489 ASSERT(curve.get()); | 489 ASSERT(curve.get()); |
| 490 | 490 |
| 491 OwnPtr<blink::WebAnimation> animation = adoptPtr(blink::Platform::curren
t()->compositorSupport()->createAnimation(*curve, targetProperty)); | 491 OwnPtr<blink::WebAnimation> animation = adoptPtr(blink::Platform::curren
t()->compositorSupport()->createAnimation(*curve, targetProperty)); |
| 492 | 492 |
| 493 animation->setIterations(compositorTiming.adjustedIterationCount); | 493 animation->setIterations(compositorTiming.adjustedIterationCount); |
| 494 animation->setTimeOffset(compositorTiming.scaledTimeOffset); | 494 animation->setTimeOffset(compositorTiming.scaledTimeOffset); |
| 495 animation->setAlternatesDirection(compositorTiming.alternate); | 495 animation->setAlternatesDirection(compositorTiming.alternate); |
| 496 | 496 |
| 497 animations.append(animation.release()); | 497 animations.append(animation.release()); |
| 498 } | 498 } |
| 499 ASSERT(!animations.isEmpty()); | 499 ASSERT(!animations.isEmpty()); |
| 500 } | 500 } |
| 501 | 501 |
| 502 } // namespace WebCore | 502 } // namespace WebCore |
| OLD | NEW |