Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3447)

Unified Diff: cc/output/shader.cc

Issue 207233002: cc: Support texcoord offsets in YUVVideoDrawQuad (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 5baa37b0 Initial. Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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)
}

Powered by Google App Engine
This is Rietveld 408576698