summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform/graphics/android
diff options
context:
space:
mode:
authorTeng-Hui Zhu <ztenghui@google.com>2011-09-06 15:08:57 -0700
committerTeng-Hui Zhu <ztenghui@google.com>2011-09-06 15:10:16 -0700
commit4327ba9cc6a31e1bdcf647fa2b185f5bbd45f2d2 (patch)
treed68f60d867ef6fa48bdb89cec2a3f861e3eeeb59 /Source/WebCore/platform/graphics/android
parent8ad3ab0e47f0d5039e89c1873c178f538ec1b0df (diff)
downloadexternal_webkit-4327ba9cc6a31e1bdcf647fa2b185f5bbd45f2d2.zip
external_webkit-4327ba9cc6a31e1bdcf647fa2b185f5bbd45f2d2.tar.gz
external_webkit-4327ba9cc6a31e1bdcf647fa2b185f5bbd45f2d2.tar.bz2
Revert "WebView animation support"
This reverts commit 078f4452393311da6165131451fcf86e04e04f25. bug:5264188 Change-Id: I3dd6cf46a168893aa3067615f2f0f902c6f66d74
Diffstat (limited to 'Source/WebCore/platform/graphics/android')
-rw-r--r--Source/WebCore/platform/graphics/android/GLWebViewState.cpp2
-rw-r--r--Source/WebCore/platform/graphics/android/ShaderProgram.cpp36
-rw-r--r--Source/WebCore/platform/graphics/android/ShaderProgram.h6
3 files changed, 5 insertions, 39 deletions
diff --git a/Source/WebCore/platform/graphics/android/GLWebViewState.cpp b/Source/WebCore/platform/graphics/android/GLWebViewState.cpp
index f030e52..d85d8b7 100644
--- a/Source/WebCore/platform/graphics/android/GLWebViewState.cpp
+++ b/Source/WebCore/platform/graphics/android/GLWebViewState.cpp
@@ -473,7 +473,7 @@ double GLWebViewState::setupDrawing(IntRect& viewRect, SkRect& visibleRect,
glUseProgram(shader->program());
glUniform1i(shader->textureSampler(), 0);
shader->setViewRect(viewRect);
- shader->setViewport(visibleRect, scale);
+ shader->setViewport(visibleRect);
shader->setWebViewRect(webViewRect);
shader->setTitleBarHeight(titleBarHeight);
shader->setScreenClip(screenClip);
diff --git a/Source/WebCore/platform/graphics/android/ShaderProgram.cpp b/Source/WebCore/platform/graphics/android/ShaderProgram.cpp
index 536d228..bf5f760 100644
--- a/Source/WebCore/platform/graphics/android/ShaderProgram.cpp
+++ b/Source/WebCore/platform/graphics/android/ShaderProgram.cpp
@@ -235,8 +235,6 @@ void ShaderProgram::init()
glBufferData(GL_ARRAY_BUFFER, 2 * 4 * sizeof(GLfloat), coord, GL_STATIC_DRAW);
GLUtils::checkGlError("init");
-
- memset(m_webViewMatrix, 0, sizeof(m_webViewMatrix));
}
void ShaderProgram::resetBlending()
@@ -264,14 +262,13 @@ void ShaderProgram::setBlendingState(bool enableBlending)
// Drawing
/////////////////////////////////////////////////////////////////////////////////////////
-void ShaderProgram::setViewport(SkRect& viewport, float scale)
+void ShaderProgram::setViewport(SkRect& viewport)
{
TransformationMatrix ortho;
GLUtils::setOrthographicMatrix(ortho, viewport.fLeft, viewport.fTop,
viewport.fRight, viewport.fBottom, -1000, 1000);
m_projectionMatrix = ortho;
m_viewport = viewport;
- m_currentScale = scale;
}
void ShaderProgram::setProjectionMatrix(SkRect& geometry, GLint projectionMatrixHandle)
@@ -280,29 +277,8 @@ void ShaderProgram::setProjectionMatrix(SkRect& geometry, GLint projectionMatrix
translate.translate3d(geometry.fLeft, geometry.fTop, 0.0);
TransformationMatrix scale;
scale.scale3d(geometry.width(), geometry.height(), 1.0);
- // Translate float* to TransformationMatrix
- TransformationMatrix webViewTransformMatrix(
- m_webViewMatrix[0], m_webViewMatrix[1], m_webViewMatrix[2], m_webViewMatrix[3],
- m_webViewMatrix[4], m_webViewMatrix[5], m_webViewMatrix[6], m_webViewMatrix[7],
- m_webViewMatrix[8], m_webViewMatrix[9], m_webViewMatrix[10], m_webViewMatrix[11],
- m_webViewMatrix[12], m_webViewMatrix[13], m_webViewMatrix[14], m_webViewMatrix[15] );
-
-
- TransformationMatrix reposition;
- // After the webViewTranform, we need to reposition the rect to match our viewport.
- reposition.translate3d(-m_webViewRect.x(), -m_webViewRect.y() - m_titleBarHeight, 0);
- reposition.translate3d(m_viewport.fLeft * m_currentScale, m_viewport.fTop * m_currentScale, 0);
-
- // Basically, the webViewTransformMatrix should apply on the screen resolution.
- // So we start by doing the scale and translate to get each tile into screen coordinates.
- // After applying the webViewTransformMatrix, b/c the way it currently set up
- // for scroll and titlebar, we need to offset both of them.
- // Finally, map everything back to (-1, 1) by using the m_projectionMatrix.
- // TODO: Given that webViewTransformMatrix contains most of the tranformation
- // information, we should be able to get rid of some parameter we got from
- // Java side and simplify our code.
- TransformationMatrix total =
- m_projectionMatrix * reposition * webViewTransformMatrix * translate * scale;
+
+ TransformationMatrix total = m_projectionMatrix * translate * scale;
GLfloat projectionMatrix[16];
GLUtils::toGLMatrix(projectionMatrix, total);
@@ -597,12 +573,6 @@ void ShaderProgram::drawVideoLayerQuad(const TransformationMatrix& drawMatrix,
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
}
-void ShaderProgram::setWebViewMatrix(float* matrix)
-{
- if (matrix)
- memcpy(m_webViewMatrix, matrix, sizeof(m_webViewMatrix));
-}
-
} // namespace WebCore
#endif // USE(ACCELERATED_COMPOSITING)
diff --git a/Source/WebCore/platform/graphics/android/ShaderProgram.h b/Source/WebCore/platform/graphics/android/ShaderProgram.h
index f31eb91..d8447bf 100644
--- a/Source/WebCore/platform/graphics/android/ShaderProgram.h
+++ b/Source/WebCore/platform/graphics/android/ShaderProgram.h
@@ -39,7 +39,7 @@ public:
int program() { return m_program; }
// Drawing
- void setViewport(SkRect& viewport, float scale);
+ void setViewport(SkRect& viewport);
float zValue(const TransformationMatrix& drawMatrix, float w, float h);
// For drawQuad and drawLayerQuad, they can handle 3 cases for now:
@@ -88,7 +88,6 @@ public:
contrast = MAX_CONTRAST;
m_contrast = contrast;
}
- void setWebViewMatrix(float* matrix);
private:
GLuint loadShader(GLenum shaderType, const char* pSource);
@@ -150,9 +149,6 @@ private:
// attribs
GLint m_hPosition;
GLint m_hVideoPosition;
-
- float m_webViewMatrix[16];
- float m_currentScale;
};
} // namespace WebCore