diff options
Diffstat (limited to 'Source/WebCore/platform/graphics/android/ShaderProgram.h')
-rw-r--r-- | Source/WebCore/platform/graphics/android/ShaderProgram.h | 41 |
1 files changed, 38 insertions, 3 deletions
diff --git a/Source/WebCore/platform/graphics/android/ShaderProgram.h b/Source/WebCore/platform/graphics/android/ShaderProgram.h index 55afe4f..2577fb0 100644 --- a/Source/WebCore/platform/graphics/android/ShaderProgram.h +++ b/Source/WebCore/platform/graphics/android/ShaderProgram.h @@ -38,11 +38,25 @@ class ShaderProgram { // Drawing void setViewport(SkRect& viewport); - void drawQuad(SkRect& geometry, int textureId, float opacity); float zValue(const TransformationMatrix& drawMatrix, float w, float h); + + // For drawQuad and drawLayerQuad, they can handle 3 cases for now: + // 1) textureTarget == GL_TEXTURE_2D + // Normal texture in GL_TEXTURE_2D target. + // 2) textureTarget == GL_TEXTURE_EXTERNAL_OES + // Surface texture in GL_TEXTURE_EXTERNAL_OES target. + // 3) textureTarget == 0 (Will be deprecated soon) + // Surface texture in GL_TEXTURE_2D target. + // + // TODO: Shrink the support modes into 2 (1 and 2) after media framework + // support Surface texture in GL_TEXTURE_EXTERNAL_OES target on all + // platforms. + void drawQuad(SkRect& geometry, int textureId, float opacity, + GLenum textureTarget = GL_TEXTURE_2D); void drawLayerQuad(const TransformationMatrix& drawMatrix, - SkRect& geometry, int textureId, float opacity, - bool forceBlending = false); + SkRect& geometry, int textureId, float opacity, + bool forceBlending = false, + GLenum textureTarget = GL_TEXTURE_2D); void drawVideoLayerQuad(const TransformationMatrix& drawMatrix, float* textureMatrix, SkRect& geometry, int textureId); void setViewRect(const IntRect& viewRect); @@ -71,10 +85,21 @@ class ShaderProgram { void setBlendingState(bool enableBlending); + void drawQuadInternal(SkRect& geometry, GLint textureId, float opacity, + GLint program, GLint texSampler, GLenum textureTarget, + GLint position, GLint alpha); + + void drawLayerQuadInternal(const GLfloat* projectionMatrix, int textureId, + float opacity, GLenum textureTarget, GLint program, + GLint matrix, GLint texSample, + GLint position, GLint alpha); + bool m_blendingEnabled; int m_program; int m_videoProgram; + int m_surfTex2DProgram; + int m_surfTexOESProgram; TransformationMatrix m_projectionMatrix; GLuint m_textureBuffer[1]; @@ -96,6 +121,16 @@ class ShaderProgram { int m_hVideoTextureMatrix; int m_hVideoTexSampler; + GLint m_hST2DProjectionMatrix; + GLint m_hST2DAlpha; + GLint m_hST2DTexSampler; + GLint m_hST2DPosition; + + GLint m_hSTOESProjectionMatrix; + GLint m_hSTOESAlpha; + GLint m_hSTOESTexSampler; + GLint m_hSTOESPosition; + // attribs GLint m_hPosition; GLint m_hVideoPosition; |