diff options
author | jiesun@google.com <jiesun@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-02 19:57:51 +0000 |
---|---|---|
committer | jiesun@google.com <jiesun@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-02 19:57:51 +0000 |
commit | 275ee65acf5e0051c46bde2b23a62fcf6c8a9c42 (patch) | |
tree | be0cb608d50772b343587788ca930ad4d9a69fea /media/tools | |
parent | d5e4a478d52c048f60b514cdffc64320ffa4cd1b (diff) | |
download | chromium_src-275ee65acf5e0051c46bde2b23a62fcf6c8a9c42.zip chromium_src-275ee65acf5e0051c46bde2b23a62fcf6c8a9c42.tar.gz chromium_src-275ee65acf5e0051c46bde2b23a62fcf6c8a9c42.tar.bz2 |
some vendor's compiler had issues about the constant variable.
we had to use uniform.
TEST=On vendor's board.
BUG=None.
Review URL: http://codereview.chromium.org/2436007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48758 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/tools')
-rw-r--r-- | media/tools/player_x11/gles_video_renderer.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/media/tools/player_x11/gles_video_renderer.cc b/media/tools/player_x11/gles_video_renderer.cc index 3571f24..85e4329 100644 --- a/media/tools/player_x11/gles_video_renderer.cc +++ b/media/tools/player_x11/gles_video_renderer.cc @@ -93,11 +93,12 @@ static const char kFragmentShader[] = "uniform sampler2D u_tex;\n" "uniform sampler2D v_tex;\n" "uniform mat3 yuv2rgb;\n" + "uniform float half;\n" "\n" "void main() {\n" " float y = texture2D(y_tex, interp_tc).x;\n" - " float u = texture2D(u_tex, interp_tc).r - .5;\n" - " float v = texture2D(v_tex, interp_tc).r - .5;\n" + " float u = texture2D(u_tex, interp_tc).r - half;\n" + " float v = texture2D(v_tex, interp_tc).r - half;\n" " vec3 rgb = yuv2rgb * vec3(y, u, v);\n" " gl_FragColor = vec4(rgb, 1);\n" "}\n"; @@ -363,6 +364,8 @@ bool GlesVideoRenderer::InitializeGles() { glUniform1i(glGetUniformLocation(program, "y_tex"), 0); glUniform1i(glGetUniformLocation(program, "u_tex"), 1); glUniform1i(glGetUniformLocation(program, "v_tex"), 2); + // WAR for some vendor's compiler issues for constant literal. + glUniform1f(glGetUniformLocation(program, "half"), 0.5); int yuv2rgb_location = glGetUniformLocation(program, "yuv2rgb"); glUniformMatrix3fv(yuv2rgb_location, 1, GL_FALSE, kYUV2RGB); |