| Index: cc/output/gl_renderer.cc
|
| diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc
|
| index bb1ecbf6bc61f6691d5eb5fd55690d0448eee2ae..c2529d9aa6a92b0d69ec1201802a1206c702c7a0 100644
|
| --- a/cc/output/gl_renderer.cc
|
| +++ b/cc/output/gl_renderer.cc
|
| @@ -1779,7 +1779,15 @@ void GLRenderer::DrawYUVVideoQuad(const DrawingFrame* frame,
|
| // http://www.fourcc.org/fccyvrgb.php
|
| float yuv_to_rgb[9] = {1.164f, 1.164f, 1.164f, 0.0f, -.391f,
|
| 2.018f, 1.596f, -.813f, 0.0f, };
|
| - GLC(gl_, gl_->UniformMatrix3fv(yuv_matrix_location, 1, 0, yuv_to_rgb));
|
| + float yuv_to_rgb_jpeg[9] = {
|
| + 1.f, 1.f, 1.f, 0.0f, -.34414f, 1.772f, 1.402f, -.71414, 0.0f,
|
| + };
|
| + GLC(gl_,
|
| + gl_->UniformMatrix3fv(
|
| + yuv_matrix_location,
|
| + 1,
|
| + 0,
|
| + quad->has_jpeg_color_range ? yuv_to_rgb_jpeg : yuv_to_rgb));
|
|
|
| // These values map to 16, 128, and 128 respectively, and are computed
|
| // as a fraction over 256 (e.g. 16 / 256 = 0.0625).
|
| @@ -1788,7 +1796,17 @@ void GLRenderer::DrawYUVVideoQuad(const DrawingFrame* frame,
|
| // U - 128 : Turns unsigned U into signed U [-128,127]
|
| // V - 128 : Turns unsigned V into signed V [-128,127]
|
| float yuv_adjust[3] = {-0.0625f, -0.5f, -0.5f, };
|
| - GLC(gl_, gl_->Uniform3fv(yuv_adj_location, 1, yuv_adjust));
|
| +
|
| + // Same as above, but without the head and footroom.
|
| + float yuv_adjust_jpeg[3] = {
|
| + 0.0f, -0.5f, -0.5f,
|
| + };
|
| +
|
| + GLC(gl_,
|
| + gl_->Uniform3fv(
|
| + yuv_adj_location,
|
| + 1,
|
| + quad->has_jpeg_color_range ? yuv_adjust_jpeg : yuv_adjust));
|
|
|
| SetShaderOpacity(quad->opacity(), alpha_location);
|
| DrawQuadGeometry(frame, quad->quadTransform(), quad->rect, matrix_location);
|
|
|