diff options
author | enne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-23 06:16:23 +0000 |
---|---|---|
committer | enne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-23 06:16:23 +0000 |
commit | bf1a0516742864559d83817689fa9c14df8b961b (patch) | |
tree | f12314e800515312006da7a521c955efdddbdc68 /cc | |
parent | 617f908c4d7bd928016bbfcda598c40696ef0cab (diff) | |
download | chromium_src-bf1a0516742864559d83817689fa9c14df8b961b.zip chromium_src-bf1a0516742864559d83817689fa9c14df8b961b.tar.gz chromium_src-bf1a0516742864559d83817689fa9c14df8b961b.tar.bz2 |
cc: Fix video shader after cc renaming
r163429 overenthusiastically renamed the yuv video shader's cc_matrix to
matrix. This uniform name conflicted with the vertex shader "matrix", causing
the transform to get overridden by the yuv conversion matrix. Fix by renaming
to yuvMatrix instead, which is a better name altogether.
TBR=jamesr@chromium.org
BUG=none
Review URL: https://codereview.chromium.org/11238056
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@163512 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc')
-rw-r--r-- | cc/gl_renderer.cc | 2 | ||||
-rw-r--r-- | cc/shader.cc | 12 | ||||
-rw-r--r-- | cc/shader.h | 4 |
3 files changed, 9 insertions, 9 deletions
diff --git a/cc/gl_renderer.cc b/cc/gl_renderer.cc index e49acc5..042410a 100644 --- a/cc/gl_renderer.cc +++ b/cc/gl_renderer.cc @@ -877,7 +877,7 @@ void GLRenderer::drawYUVVideoQuad(const DrawingFrame& frame, const YUVVideoDrawQ 0.f, -.391f, 2.018f, 1.596f, -.813f, 0.f, }; - GLC(context(), context()->uniformMatrix3fv(program->fragmentShader().matrixLocation(), 1, 0, yuv2RGB)); + GLC(context(), context()->uniformMatrix3fv(program->fragmentShader().yuvMatrixLocation(), 1, 0, yuv2RGB)); // These values map to 16, 128, and 128 respectively, and are computed // as a fraction over 256 (e.g. 16 / 256 = 0.0625). diff --git a/cc/shader.cc b/cc/shader.cc index 813e14d..1f20567 100644 --- a/cc/shader.cc +++ b/cc/shader.cc @@ -747,7 +747,7 @@ FragmentShaderYUVVideo::FragmentShaderYUVVideo() , m_uTextureLocation(-1) , m_vTextureLocation(-1) , m_alphaLocation(-1) - , m_ccMatrixLocation(-1) + , m_yuvMatrixLocation(-1) , m_yuvAdjLocation(-1) { } @@ -759,7 +759,7 @@ void FragmentShaderYUVVideo::init(WebGraphicsContext3D* context, unsigned progra "u_texture", "v_texture", "alpha", - "matrix", + "yuv_matrix", "yuv_adj", }; int locations[6]; @@ -770,11 +770,11 @@ void FragmentShaderYUVVideo::init(WebGraphicsContext3D* context, unsigned progra m_uTextureLocation = locations[1]; m_vTextureLocation = locations[2]; m_alphaLocation = locations[3]; - m_ccMatrixLocation = locations[4]; + m_yuvMatrixLocation = locations[4]; m_yuvAdjLocation = locations[5]; DCHECK(m_yTextureLocation != -1 && m_uTextureLocation != -1 && m_vTextureLocation != -1 - && m_alphaLocation != -1 && m_ccMatrixLocation != -1 && m_yuvAdjLocation != -1); + && m_alphaLocation != -1 && m_yuvMatrixLocation != -1 && m_yuvAdjLocation != -1); } std::string FragmentShaderYUVVideo::getShaderString() const @@ -789,14 +789,14 @@ std::string FragmentShaderYUVVideo::getShaderString() const uniform sampler2D v_texture; uniform float alpha; uniform vec3 yuv_adj; - uniform mat3 matrix; + uniform mat3 yuv_matrix; void main() { float y_raw = texture2D(y_texture, y_texCoord).x; float u_unsigned = texture2D(u_texture, uv_texCoord).x; float v_unsigned = texture2D(v_texture, uv_texCoord).x; vec3 yuv = vec3(y_raw, u_unsigned, v_unsigned) + yuv_adj; - vec3 rgb = matrix * yuv; + vec3 rgb = yuv_matrix * yuv; gl_FragColor = vec4(rgb, float(1)) * alpha; } ); diff --git a/cc/shader.h b/cc/shader.h index 3934d9f..9bf11d5 100644 --- a/cc/shader.h +++ b/cc/shader.h @@ -303,7 +303,7 @@ public: int uTextureLocation() const { return m_uTextureLocation; } int vTextureLocation() const { return m_vTextureLocation; } int alphaLocation() const { return m_alphaLocation; } - int matrixLocation() const { return m_ccMatrixLocation; } + int yuvMatrixLocation() const { return m_yuvMatrixLocation; } int yuvAdjLocation() const { return m_yuvAdjLocation; } private: @@ -311,7 +311,7 @@ private: int m_uTextureLocation; int m_vTextureLocation; int m_alphaLocation; - int m_ccMatrixLocation; + int m_yuvMatrixLocation; int m_yuvAdjLocation; }; |