WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch for landing
bug-89768-20120703135049.patch (text/plain), 10.04 KB, created by
vollick
on 2012-07-03 10:50:51 PDT
(
hide
)
Description:
Patch for landing
Filename:
MIME Type:
Creator:
vollick
Created:
2012-07-03 10:50:51 PDT
Size:
10.04 KB
patch
obsolete
>Subversion Revision: 121780 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index e606ad999f22477db7b88edd8ffc58d25a9e8040..b49a388fce5f9c644a63dfe9195553d0177d7839 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,25 @@ >+2012-06-22 Ian Vollick <vollick@chromium.org> >+ >+ [chromium] Correctly reject accelerated animations with certain rotations. >+ https://bugs.webkit.org/show_bug.cgi?id=89768 >+ >+ Reviewed by James Robinson. >+ >+ UnitTests: >+ GraphicsLayerChromiumTest.createTransformAnimationWithBigRotation >+ GraphicsLayerChromiumTest.createTransformAnimationWithRotationInvolvingNegativeAngles >+ GraphicsLayerChromiumTest.createTransformAnimationWithSmallRotationInvolvingLargeAngles >+ >+ * platform/graphics/chromium/AnimationTranslationUtil.cpp: >+ (WebCore::appendKeyframe): >+ (WebCore::isRotationType): >+ (WebCore): >+ (WebCore::causesRotationOfAtLeast180Degrees): >+ (WebCore::CCKeyframedTransformAnimationCurve): >+ (WebCore::createActiveAnimation): >+ * platform/graphics/chromium/GraphicsLayerChromium.cpp: >+ (WebCore::GraphicsLayerChromium::addAnimation): >+ > 2012-07-03 Vsevolod Vlasov <vsevik@chromium.org> > > Web Inspector: Introduce Workspace make it UISourceCode provider for ScriptsPanel. >diff --git a/Source/WebKit/chromium/ChangeLog b/Source/WebKit/chromium/ChangeLog >index 665063f566d619fb5696fa712178273afebbe905..c53e74cb286f6b3038a0c449bea3c4bc90e6e65b 100644 >--- a/Source/WebKit/chromium/ChangeLog >+++ b/Source/WebKit/chromium/ChangeLog >@@ -1,3 +1,14 @@ >+2012-06-22 Ian Vollick <vollick@chromium.org> >+ >+ [chromium] Correctly reject accelerated animations with certain rotations. >+ https://bugs.webkit.org/show_bug.cgi?id=89768 >+ >+ Reviewed by James Robinson. >+ >+ * tests/GraphicsLayerChromiumTest.cpp: >+ (WebKitTests::TEST_F): >+ (WebKitTests): >+ > 2012-07-03 Charles Wei <charles.wei@torchmobile.com.cn> > > IndexedDB: should make the LevelDB persistant to the directory indicated in PageGroupSettings::indexedDBDataBasePath >diff --git a/Source/WebCore/platform/graphics/chromium/AnimationTranslationUtil.cpp b/Source/WebCore/platform/graphics/chromium/AnimationTranslationUtil.cpp >index 42c952f0721ccb6300cf8b52a3ad5fd8bdcbc064..69e632b7119175c339dda0415e664877ef401662 100644 >--- a/Source/WebCore/platform/graphics/chromium/AnimationTranslationUtil.cpp >+++ b/Source/WebCore/platform/graphics/chromium/AnimationTranslationUtil.cpp >@@ -122,15 +122,54 @@ WebTransformOperations toWebTransformOperations(const TransformOperations& trans > } > > template <class Value, class Keyframe, class Curve> >-bool appendKeyframe(Curve& curve, double keyTime, const Value* value, PassOwnPtr<CCTimingFunction> timingFunction, const FloatSize&) >+bool appendKeyframe(Curve& curve, double keyTime, const Value* value, const Value* lastValue, PassOwnPtr<CCTimingFunction> timingFunction, const FloatSize&) > { > curve.addKeyframe(Keyframe::create(keyTime, value->value(), timingFunction)); > return true; > } > >+bool isRotationType(TransformOperation::OperationType transformType) >+{ >+ return transformType == TransformOperation::ROTATE >+ || transformType == TransformOperation::ROTATE_X >+ || transformType == TransformOperation::ROTATE_Y >+ || transformType == TransformOperation::ROTATE_Z >+ || transformType == TransformOperation::ROTATE_3D; >+} >+ >+bool causesRotationOfAtLeast180Degrees(const TransformAnimationValue* value, const TransformAnimationValue* lastValue) >+{ >+ if (!lastValue) >+ return false; >+ >+ 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)) >+ return false; >+ >+ for (size_t i = 0; i < operations.size(); ++i) { >+ 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()); >+ >+ if (fabs(rotation->angle() - lastRotation->angle()) >= 180) >+ return true; >+ } >+ >+ return false; >+} >+ > template <> >-bool appendKeyframe<TransformAnimationValue, CCTransformKeyframe, CCKeyframedTransformAnimationCurve>(CCKeyframedTransformAnimationCurve& curve, double keyTime, const TransformAnimationValue* value, PassOwnPtr<CCTimingFunction> timingFunction, const FloatSize& boxSize) >+bool appendKeyframe<TransformAnimationValue, CCTransformKeyframe, CCKeyframedTransformAnimationCurve>(CCKeyframedTransformAnimationCurve& curve, double keyTime, const TransformAnimationValue* value, const TransformAnimationValue* lastValue, PassOwnPtr<CCTimingFunction> timingFunction, const FloatSize& boxSize) > { >+ if (causesRotationOfAtLeast180Degrees(value, lastValue)) >+ return false; >+ > WebTransformOperations operations = toWebTransformOperations(*value->value(), boxSize); > if (operations.apply().isInvertible()) { > curve.addKeyframe(CCTransformKeyframe::create(keyTime, operations, timingFunction)); >@@ -159,6 +198,9 @@ PassOwnPtr<CCActiveAnimation> createActiveAnimation(const KeyframeValueList& val > size_t index = reverse ? valueList.size() - i - 1 : i; > > const Value* originalValue = static_cast<const Value*>(valueList.at(index)); >+ const Value* lastOriginalValue = 0; >+ if (valueList.size() > 1 && ((reverse && index + 1 < valueList.size()) || (!reverse && index > 0))) >+ lastOriginalValue = static_cast<const Value*>(valueList.at(reverse ? index + 1 : index - 1)); > > OwnPtr<CCTimingFunction> timingFunction; > const TimingFunction* originalTimingFunction = originalValue->timingFunction(); >@@ -190,7 +232,7 @@ PassOwnPtr<CCActiveAnimation> createActiveAnimation(const KeyframeValueList& val > if (reverse) > keyTime = duration - keyTime; > >- bool addedKeyframe = appendKeyframe<Value, Keyframe, Curve>(*curve, keyTime, originalValue, timingFunction.release(), boxSize); >+ bool addedKeyframe = appendKeyframe<Value, Keyframe, Curve>(*curve, keyTime, originalValue, lastOriginalValue, timingFunction.release(), boxSize); > if (!addedKeyframe) > return nullptr; > } >diff --git a/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp b/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp >index d37572d93d11981923462da362f231df0772bc8b..c21726e9f4240a61eb3c08f09162c2639ce36d3e 100644 >--- a/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp >+++ b/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp >@@ -509,14 +509,6 @@ void GraphicsLayerChromium::setContentsToCanvas(PlatformLayer* platformLayer) > > bool GraphicsLayerChromium::addAnimation(const KeyframeValueList& values, const IntSize& boxSize, const Animation* animation, const String& animationName, double timeOffset) > { >- // Bail early if we have a large rotation. >- if (values.property() == AnimatedPropertyWebkitTransform) { >- bool hasRotationOfMoreThan180Degrees = false; >- validateTransformOperations(values, hasRotationOfMoreThan180Degrees); >- if (hasRotationOfMoreThan180Degrees) >- return false; >- } >- > primaryLayer().unwrap<LayerChromium>()->setLayerAnimationDelegate(this); > > int animationId = mapAnimationNameToId(animationName); >diff --git a/Source/WebKit/chromium/tests/GraphicsLayerChromiumTest.cpp b/Source/WebKit/chromium/tests/GraphicsLayerChromiumTest.cpp >index 1979d935c1ab2bfb092d57d8c4595c1d78702e28..4fb15d1ebcc49665a650fabb442d5a38456008f0 100644 >--- a/Source/WebKit/chromium/tests/GraphicsLayerChromiumTest.cpp >+++ b/Source/WebKit/chromium/tests/GraphicsLayerChromiumTest.cpp >@@ -256,6 +256,50 @@ TEST_F(GraphicsLayerChromiumTest, createTransformAnimationWithBigRotation) > EXPECT_FALSE(m_platformLayer->layerAnimationController()->hasActiveAnimation()); > } > >+TEST_F(GraphicsLayerChromiumTest, createTransformAnimationWithRotationInvolvingNegativeAngles) >+{ >+ const double duration = 1; >+ WebCore::KeyframeValueList values(AnimatedPropertyWebkitTransform); >+ >+ TransformOperations operations1; >+ operations1.operations().append(RotateTransformOperation::create(-330, TransformOperation::ROTATE)); >+ values.insert(new TransformAnimationValue(0, &operations1)); >+ >+ TransformOperations operations2; >+ operations2.operations().append(RotateTransformOperation::create(-320, TransformOperation::ROTATE)); >+ values.insert(new TransformAnimationValue(duration, &operations2)); >+ >+ RefPtr<Animation> animation = Animation::create(); >+ animation->setDuration(duration); >+ >+ IntSize boxSize; >+ m_graphicsLayer->addAnimation(values, boxSize, animation.get(), "", 0); >+ >+ EXPECT_TRUE(m_platformLayer->layerAnimationController()->hasActiveAnimation()); >+} >+ >+TEST_F(GraphicsLayerChromiumTest, createTransformAnimationWithSmallRotationInvolvingLargeAngles) >+{ >+ const double duration = 1; >+ WebCore::KeyframeValueList values(AnimatedPropertyWebkitTransform); >+ >+ TransformOperations operations1; >+ operations1.operations().append(RotateTransformOperation::create(270, TransformOperation::ROTATE)); >+ values.insert(new TransformAnimationValue(0, &operations1)); >+ >+ TransformOperations operations2; >+ operations2.operations().append(RotateTransformOperation::create(360, TransformOperation::ROTATE)); >+ values.insert(new TransformAnimationValue(duration, &operations2)); >+ >+ RefPtr<Animation> animation = Animation::create(); >+ animation->setDuration(duration); >+ >+ IntSize boxSize; >+ m_graphicsLayer->addAnimation(values, boxSize, animation.get(), "", 0); >+ >+ EXPECT_TRUE(m_platformLayer->layerAnimationController()->hasActiveAnimation()); >+} >+ > TEST_F(GraphicsLayerChromiumTest, createTransformAnimationWithSingularMatrix) > { > const double duration = 1;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 89768
:
149052
|
149059
|
149083
|
149084
|
149085
| 150642