From 659f068656ed799af79f4a87fb3301693ea38079 Mon Sep 17 00:00:00 2001 From: Nicolas Roard Date: Mon, 25 Jan 2010 22:43:15 +0000 Subject: translate3d() wasn't handled as we only have a 2D backend for the moment. But it should still work for the (x,y) components anyway... Fix bug http://b/2395354 --- .../platform/graphics/android/GraphicsLayerAndroid.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'WebCore') diff --git a/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp b/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp index fa012b0..9d9d067 100644 --- a/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp +++ b/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp @@ -588,6 +588,9 @@ bool GraphicsLayerAndroid::createTransformAnimationsFromKeyframes(const Keyframe TLOG("(%x) animateTransform, valueList(%d) functionList(%d) duration(%.2f)", this, valueList.size(), functionList.size(), animation->duration()); + // FIXME: add support for the translate 3d operations (when + // we'll have an OpenGL backend) + for (unsigned int i = 0; i < valueList.size(); i++) { const TransformOperations* operation = ((TransformAnimationValue*)valueList.at(i))->value(); Vector > ops = operation->operations(); @@ -596,7 +599,8 @@ bool GraphicsLayerAndroid::createTransformAnimationsFromKeyframes(const Keyframe TransformOperation* op = ops[j].get(); TLOG("(%x) animateTransform, dealing with the %d:%d operation, current op: %d (translate is %d, rotate %d, scale %d)", this, i, j, op->getOperationType(), TransformOperation::TRANSLATE, TransformOperation::ROTATE, TransformOperation::SCALE); - if (op->getOperationType() == TransformOperation::TRANSLATE) { + if ((op->getOperationType() == TransformOperation::TRANSLATE) || + (op->getOperationType() == TransformOperation::TRANSLATE_3D)) { TranslateTransformOperation* translateOperation = (TranslateTransformOperation*) op; IntSize bounds(m_size.width(), m_size.height()); float x = translateOperation->x(bounds); @@ -636,6 +640,17 @@ bool GraphicsLayerAndroid::createTransformAnimationsFromKeyframes(const Keyframe TLOG("(%x) animateTransform, the %d operation is a translation_y(%.2f)", this, j, y); doTranslation = true; + } else if (op->getOperationType() == TransformOperation::TRANSLATE_Z) { + TranslateTransformOperation* translateOperation = (TranslateTransformOperation*) op; + IntSize bounds(m_size.width(), m_size.height()); + float z = translateOperation->z(bounds); + if (!i) + fromTranslateZ = z; + else + toTranslateZ = z; + TLOG("(%x) animateTransform, the %d operation is a translation_z(%.2f)", + this, j, z); + doTranslation = true; } else if ((op->getOperationType() == TransformOperation::ROTATE) || (op->getOperationType() == TransformOperation::ROTATE_X) || (op->getOperationType() == TransformOperation::ROTATE_Y)) { -- cgit v1.1