summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform/graphics/android
diff options
context:
space:
mode:
authorTeng-Hui Zhu <ztenghui@google.com>2011-08-12 10:46:50 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-08-12 10:46:50 -0700
commita19896cc5d9573a17b6ec206befb3b4ec6b2256b (patch)
tree9ccdc3fcdaae9508b298c7080b07952bd509f319 /Source/WebCore/platform/graphics/android
parent6a94579dab1dca12e6555b01602efeb5debda17a (diff)
parent636c5a458623db421be4ffd3b387031014d55f6b (diff)
downloadexternal_webkit-a19896cc5d9573a17b6ec206befb3b4ec6b2256b.zip
external_webkit-a19896cc5d9573a17b6ec206befb3b4ec6b2256b.tar.gz
external_webkit-a19896cc5d9573a17b6ec206befb3b4ec6b2256b.tar.bz2
Merge "Remove old code handling SurfTex RGBA in 2D mode"
Diffstat (limited to 'Source/WebCore/platform/graphics/android')
-rw-r--r--Source/WebCore/platform/graphics/android/ShaderProgram.cpp73
-rw-r--r--Source/WebCore/platform/graphics/android/ShaderProgram.h12
-rw-r--r--Source/WebCore/platform/graphics/android/TextureInfo.h1
3 files changed, 0 insertions, 86 deletions
diff --git a/Source/WebCore/platform/graphics/android/ShaderProgram.cpp b/Source/WebCore/platform/graphics/android/ShaderProgram.cpp
index c9d2d56..bf5f760 100644
--- a/Source/WebCore/platform/graphics/android/ShaderProgram.cpp
+++ b/Source/WebCore/platform/graphics/android/ShaderProgram.cpp
@@ -81,37 +81,6 @@ static const char gVideoFragmentShader[] =
" gl_FragColor = texture2D(s_yuvTexture, v_texCoord);\n"
"}\n";
-// In the long run, the gSurfaceTextureOESFragmentShader is the official way of
-// doing Surface Texture for RGBA format.
-// Now since the driver is not ready for it yet, we had to support both to be
-// ready for the switch.
-// TODO: remove SurfaceTexture2D support after switching to OES method.
-static const char gSurfaceTexture2DFragmentShader[] =
- "#extension GL_OES_EGL_image_external : require\n"
- "precision mediump float;\n"
- "varying vec2 v_texCoord; \n"
- "uniform float alpha; \n"
- "uniform sampler2D s_texture; \n"
- "void main() {\n"
- " gl_FragColor = texture2D(s_texture, v_texCoord); \n"
- " gl_FragColor *= alpha; "
- "}\n";
-
-static const char gSurfaceTexture2DFragmentShaderInverted[] =
- "#extension GL_OES_EGL_image_external : require\n"
- "precision mediump float;\n"
- "varying vec2 v_texCoord; \n"
- "uniform float alpha; \n"
- "uniform sampler2D s_texture; \n"
- "void main() {\n"
- " gl_FragColor = texture2D(s_texture, v_texCoord); \n"
- " float color = 1.0 - (gl_FragColor.r + gl_FragColor.g + gl_FragColor.b) / 3.0; \n"
- " gl_FragColor.r = color; \n"
- " gl_FragColor.g = color; \n"
- " gl_FragColor.b = color; \n"
- " gl_FragColor *= alpha; "
- "}\n";
-
static const char gSurfaceTextureOESFragmentShader[] =
"#extension GL_OES_EGL_image_external : require\n"
"precision mediump float;\n"
@@ -218,10 +187,6 @@ void ShaderProgram::init()
{
m_program = createProgram(gVertexShader, gFragmentShader);
m_videoProgram = createProgram(gVideoVertexShader, gVideoFragmentShader);
- m_surfTex2DProgram =
- createProgram(gVertexShader, gSurfaceTexture2DFragmentShader);
- m_surfTex2DProgramInverted =
- createProgram(gVertexShader, gSurfaceTexture2DFragmentShaderInverted);
m_surfTexOESProgram =
createProgram(gVertexShader, gSurfaceTextureOESFragmentShader);
m_surfTexOESProgramInverted =
@@ -229,8 +194,6 @@ void ShaderProgram::init()
if (m_program == -1
|| m_videoProgram == -1
- || m_surfTex2DProgram == -1
- || m_surfTex2DProgramInverted == -1
|| m_surfTexOESProgram == -1
|| m_surfTexOESProgramInverted == -1)
return;
@@ -246,18 +209,6 @@ void ShaderProgram::init()
m_hVideoTexSampler = glGetUniformLocation(m_videoProgram, "s_yuvTexture");
m_hVideoPosition = glGetAttribLocation(m_program, "vPosition");
- m_hST2DProjectionMatrix =
- glGetUniformLocation(m_surfTex2DProgram, "projectionMatrix");
- m_hST2DAlpha = glGetUniformLocation(m_surfTex2DProgram, "alpha");
- m_hST2DTexSampler = glGetUniformLocation(m_surfTex2DProgram, "s_texture");
- m_hST2DPosition = glGetAttribLocation(m_surfTex2DProgram, "vPosition");
-
- m_hST2DProjectionMatrixInverted =
- glGetUniformLocation(m_surfTex2DProgramInverted, "projectionMatrix");
- m_hST2DAlphaInverted = glGetUniformLocation(m_surfTex2DProgramInverted, "alpha");
- m_hST2DTexSamplerInverted = glGetUniformLocation(m_surfTex2DProgramInverted, "s_texture");
- m_hST2DPositionInverted = glGetAttribLocation(m_surfTex2DProgramInverted, "vPosition");
-
m_hSTOESProjectionMatrix =
glGetUniformLocation(m_surfTexOESProgram, "projectionMatrix");
m_hSTOESAlpha = glGetUniformLocation(m_surfTexOESProgram, "alpha");
@@ -399,18 +350,6 @@ void ShaderProgram::drawQuad(SkRect& geometry, int textureId, float opacity,
m_hSTOESTexSamplerInverted, GL_TEXTURE_EXTERNAL_OES,
m_hSTOESPositionInverted, m_hSTOESAlphaInverted,
m_hSTOESContrastInverted);
- } else if (!textureTarget
- && !TilesManager::instance()->invertedScreen()) {
- drawQuadInternal(geometry, textureId, opacity, m_surfTex2DProgram,
- m_hST2DProjectionMatrix,
- m_hST2DTexSampler, GL_TEXTURE_2D,
- m_hST2DPosition, m_hST2DAlpha);
- } else if (!textureTarget
- && TilesManager::instance()->invertedScreen()) {
- drawQuadInternal(geometry, textureId, opacity, m_surfTex2DProgramInverted,
- m_hST2DProjectionMatrixInverted,
- m_hST2DTexSamplerInverted, GL_TEXTURE_2D,
- m_hST2DPositionInverted, m_hST2DAlphaInverted);
}
GLUtils::checkGlError("drawQuad");
}
@@ -597,18 +536,6 @@ void ShaderProgram::drawLayerQuad(const TransformationMatrix& drawMatrix,
m_hSTOESProjectionMatrixInverted, m_hSTOESTexSamplerInverted,
m_hSTOESPositionInverted, m_hSTOESAlphaInverted,
m_hSTOESContrastInverted);
- } else if (!textureTarget
- && !TilesManager::instance()->invertedScreen()) {
- drawLayerQuadInternal(projectionMatrix, textureId, opacity,
- GL_TEXTURE_2D, m_surfTex2DProgram,
- m_hST2DProjectionMatrix, m_hST2DTexSampler,
- m_hST2DPosition, m_hST2DAlpha);
- } else if (!textureTarget
- && TilesManager::instance()->invertedScreen()) {
- drawLayerQuadInternal(projectionMatrix, textureId, opacity,
- GL_TEXTURE_2D, m_surfTex2DProgramInverted,
- m_hST2DProjectionMatrixInverted, m_hST2DTexSamplerInverted,
- m_hST2DPositionInverted, m_hST2DAlphaInverted);
}
setBlendingState(forceBlending || opacity < 1.0);
diff --git a/Source/WebCore/platform/graphics/android/ShaderProgram.h b/Source/WebCore/platform/graphics/android/ShaderProgram.h
index 5c1f324..d8447bf 100644
--- a/Source/WebCore/platform/graphics/android/ShaderProgram.h
+++ b/Source/WebCore/platform/graphics/android/ShaderProgram.h
@@ -110,8 +110,6 @@ private:
int m_program;
int m_videoProgram;
- int m_surfTex2DProgram;
- int m_surfTex2DProgramInverted;
int m_surfTexOESProgram;
int m_surfTexOESProgramInverted;
@@ -135,16 +133,6 @@ private:
int m_hVideoTextureMatrix;
int m_hVideoTexSampler;
- GLint m_hST2DProjectionMatrix;
- GLint m_hST2DAlpha;
- GLint m_hST2DTexSampler;
- GLint m_hST2DPosition;
-
- GLint m_hST2DProjectionMatrixInverted;
- GLint m_hST2DAlphaInverted;
- GLint m_hST2DTexSamplerInverted;
- GLint m_hST2DPositionInverted;
-
GLint m_hSTOESProjectionMatrix;
GLint m_hSTOESAlpha;
GLint m_hSTOESTexSampler;
diff --git a/Source/WebCore/platform/graphics/android/TextureInfo.h b/Source/WebCore/platform/graphics/android/TextureInfo.h
index fda85da..1c48937 100644
--- a/Source/WebCore/platform/graphics/android/TextureInfo.h
+++ b/Source/WebCore/platform/graphics/android/TextureInfo.h
@@ -61,7 +61,6 @@ public:
void copyAttributes(const TextureInfo* sourceTexture);
SharedTextureMode getSharedTextureMode() { return m_sharedTextureMode; }
- GLenum getTextureTarget();
bool operator==(const TextureInfo& otherTexture);
GLuint m_textureId;