Index: cc/output/shader.cc |
diff --git a/cc/output/shader.cc b/cc/output/shader.cc |
index 7f1bac7fd560999e7c649c97908f631b99d3f412..9dece8d4a012ea4bd3c10fa27fe84d152cfee11d 100644 |
--- a/cc/output/shader.cc |
+++ b/cc/output/shader.cc |
@@ -185,16 +185,16 @@ std::string VertexShaderPosTex::GetShaderString() const { |
); // NOLINT(whitespace/parens) |
} |
-VertexShaderPosTexYUVStretch::VertexShaderPosTexYUVStretch() |
- : matrix_location_(-1), |
- tex_scale_location_(-1) {} |
+VertexShaderPosTexYUVStretchOffset::VertexShaderPosTexYUVStretchOffset() |
+ : matrix_location_(-1), tex_scale_location_(-1), tex_offset_location_(-1) {} |
-void VertexShaderPosTexYUVStretch::Init(GLES2Interface* context, |
- unsigned program, |
- int* base_uniform_index) { |
+void VertexShaderPosTexYUVStretchOffset::Init(GLES2Interface* context, |
+ unsigned program, |
+ int* base_uniform_index) { |
static const char* uniforms[] = { |
"matrix", |
"texScale", |
+ "texOFfset", |
danakj
2014/03/21 18:11:11
"texOffset"
again, is the test broken or not test
sheu
2014/03/21 20:44:50
D'oh. I lucked out since the driver I'm testing o
|
}; |
int locations[arraysize(uniforms)]; |
@@ -206,9 +206,10 @@ void VertexShaderPosTexYUVStretch::Init(GLES2Interface* context, |
base_uniform_index); |
matrix_location_ = locations[0]; |
tex_scale_location_ = locations[1]; |
+ tex_offset_location_ = locations[2]; |
} |
-std::string VertexShaderPosTexYUVStretch::GetShaderString() const { |
+std::string VertexShaderPosTexYUVStretchOffset::GetShaderString() const { |
return VERTEX_SHADER( |
precision mediump float; |
attribute vec4 a_position; |
@@ -216,9 +217,10 @@ std::string VertexShaderPosTexYUVStretch::GetShaderString() const { |
uniform mat4 matrix; |
varying TexCoordPrecision vec2 v_texCoord; |
uniform TexCoordPrecision vec2 texScale; |
+ uniform TexCoordPrecision vec2 texOffset; |
void main() { |
gl_Position = matrix * a_position; |
- v_texCoord = a_texCoord * texScale; |
+ v_texCoord = a_texCoord * texScale + texOffset; |
} |
); // NOLINT(whitespace/parens) |
} |