summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform/graphics
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2011-05-19 11:11:13 +0100
committerSteve Block <steveblock@google.com>2011-05-25 15:27:18 +0100
commitf68e15471b3701aa588af98e9a0308b202381151 (patch)
treef9bcd31e811c5c32811242e26efbfd6c3c2bd5d9 /Source/WebCore/platform/graphics
parentfa3930915cc4aeb95cd6d07f8ad0ae48e83f735a (diff)
downloadexternal_webkit-f68e15471b3701aa588af98e9a0308b202381151.zip
external_webkit-f68e15471b3701aa588af98e9a0308b202381151.tar.gz
external_webkit-f68e15471b3701aa588af98e9a0308b202381151.tar.bz2
Merge WebKit at r78450: TransformationMatrix multiply methods renamed and meaning changed
See http://trac.webkit.org/changeset/76537 Change-Id: I543c68101d4ee83d190f643e54e4f3fec1fdf238
Diffstat (limited to 'Source/WebCore/platform/graphics')
-rw-r--r--Source/WebCore/platform/graphics/android/LayerAndroid.cpp4
-rw-r--r--Source/WebCore/platform/graphics/android/ShaderProgram.cpp40
2 files changed, 18 insertions, 26 deletions
diff --git a/Source/WebCore/platform/graphics/android/LayerAndroid.cpp b/Source/WebCore/platform/graphics/android/LayerAndroid.cpp
index 95ccedc..115a044 100644
--- a/Source/WebCore/platform/graphics/android/LayerAndroid.cpp
+++ b/Source/WebCore/platform/graphics/android/LayerAndroid.cpp
@@ -600,7 +600,7 @@ void LayerAndroid::updateGLPositions(const TransformationMatrix& parentMatrix,
localMatrix.translate3d(originX + position.x(),
originY + position.y(),
anchorPointZ());
- localMatrix.multLeft(m_transform);
+ localMatrix.multiply(m_transform);
localMatrix.translate3d(-originX,
-originY,
-anchorPointZ());
@@ -648,7 +648,7 @@ void LayerAndroid::updateGLPositions(const TransformationMatrix& parentMatrix,
if (!m_childrenTransform.isIdentity()) {
localMatrix.translate(getSize().width() * 0.5f, getSize().height() * 0.5f);
- localMatrix.multLeft(m_childrenTransform);
+ localMatrix.multiply(m_childrenTransform);
localMatrix.translate(-getSize().width() * 0.5f, -getSize().height() * 0.5f);
}
for (int i = 0; i < count; i++)
diff --git a/Source/WebCore/platform/graphics/android/ShaderProgram.cpp b/Source/WebCore/platform/graphics/android/ShaderProgram.cpp
index 6933890..7a69853 100644
--- a/Source/WebCore/platform/graphics/android/ShaderProgram.cpp
+++ b/Source/WebCore/platform/graphics/android/ShaderProgram.cpp
@@ -224,9 +224,7 @@ void ShaderProgram::setProjectionMatrix(SkRect& geometry)
TransformationMatrix scale;
scale.scale3d(geometry.width(), geometry.height(), 1.0);
- TransformationMatrix total = m_projectionMatrix;
- total.multLeft(translate);
- total.multLeft(scale);
+ TransformationMatrix total = m_projectionMatrix * translate * scale;
GLfloat projectionMatrix[16];
GLUtils::toGLMatrix(projectionMatrix, total);
@@ -264,14 +262,10 @@ void ShaderProgram::setViewRect(const IntRect& viewRect)
TransformationMatrix scale;
scale.scale3d(m_viewRect.width() * 0.5f, m_viewRect.height() * 0.5f, 1);
- m_documentToScreenMatrix = m_projectionMatrix;
- m_documentToScreenMatrix.multiply(translate);
- m_documentToScreenMatrix.multiply(scale);
+ m_documentToScreenMatrix = scale * translate * m_projectionMatrix;
- m_documentToInvScreenMatrix = m_projectionMatrix;
translate.scale3d(1, -1, 1);
- m_documentToInvScreenMatrix.multiply(translate);
- m_documentToInvScreenMatrix.multiply(scale);
+ m_documentToInvScreenMatrix = scale * translate * m_projectionMatrix;
}
// This function transform a clip rect extracted from the current layer
@@ -279,8 +273,7 @@ void ShaderProgram::setViewRect(const IntRect& viewRect)
FloatRect ShaderProgram::rectInScreenCoord(const TransformationMatrix& drawMatrix, const IntSize& size)
{
FloatRect srect(0, 0, size.width(), size.height());
- TransformationMatrix renderMatrix = drawMatrix;
- renderMatrix.multiply(m_documentToScreenMatrix);
+ TransformationMatrix renderMatrix = m_documentToScreenMatrix * drawMatrix;
return renderMatrix.mapRect(srect);
}
@@ -288,8 +281,7 @@ FloatRect ShaderProgram::rectInScreenCoord(const TransformationMatrix& drawMatri
FloatRect ShaderProgram::rectInInvScreenCoord(const TransformationMatrix& drawMatrix, const IntSize& size)
{
FloatRect srect(0, 0, size.width(), size.height());
- TransformationMatrix renderMatrix = drawMatrix;
- renderMatrix.multiply(m_documentToInvScreenMatrix);
+ TransformationMatrix renderMatrix = m_documentToInvScreenMatrix * drawMatrix;
return renderMatrix.mapRect(srect);
}
@@ -375,9 +367,9 @@ IntRect ShaderProgram::clippedRectWithViewport(const IntRect& rect, int margin)
float ShaderProgram::zValue(const TransformationMatrix& drawMatrix, float w, float h)
{
- TransformationMatrix renderMatrix = drawMatrix;
- renderMatrix.scale3d(w, h, 1);
- renderMatrix.multiply(m_projectionMatrix);
+ TransformationMatrix modifiedDrawMatrix = drawMatrix;
+ modifiedDrawMatrix.scale3d(w, h, 1);
+ TransformationMatrix renderMatrix = m_projectionMatrix * modifiedDrawMatrix;
FloatPoint3D point(0.5, 0.5, 0.0);
FloatPoint3D result = renderMatrix.mapPoint(point);
return result.z();
@@ -388,11 +380,11 @@ void ShaderProgram::drawLayerQuad(const TransformationMatrix& drawMatrix,
bool forceBlending)
{
- TransformationMatrix renderMatrix = drawMatrix;
+ TransformationMatrix modifiedDrawMatrix = drawMatrix;
// move the drawing depending on where the texture is on the layer
- renderMatrix.translate(geometry.fLeft, geometry.fTop);
- renderMatrix.scale3d(geometry.width(), geometry.height(), 1);
- renderMatrix.multiply(m_projectionMatrix);
+ modifiedDrawMatrix.translate(geometry.fLeft, geometry.fTop);
+ modifiedDrawMatrix.scale3d(geometry.width(), geometry.height(), 1);
+ TransformationMatrix renderMatrix = m_projectionMatrix * modifiedDrawMatrix;
GLfloat projectionMatrix[16];
GLUtils::toGLMatrix(projectionMatrix, renderMatrix);
@@ -417,10 +409,10 @@ void ShaderProgram::drawVideoLayerQuad(const TransformationMatrix& drawMatrix,
// switch to our custom yuv video rendering program
glUseProgram(m_videoProgram);
- TransformationMatrix renderMatrix = drawMatrix;
- renderMatrix.translate(geometry.fLeft, geometry.fTop);
- renderMatrix.scale3d(geometry.width(), geometry.height(), 1);
- renderMatrix.multiply(m_projectionMatrix);
+ TransformationMatrix modifiedDrawMatrix = drawMatrix;
+ modifiedDrawMatrix.translate(geometry.fLeft, geometry.fTop);
+ modifiedDrawMatrix.scale3d(geometry.width(), geometry.height(), 1);
+ TransformationMatrix renderMatrix = m_projectionMatrix * modifiedDrawMatrix;
GLfloat projectionMatrix[16];
GLUtils::toGLMatrix(projectionMatrix, renderMatrix);