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

Unified Diff: Source/WebCore/platform/graphics/chromium/ShaderChromium.cpp

Issue 7477025: Merge 91720 - [Chromium] Use correct vertex shader when rendering video layer. (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/835/
Patch Set: Created 9 years, 5 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
« no previous file with comments | « Source/WebCore/platform/graphics/chromium/ShaderChromium.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/platform/graphics/chromium/ShaderChromium.cpp
===================================================================
--- Source/WebCore/platform/graphics/chromium/ShaderChromium.cpp (revision 91783)
+++ Source/WebCore/platform/graphics/chromium/ShaderChromium.cpp (working copy)
@@ -124,7 +124,6 @@
VertexShaderPosTexTransform::VertexShaderPosTexTransform()
: m_matrixLocation(-1)
, m_texTransformLocation(-1)
- , m_pointLocation(-1)
{
}
@@ -132,11 +131,41 @@
{
m_matrixLocation = context->getUniformLocation(program, "matrix");
m_texTransformLocation = context->getUniformLocation(program, "texTransform");
+ ASSERT(m_matrixLocation != -1 && m_texTransformLocation != -1);
+}
+
+String VertexShaderPosTexTransform::getShaderString() const
+{
+ return SHADER(
+ attribute vec4 a_position;
+ attribute vec2 a_texCoord;
+ uniform mat4 matrix;
+ uniform vec4 texTransform;
+ varying vec2 v_texCoord;
+ void main()
+ {
+ gl_Position = matrix * a_position;
+ v_texCoord = a_texCoord * texTransform.zw + texTransform.xy;
+ }
+ );
+}
+
+VertexShaderQuad::VertexShaderQuad()
+ : m_matrixLocation(-1)
+ , m_texTransformLocation(-1)
+ , m_pointLocation(-1)
+{
+}
+
+void VertexShaderQuad::init(GraphicsContext3D* context, unsigned program)
+{
+ m_matrixLocation = context->getUniformLocation(program, "matrix");
+ m_texTransformLocation = context->getUniformLocation(program, "texTransform");
m_pointLocation = context->getUniformLocation(program, "point");
ASSERT(m_matrixLocation != -1 && m_texTransformLocation != -1 && m_pointLocation != -1);
}
-String VertexShaderPosTexTransform::getShaderString() const
+String VertexShaderQuad::getShaderString() const
{
return SHADER(
attribute vec4 a_position;
« no previous file with comments | « Source/WebCore/platform/graphics/chromium/ShaderChromium.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698