[SCM] WebKit Debian packaging branch, webkit-1.3, updated. upstream/1.3.7-4207-g178b198

commit-queue at webkit.org commit-queue at webkit.org
Sun Feb 20 23:44:23 UTC 2011


The following commit has been merged in the webkit-1.3 branch:
commit 4413d10c3229900109c752f5eb543128ed5afd75
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Jan 24 19:42:08 2011 +0000

    2011-01-24  Shane Stephens  <shanestephens at google.com>
    
            Reviewed by Chris Marrin.
    
            TransformationMatrix multiply operations apply operands in wrong order.
            https://bugs.webkit.org/show_bug.cgi?id=52780
    
            Rename TranformationMatrix::multLeft into multiply (the method does a multRight,
            not a multLeft).
    
            Remove TransformationMatrix::multiply, which was actually doing a multLeft.
    
            Fix TransformationMatrix::operator* and operator*= such that the operand is
            applied to the right-hand side of the matrix that the method is called on.
            i.e., previously "a * b" used to compute "b * a", and "a *= b" used to store
            "b * a" in "a".  This has now been fixed so "a * b" computes "a * b" and
            "a *= b" stores "a * b" in "a".
    
            Convert all call sites for these methods to provide operands in the correct order.
    
            No new tests as patch adds no new functionality.
    
            * css/WebKitCSSMatrix.cpp:
            (WebCore::WebKitCSSMatrix::multiply):
            * platform/graphics/transforms/Matrix3DTransformOperation.h:
            (WebCore::Matrix3DTransformOperation::apply):
            * platform/graphics/transforms/MatrixTransformOperation.h:
            (WebCore::MatrixTransformOperation::apply):
            * platform/graphics/transforms/TransformationMatrix.cpp:
            (WebCore::TransformationMatrix::scaleNonUniform):
            (WebCore::TransformationMatrix::scale3d):
            (WebCore::TransformationMatrix::rotate3d):
            (WebCore::TransformationMatrix::skew):
            (WebCore::TransformationMatrix::applyPerspective):
            (WebCore::TransformationMatrix::multiply):
            (WebCore::TransformationMatrix::recompose):
            * platform/graphics/transforms/TransformationMatrix.h:
            (WebCore::TransformationMatrix::operator*=):
            (WebCore::TransformationMatrix::operator*):
            * rendering/RenderLayer.cpp:
            (WebCore::transparencyClipBox):
            * rendering/RenderObject.cpp:
            (WebCore::RenderObject::getTransformFromContainer):
            * rendering/TransformState.cpp:
            (WebCore::TransformState::applyTransform):
            (WebCore::HitTestingTransformState::applyTransform):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76537 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 5ce7342..0c8311c 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,50 @@
+2011-01-24  Shane Stephens  <shanestephens at google.com>
+
+        Reviewed by Chris Marrin.
+
+        TransformationMatrix multiply operations apply operands in wrong order.
+        https://bugs.webkit.org/show_bug.cgi?id=52780
+
+        Rename TranformationMatrix::multLeft into multiply (the method does a multRight,
+        not a multLeft).
+
+        Remove TransformationMatrix::multiply, which was actually doing a multLeft.
+
+        Fix TransformationMatrix::operator* and operator*= such that the operand is
+        applied to the right-hand side of the matrix that the method is called on.
+        i.e., previously "a * b" used to compute "b * a", and "a *= b" used to store
+        "b * a" in "a".  This has now been fixed so "a * b" computes "a * b" and
+        "a *= b" stores "a * b" in "a".
+
+        Convert all call sites for these methods to provide operands in the correct order.
+
+        No new tests as patch adds no new functionality.
+
+        * css/WebKitCSSMatrix.cpp:
+        (WebCore::WebKitCSSMatrix::multiply):
+        * platform/graphics/transforms/Matrix3DTransformOperation.h:
+        (WebCore::Matrix3DTransformOperation::apply):
+        * platform/graphics/transforms/MatrixTransformOperation.h:
+        (WebCore::MatrixTransformOperation::apply):
+        * platform/graphics/transforms/TransformationMatrix.cpp:
+        (WebCore::TransformationMatrix::scaleNonUniform):
+        (WebCore::TransformationMatrix::scale3d):
+        (WebCore::TransformationMatrix::rotate3d):
+        (WebCore::TransformationMatrix::skew):
+        (WebCore::TransformationMatrix::applyPerspective):
+        (WebCore::TransformationMatrix::multiply):
+        (WebCore::TransformationMatrix::recompose):
+        * platform/graphics/transforms/TransformationMatrix.h:
+        (WebCore::TransformationMatrix::operator*=):
+        (WebCore::TransformationMatrix::operator*):
+        * rendering/RenderLayer.cpp:
+        (WebCore::transparencyClipBox):
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::getTransformFromContainer):
+        * rendering/TransformState.cpp:
+        (WebCore::TransformState::applyTransform):
+        (WebCore::HitTestingTransformState::applyTransform):
+
 2011-01-24  Andrei Popescu  <andreip at google.com>
 
         Reviewed by Nate Chapin.
