Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(270)

Unified Diff: Source/WebCore/platform/graphics/chromium/AnimationTranslationUtil.cpp

Issue 10836307: Merge 125702 - [chromium] Must account for empty transformation lists when checking for big rotatio… (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1229/
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/platform/graphics/chromium/AnimationTranslationUtil.cpp
===================================================================
--- Source/WebCore/platform/graphics/chromium/AnimationTranslationUtil.cpp (revision 125841)
+++ Source/WebCore/platform/graphics/chromium/AnimationTranslationUtil.cpp (working copy)
@@ -153,19 +153,31 @@
const TransformOperations& operations = *value->value();
const TransformOperations& lastOperations = *lastValue->value();
- // We'll be doing matrix interpolation in this case. No risk of incorrect
- // rotations here.
- if (!operations.operationsMatch(lastOperations))
+ // We'll be doing matrix interpolation in this case. No risk of incorrect rotations here.
+ if (operations.size() && lastOperations.size() && !operations.operationsMatch(lastOperations))
return false;
- for (size_t i = 0; i < operations.size(); ++i) {
- if (!isRotationType(operations.operations()[i]->getOperationType()))
- continue;
+ size_t numOperations = max(operations.size(), lastOperations.size());
+ for (size_t i = 0; i < numOperations; ++i) {
+ float angle = 0;
+ if (i < operations.size()) {
+ if (!isRotationType(operations.operations()[i]->getOperationType()))
+ continue;
- RotateTransformOperation* rotation = static_cast<RotateTransformOperation*>(operations.operations()[i].get());
- RotateTransformOperation* lastRotation = static_cast<RotateTransformOperation*>(lastOperations.operations()[i].get());
+ RotateTransformOperation* rotation = static_cast<RotateTransformOperation*>(operations.operations()[i].get());
+ angle = rotation->angle();
+ }
- if (fabs(rotation->angle() - lastRotation->angle()) >= 180)
+ float lastAngle = 0;
+ if (i < lastOperations.size()) {
+ if (!isRotationType(lastOperations.operations()[i]->getOperationType()))
+ continue;
+
+ RotateTransformOperation* lastRotation = static_cast<RotateTransformOperation*>(lastOperations.operations()[i].get());
+ lastAngle = lastRotation->angle();
+ }
+
+ if (fabs(angle - lastAngle) >= 180)
return true;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698