diff --git a/Source/WebCore/css/WebKitCSSMatrix.cpp b/Source/WebCore/css/WebKitCSSMatrix.cpp
index 14f6b4e..163eac8 100644
--- a/Source/WebCore/css/WebKitCSSMatrix.cpp
+++ b/Source/WebCore/css/WebKitCSSMatrix.cpp
@@ -91,9 +91,7 @@ PassRefPtr<WebKitCSSMatrix> WebKitCSSMatrix::multiply(WebKitCSSMatrix* secondMat
     if (!secondMatrix)
         return 0;
 
-    TransformationMatrix tmp(secondMatrix->m_matrix);
-    tmp.multiply(m_matrix);
-    return WebKitCSSMatrix::create(tmp);
+    return WebKitCSSMatrix::create(TransformationMatrix(m_matrix).multiply(secondMatrix->m_matrix));
 }
 
 PassRefPtr<WebKitCSSMatrix> WebKitCSSMatrix::inverse(ExceptionCode& ec) const
diff --git a/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp b/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp
index f7742a3..8385b7e 100644
--- a/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp
+++ b/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp
@@ -434,9 +434,7 @@ void LayerChromium::drawTexturedQuad(GraphicsContext3D* context, const Transform
     renderMatrix.scale3d(width, height, 1);
 
     // Apply the projection matrix before sending the transform over to the shader.
-    renderMatrix.multiply(projectionMatrix);
-
-    toGLMatrix(&glMatrix[0], renderMatrix);
+    toGLMatrix(&glMatrix[0], projectionMatrix * renderMatrix);
 
     GLC(context, context->uniformMatrix4fv(matrixLocation, false, &glMatrix[0], 1));
 
@@ -458,8 +456,7 @@ void LayerChromium::drawDebugBorder()
     layerRenderer()->useShader(sv->borderShaderProgram());
     TransformationMatrix renderMatrix = drawTransform();
     renderMatrix.scale3d(bounds().width(), bounds().height(), 1);
-    renderMatrix.multiply(layerRenderer()->projectionMatrix());
-    toGLMatrix(&glMatrix[0], renderMatrix);
+    toGLMatrix(&glMatrix[0], layerRenderer()->projectionMatrix() * renderMatrix);
     GraphicsContext3D* context = layerRendererContext();
     GLC(context, context->uniformMatrix4fv(sv->borderShaderMatrixLocation(), false, &glMatrix[0], 1));
 
diff --git a/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp b/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
index dd36aa8..601f13c 100644
--- a/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
+++ b/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
@@ -387,7 +387,7 @@ bool LayerRendererChromium::isLayerVisible(LayerChromium* layer, const Transform
     // bounds into clip space.
     TransformationMatrix renderMatrix = matrix;
     renderMatrix.scale3d(layer->bounds().width(), layer->bounds().height(), 1);
-    renderMatrix.multiply(m_projectionMatrix);
+    renderMatrix = m_projectionMatrix * renderMatrix;
 
     FloatRect layerRect(-0.5, -0.5, 1, 1);
     FloatRect mappedRect = renderMatrix.mapRect(layerRect);
@@ -433,12 +433,12 @@ void LayerRendererChromium::updateLayersRecursive(LayerChromium* layer, const Tr
     // LT = Tr[l]
     layerLocalTransform.translate3d(position.x(), position.y(), layer->anchorPointZ());
     // LT = Tr[l] * M[l]
-    layerLocalTransform.multLeft(layer->transform());
+    layerLocalTransform.multiply(layer->transform());
     // LT = Tr[l] * M[l] * Tr[c]
     layerLocalTransform.translate3d(centerOffsetX, centerOffsetY, -layer->anchorPointZ());
 
     TransformationMatrix combinedTransform = parentMatrix;
-    combinedTransform = combinedTransform.multLeft(layerLocalTransform);
+    combinedTransform = combinedTransform.multiply(layerLocalTransform);
 
     FloatRect layerRect(-0.5 * layer->bounds().width(), -0.5 * layer->bounds().height(), layer->bounds().width(), layer->bounds().height());
     IntRect transformedLayerRect;
@@ -548,7 +548,7 @@ void LayerRendererChromium::updateLayersRecursive(LayerChromium* layer, const Tr
     }
 
     // Apply the sublayer transform at the center of the layer.
-    sublayerMatrix.multLeft(layer->sublayerTransform());
+    sublayerMatrix.multiply(layer->sublayerTransform());
 
     // The origin of the sublayers is the top left corner of the layer, not the
     // center. The matrix passed down to the sublayers is therefore:
diff --git a/Source/WebCore/platform/graphics/opengl/TextureMapperGL.cpp b/Source/WebCore/platform/graphics/opengl/TextureMapperGL.cpp
index 03f9b7c..2e2082d 100644
--- a/Source/WebCore/platform/graphics/opengl/TextureMapperGL.cpp
+++ b/Source/WebCore/platform/graphics/opengl/TextureMapperGL.cpp
@@ -390,7 +390,7 @@ void TextureMapperGL::drawTexture(const BitmapTexture& texture, const IntRect& t
     const GLfloat unitRect[] = {0, 0, 1, 0, 1, 1, 0, 1};
     GL_CMD(glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, 0, unitRect))
 
-    TransformationMatrix matrix = TransformationMatrix(data().projectionMatrix).multLeft(modelViewMatrix).multLeft(TransformationMatrix(
+    TransformationMatrix matrix = TransformationMatrix(data().projectionMatrix).multiply(modelViewMatrix).multiply(TransformationMatrix(
             targetRect.width(), 0, 0, 0,
             0, targetRect.height(), 0, 0,
             0, 0, 1, 0,
@@ -606,7 +606,7 @@ void TextureMapperGL::paintToTarget(const BitmapTexture& aSurface, const IntSize
     const BitmapTextureGL& surface = static_cast<const BitmapTextureGL&>(aSurface);
 
     // Create the model-view-projection matrix to display on screen.
-    TransformationMatrix matrix = createProjectionMatrix(surfaceSize, true).multLeft(transform).multLeft(
+    TransformationMatrix matrix = createProjectionMatrix(surfaceSize, true).multiply(transform).multiply(
                 TransformationMatrix(
                         surface.m_actualSize.width(), 0, 0, 0,
                         0, surface.m_actualSize.height(), 0, 0,
diff --git a/Source/WebCore/platform/graphics/qt/GraphicsLayerQt.cpp b/Source/WebCore/platform/graphics/qt/GraphicsLayerQt.cpp
index 75fb427..2386523 100644
--- a/Source/WebCore/platform/graphics/qt/GraphicsLayerQt.cpp
+++ b/Source/WebCore/platform/graphics/qt/GraphicsLayerQt.cpp
@@ -529,12 +529,12 @@ void GraphicsLayerQtImpl::updateTransform()
     // have to maintain that ourselves for 3D.
     localTransform
             .translate3d(originX + m_state.pos.x(), originY + m_state.pos.y(), m_state.anchorPoint.z())
-            .multLeft(m_baseTransform)
+            .multiply(m_baseTransform)
             .translate3d(-originX, -originY, -m_state.anchorPoint.z());
 
     // This is the actual 3D transform of this item, with the ancestors' transform baked in.
     m_transformRelativeToRootLayer = TransformationMatrix(parent ? parent->m_transformRelativeToRootLayer : TransformationMatrix())
-                                         .multLeft(localTransform);
+                                         .multiply(localTransform);
 
     // Now we have enough information to determine if the layer is facing backwards.
     if (!m_state.backfaceVisibility && m_transformRelativeToRootLayer.inverse().m33() < 0) {
@@ -562,7 +562,7 @@ void GraphicsLayerQtImpl::updateTransform()
     if (!m_state.childrenTransform.isIdentity()) {
         m_transformRelativeToRootLayer
             .translate(m_size.width() / 2, m_size.height() /2)
-            .multLeft(m_state.childrenTransform)
+            .multiply(m_state.childrenTransform)
             .translate(-m_size.width() / 2, -m_size.height() /2);
     }
 
diff --git a/Source/WebCore/platform/graphics/texmap/TextureMapperNode.cpp b/Source/WebCore/platform/graphics/texmap/TextureMapperNode.cpp
index 09051f9..bf53e61 100644
--- a/Source/WebCore/platform/graphics/texmap/TextureMapperNode.cpp
+++ b/Source/WebCore/platform/graphics/texmap/TextureMapperNode.cpp
@@ -318,7 +318,7 @@ void TextureMapperNode::computeLocalTransform()
     m_transforms.local =
         TransformationMatrix()
         .translate3d(originX + m_state.pos.x(), originY + m_state.pos.y(), m_state.anchorPoint.z())
-        .multLeft(m_state.transform)
+        .multiply(m_state.transform)
         .translate3d(-originX, -originY, -m_state.anchorPoint.z());
     m_transforms.localDirty = false;
 }
@@ -352,7 +352,7 @@ void TextureMapperNode::computeReplicaTransform()
     m_nearestSurfaceSize = nearestSurfaceSize();
 
     if (m_layerType != TransparencyLayer) {
-        m_transforms.replica = TransformationMatrix(m_transforms.target).multLeft(m_state.replicaLayer->m_transforms.local);
+        m_transforms.replica = TransformationMatrix(m_transforms.target).multiply(m_state.replicaLayer->m_transforms.local);
         return;
     }
 
@@ -361,7 +361,7 @@ void TextureMapperNode::computeReplicaTransform()
     m_transforms.replica =
             TransformationMatrix()
                 .translate(originX, originY)
-                .multLeft(m_state.replicaLayer->m_transforms.local)
+                .multiply(m_state.replicaLayer->m_transforms.local)
                 .translate(-originX, -originY);
 }
 
@@ -377,7 +377,7 @@ void TextureMapperNode::computeTransformations()
     TextureMapperNode* parent = m_parent;
     computeLocalTransform();
 
-    m_transforms.target = TransformationMatrix(parent ? parent->m_transforms.forDescendants : TransformationMatrix()).multLeft(m_transforms.local);
+    m_transforms.target = TransformationMatrix(parent ? parent->m_transforms.forDescendants : TransformationMatrix()).multiply(m_transforms.local);
     m_transforms.forDescendants = (m_layerType == ClipLayer ? TransformationMatrix() : m_transforms.target);
 
     if (m_effectTarget)
@@ -408,10 +408,10 @@ void TextureMapperNode::computeTransformations()
     if (m_transforms.perspectiveDirty)
         m_transforms.perspective = TransformationMatrix()
             .translate(centerPoint.x(), centerPoint.y())
-            .multLeft(m_state.childrenTransform)
+            .multiply(m_state.childrenTransform)
             .translate(-centerPoint.x(), -centerPoint.y());
     m_transforms.perspectiveDirty = false;
-    m_transforms.forDescendants.multLeft(m_transforms.perspective);
+    m_transforms.forDescendants.multiply(m_transforms.perspective);
 }
 
 void TextureMapperNode::uploadTextureFromContent(TextureMapper* textureMapper, const IntRect& visibleRect, GraphicsLayer* layer)
diff --git a/Source/WebCore/platform/graphics/transforms/Matrix3DTransformOperation.h b/Source/WebCore/platform/graphics/transforms/Matrix3DTransformOperation.h
index 0a0aaf0..dd5dae2 100644
--- a/Source/WebCore/platform/graphics/transforms/Matrix3DTransformOperation.h
+++ b/Source/WebCore/platform/graphics/transforms/Matrix3DTransformOperation.h
@@ -55,7 +55,7 @@ private:
 
     virtual bool apply(TransformationMatrix& transform, const IntSize&) const
     {
-        transform.multLeft(TransformationMatrix(m_matrix));
+        transform.multiply(TransformationMatrix(m_matrix));
         return false;
     }
 
diff --git a/Source/WebCore/platform/graphics/transforms/MatrixTransformOperation.h b/Source/WebCore/platform/graphics/transforms/MatrixTransformOperation.h
index fd9b27e..6f4e725 100644
--- a/Source/WebCore/platform/graphics/transforms/MatrixTransformOperation.h
+++ b/Source/WebCore/platform/graphics/transforms/MatrixTransformOperation.h
@@ -62,7 +62,7 @@ private:
     virtual bool apply(TransformationMatrix& transform, const IntSize&) const
     {
         TransformationMatrix matrix(m_a, m_b, m_c, m_d, m_e, m_f);
-        transform.multLeft(TransformationMatrix(matrix));
+        transform.multiply(matrix);
         return false;
     }
 
diff --git a/Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp b/Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp
index 357a140..c7283a5 100644
--- a/Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp
+++ b/Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp
@@ -55,21 +55,17 @@ namespace WebCore {
 // webmasters - are to be held responsible. Basically, don't be a jerk, and remember that anything free comes 
 // with no guarantee.
 
-// A Note About row-major vs. column major matrixes
+// A clarification about the storage of matrix elements
 //
-// The clients of this class (CSSMatrix and SVGMatrix) assume a column-major ordering.
-// That means that when the matrix is initialized with 16 values, the first 4 values
-// go in the 4 rows of the first column, etc. And in the dereferencing calls, the first
-// digit is the column (e.g., m23() is column 2 row 3). Because C++ uses row-major arrays 
-// the internal matrix is stored in row-major order, so m[2][0] means row 2, column 0. This
-// has no bearing on how the matrix is viewed on the outside, since all access is done
-// with function calls. But it does help make the code more clear if you know that.
+// This class uses a 2 dimensional array internally to store the elements of the matrix.  The first index into 
+// the array refers to the column that the element lies in; the second index refers to the row.
 //
-// FIXME: Multiply calls are named for what they do in the internal, row-major world. 
-// multLeft is actually a multRight in a column-major world, and multiply is a multLeft 
-// in a column-major world. For now I've left it that way to avoid too many confusing 
-// changes to the code. In particular AffineTransform uses these same terms for the
-// opposite operations. So we have to be VERY careful when we change them.
+// In other words, this is the layout of the matrix:
+//
+// | m_matrix[0][0] m_matrix[1][0] m_matrix[2][0] m_matrix[3][0] |
+// | m_matrix[0][1] m_matrix[1][1] m_matrix[2][1] m_matrix[3][1] |
+// | m_matrix[0][2] m_matrix[1][2] m_matrix[2][2] m_matrix[3][2] |
+// | m_matrix[0][3] m_matrix[1][3] m_matrix[2][3] m_matrix[3][3] |
 
 typedef double Vector4[4];
 typedef double Vector3[3];
@@ -634,7 +630,7 @@ TransformationMatrix& TransformationMatrix::scaleNonUniform(double sx, double sy
     mat.m_matrix[0][0] = sx;
     mat.m_matrix[1][1] = sy;
 
-    multLeft(mat);
+    multiply(mat);
     return *this;
 }
 
@@ -645,7 +641,7 @@ TransformationMatrix& TransformationMatrix::scale3d(double sx, double sy, double
     mat.m_matrix[1][1] = sy;
     mat.m_matrix[2][2] = sz;
 
-    multLeft(mat);
+    multiply(mat);
     return *this;
 }
 
@@ -732,7 +728,7 @@ TransformationMatrix& TransformationMatrix::rotate3d(double x, double y, double
         mat.m_matrix[3][0] = mat.m_matrix[3][1] = mat.m_matrix[3][2] = 0.0f;
         mat.m_matrix[3][3] = 1.0f;
     }
-    multLeft(mat);
+    multiply(mat);
     return *this;
 }
 
@@ -783,7 +779,7 @@ TransformationMatrix& TransformationMatrix::rotate3d(double rx, double ry, doubl
     mat.m_matrix[3][0] = mat.m_matrix[3][1] = mat.m_matrix[3][2] = 0.0f;
     mat.m_matrix[3][3] = 1.0f;
     
-    rmat.multLeft(mat);
+    rmat.multiply(mat);
 
     rx /= 2.0f;
     sinA = sin(rx);
@@ -803,9 +799,9 @@ TransformationMatrix& TransformationMatrix::rotate3d(double rx, double ry, doubl
     mat.m_matrix[3][0] = mat.m_matrix[3][1] = mat.m_matrix[3][2] = 0.0f;
     mat.m_matrix[3][3] = 1.0f;
     
-    rmat.multLeft(mat);
+    rmat.multiply(mat);
 
-    multLeft(rmat);
+    multiply(rmat);
     return *this;
 }
 
@@ -869,7 +865,7 @@ TransformationMatrix& TransformationMatrix::skew(double sx, double sy)
     mat.m_matrix[0][1] = tan(sy); // note that the y shear goes in the first row
     mat.m_matrix[1][0] = tan(sx); // and the x shear in the second row
 
-    multLeft(mat);
+    multiply(mat);
     return *this;
 }
 
@@ -879,7 +875,7 @@ TransformationMatrix& TransformationMatrix::applyPerspective(double p)
     if (p != 0)
         mat.m_matrix[2][3] = -1/p;
 
-    multLeft(mat);
+    multiply(mat);
     return *this;
 }
 
@@ -896,7 +892,7 @@ TransformationMatrix TransformationMatrix::rectToRect(const FloatRect& from, con
 //
 // *this = mat * *this
 //
-TransformationMatrix& TransformationMatrix::multLeft(const TransformationMatrix& mat)
+TransformationMatrix& TransformationMatrix::multiply(const TransformationMatrix& mat)
 {
     Matrix4 tmp;
     
@@ -1105,25 +1101,25 @@ void TransformationMatrix::recompose(const DecomposedType& decomp)
                            2 * (xz - yw), 2 * (yz + xw), 1 - 2 * (xx + yy), 0,
                            0, 0, 0, 1);
     
-    multLeft(rotationMatrix);
+    multiply(rotationMatrix);
     
     // now apply skew
     if (decomp.skewYZ) {
         TransformationMatrix tmp;
         tmp.setM32((float) decomp.skewYZ);
-        multLeft(tmp);
+        multiply(tmp);
     }
     
     if (decomp.skewXZ) {
         TransformationMatrix tmp;
         tmp.setM31((float) decomp.skewXZ);
-        multLeft(tmp);
+        multiply(tmp);
     }
     
     if (decomp.skewXY) {
         TransformationMatrix tmp;
         tmp.setM21((float) decomp.skewXY);
-        multLeft(tmp);
+        multiply(tmp);
     }
     
     // finally, apply scale
diff --git a/Source/WebCore/platform/graphics/transforms/TransformationMatrix.h b/Source/WebCore/platform/graphics/transforms/TransformationMatrix.h
index c883675..fa27c0e 100644
--- a/Source/WebCore/platform/graphics/transforms/TransformationMatrix.h
+++ b/Source/WebCore/platform/graphics/transforms/TransformationMatrix.h
@@ -208,11 +208,8 @@ public:
     void setF(double f) { m_matrix[3][1] = f; }
 
     // this = this * mat
-    TransformationMatrix& multiply(const TransformationMatrix& t) { return *this *= t; }
+    TransformationMatrix& multiply(const TransformationMatrix&);
 
-    // this = mat * this
-    TransformationMatrix& multLeft(const TransformationMatrix& mat);
-    
     TransformationMatrix& scale(double);
     TransformationMatrix& scaleNonUniform(double sx, double sy);
     TransformationMatrix& scale3d(double sx, double sy, double sz);
@@ -296,19 +293,18 @@ public:
     }
 
     bool operator!=(const TransformationMatrix& other) const { return !(*this == other); }
-    
-    // *this = *this * t (i.e., a multRight)
+
+    // *this = *this * t
     TransformationMatrix& operator*=(const TransformationMatrix& t)
     {
-        *this = *this * t;
-        return *this;
+        return multiply(t);
     }
     
-    // result = *this * t (i.e., a multRight)
+    // result = *this * t
     TransformationMatrix operator*(const TransformationMatrix& t) const
     {
-        TransformationMatrix result = t;
-        result.multLeft(*this);
+        TransformationMatrix result = *this;
+        result.multiply(t);
         return result;
     }
 
diff --git a/Source/WebCore/rendering/RenderLayer.cpp b/Source/WebCore/rendering/RenderLayer.cpp
index 94a1d90..ac07296 100644
--- a/Source/WebCore/rendering/RenderLayer.cpp
+++ b/Source/WebCore/rendering/RenderLayer.cpp
@@ -945,7 +945,7 @@ static IntRect transparencyClipBox(const RenderLayer* l, const RenderLayer* root
 
         TransformationMatrix transform;
         transform.translate(x, y);
-        transform = *l->transform() * transform;
+        transform = transform * *l->transform();
 
         IntRect clipRect = l->boundingBox(l);
         expandClipRectForDescendantsAndReflection(clipRect, l, l, paintBehavior);
diff --git a/Source/WebCore/rendering/RenderObject.cpp b/Source/WebCore/rendering/RenderObject.cpp
index 5b39e0d..cfaa65d 100644
--- a/Source/WebCore/rendering/RenderObject.cpp
+++ b/Source/WebCore/rendering/RenderObject.cpp
@@ -1986,7 +1986,7 @@ void RenderObject::getTransformFromContainer(const RenderObject* containerObject
     transform.translate(offsetInContainer.width(), offsetInContainer.height());
     RenderLayer* layer;
     if (hasLayer() && (layer = toRenderBoxModelObject(this)->layer()) && layer->transform())
-        transform.multLeft(layer->currentTransform());
+        transform.multiply(layer->currentTransform());
     
 #if ENABLE(3D_RENDERING)
     if (containerObject && containerObject->hasLayer() && containerObject->style()->hasPerspective()) {
@@ -1998,7 +1998,7 @@ void RenderObject::getTransformFromContainer(const RenderObject* containerObject
         perspectiveMatrix.applyPerspective(containerObject->style()->perspective());
         
         transform.translateRight3d(-perspectiveOrigin.x(), -perspectiveOrigin.y(), 0);
-        transform.multiply(perspectiveMatrix);
+        transform = perspectiveMatrix * transform;
         transform.translateRight3d(perspectiveOrigin.x(), perspectiveOrigin.y(), 0);
     }
 #else
diff --git a/Source/WebCore/rendering/TransformState.cpp b/Source/WebCore/rendering/TransformState.cpp
index ecc614e..9f177ea 100644
--- a/Source/WebCore/rendering/TransformState.cpp
+++ b/Source/WebCore/rendering/TransformState.cpp
@@ -60,9 +60,9 @@ void TransformState::applyTransform(const TransformationMatrix& transformFromCon
     // If we have an accumulated transform from last time, multiply in this transform
     if (m_accumulatedTransform) {
         if (m_direction == ApplyTransformDirection)
-            m_accumulatedTransform->multiply(transformFromContainer);
+            m_accumulatedTransform.set(new TransformationMatrix(transformFromContainer * *m_accumulatedTransform));
         else
-            m_accumulatedTransform->multLeft(transformFromContainer);
+            m_accumulatedTransform->multiply(transformFromContainer);
     } else if (accumulate == AccumulateTransform) {
         // Make one if we started to accumulate
         m_accumulatedTransform.set(new TransformationMatrix(transformFromContainer));
@@ -140,7 +140,7 @@ void HitTestingTransformState::translate(int x, int y, TransformAccumulation acc
 
 void HitTestingTransformState::applyTransform(const TransformationMatrix& transformFromContainer, TransformAccumulation accumulate)
 {
-    m_accumulatedTransform.multLeft(transformFromContainer);    
+    m_accumulatedTransform.multiply(transformFromContainer);
     if (accumulate == FlattenTransform)
         flattenWithTransform(m_accumulatedTransform);
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list