summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2010-04-26 16:04:21 -0700
committerEric Anholt <eric@anholt.net>2010-06-03 17:08:42 -0700
commitc7629d8d71bd8a508f667da07c79ff9f8931b180 (patch)
tree28635e2e1bb5298db22a93dd829865a0f3304dc8
parent4932a19761eed9eda80098a2ab4457122760b949 (diff)
Disable auto-indenting mess on gstgldisplay.c shaders.
-rw-r--r--gst-libs/gst/gl/gstgldisplay.c81
1 files changed, 57 insertions, 24 deletions
diff --git a/gst-libs/gst/gl/gstgldisplay.c b/gst-libs/gst/gl/gstgldisplay.c
index 086c29b..0445cbf 100644
--- a/gst-libs/gst/gl/gstgldisplay.c
+++ b/gst-libs/gst/gl/gstgldisplay.c
@@ -243,6 +243,8 @@ gst_gl_display_init (GstGLDisplay * display, GstGLDisplayClass * klass)
display->shader_download_RGB = NULL;
#endif
+ /* *INDENT-OFF* */
+
//YUY2:r,g,a
//UYVY:a,b,r
display->text_shader_upload_YUY2_UYVY =
@@ -251,9 +253,11 @@ gst_gl_display_init (GstGLDisplay * display, GstGLDisplayClass * klass)
"uniform sampler2DRect Ytex, UVtex;\n"
#else
"precision mediump float;\n"
- "varying vec2 v_texCoord;\n" "uniform sampler2D Ytex, UVtex;\n"
+ "varying vec2 v_texCoord;\n"
+ "uniform sampler2D Ytex, UVtex;\n"
#endif
- "void main(void) {\n" " float fx, fy, y, u, v, r, g, b;\n"
+ "void main(void) {\n"
+ " float fx, fy, y, u, v, r, g, b;\n"
#ifndef OPENGL_ES2
" fx = gl_TexCoord[0].x;\n"
" fy = gl_TexCoord[0].y;\n"
@@ -272,7 +276,9 @@ gst_gl_display_init (GstGLDisplay * display, GstGLDisplayClass * klass)
" v=v-0.5;\n"
" r = y+1.5958*v;\n"
" g = y-0.39173*u-0.81290*v;\n"
- " b = y+2.017*u;\n" " gl_FragColor = vec4(r, g, b, 1.0);\n" "}\n";
+ " b = y+2.017*u;\n"
+ " gl_FragColor = vec4(r, g, b, 1.0);\n"
+ "}\n";
//ATI: "*0.5", ""
//normal: "", "*0.5"
@@ -282,9 +288,11 @@ gst_gl_display_init (GstGLDisplay * display, GstGLDisplayClass * klass)
"uniform sampler2DRect Ytex,Utex,Vtex;\n"
#else
"precision mediump float;\n"
- "varying vec2 v_texCoord;\n" "uniform sampler2D Ytex,Utex,Vtex;\n"
+ "varying vec2 v_texCoord;\n"
+ "uniform sampler2D Ytex,Utex,Vtex;\n"
#endif
- "void main(void) {\n" " float r,g,b,y,u,v;\n"
+ "void main(void) {\n"
+ " float r,g,b,y,u,v;\n"
#ifndef OPENGL_ES2
" vec2 nxy = gl_TexCoord[0].xy;\n"
" y=texture2DRect(Ytex,nxy%s).r;\n"
@@ -293,14 +301,17 @@ gst_gl_display_init (GstGLDisplay * display, GstGLDisplayClass * klass)
#else
" vec2 nxy = v_texCoord.xy;\n"
" y=texture2D(Ytex,nxy).r;\n"
- " u=texture2D(Utex,nxy).r;\n" " v=texture2D(Vtex,nxy).r;\n"
+ " u=texture2D(Utex,nxy).r;\n"
+ " v=texture2D(Vtex,nxy).r;\n"
#endif
" y=1.1643*(y-0.0625);\n"
" u=u-0.5;\n"
" v=v-0.5;\n"
" r=y+1.5958*v;\n"
" g=y-0.39173*u-0.81290*v;\n"
- " b=y+2.017*u;\n" " gl_FragColor=vec4(r,g,b,1.0);\n" "}\n";
+ " b=y+2.017*u;\n"
+ " gl_FragColor=vec4(r,g,b,1.0);\n"
+ "}\n";
display->text_shader_upload_AYUV =
#ifndef OPENGL_ES2
@@ -308,24 +319,30 @@ gst_gl_display_init (GstGLDisplay * display, GstGLDisplayClass * klass)
"uniform sampler2DRect tex;\n"
#else
"precision mediump float;\n"
- "varying vec2 v_texCoord;\n" "uniform sampler2D tex;\n"
+ "varying vec2 v_texCoord;\n"
+ "uniform sampler2D tex;\n"
#endif
- "void main(void) {\n" " float r,g,b,y,u,v;\n"
+ "void main(void) {\n"
+ " float r,g,b,y,u,v;\n"
#ifndef OPENGL_ES2
" vec2 nxy=gl_TexCoord[0].xy;\n"
" y=texture2DRect(tex,nxy).r;\n"
- " u=texture2DRect(tex,nxy).g;\n" " v=texture2DRect(tex,nxy).b;\n"
+ " u=texture2DRect(tex,nxy).g;\n"
+ " v=texture2DRect(tex,nxy).b;\n"
#else
" vec2 nxy = v_texCoord.xy;\n"
" y=texture2D(tex,nxy).g;\n"
- " u=texture2D(tex,nxy).b;\n" " v=texture2D(tex,nxy).a;\n"
+ " u=texture2D(tex,nxy).b;\n"
+ " v=texture2D(tex,nxy).a;\n"
#endif
" y=1.1643*(y-0.0625);\n"
" u=u-0.5;\n"
" v=v-0.5;\n"
" r=y+1.5958*v;\n"
" g=y-0.39173*u-0.81290*v;\n"
- " b=y+2.017*u;\n" " gl_FragColor=vec4(r,g,b,1.0);\n" "}\n";
+ " b=y+2.017*u;\n"
+ " gl_FragColor=vec4(r,g,b,1.0);\n"
+ "}\n";
//YUY2:y2,u,y1,v
//UYVY:v,y1,u,y2
@@ -335,9 +352,11 @@ gst_gl_display_init (GstGLDisplay * display, GstGLDisplayClass * klass)
"uniform sampler2DRect tex;\n"
#else
"precision mediump float;\n"
- "varying vec2 v_texCoord;\n" "uniform sampler2D tex;\n"
+ "varying vec2 v_texCoord;\n"
+ "uniform sampler2D tex;\n"
#endif
- "void main(void) {\n" " float fx,fy,r,g,b,r2,g2,b2,y1,y2,u,v;\n"
+ "void main(void) {\n"
+ " float fx,fy,r,g,b,r2,g2,b2,y1,y2,u,v;\n"
#ifndef OPENGL_ES2
" fx = gl_TexCoord[0].x;\n"
" fy = gl_TexCoord[0].y;\n"
@@ -363,7 +382,10 @@ gst_gl_display_init (GstGLDisplay * display, GstGLDisplayClass * klass)
" v=0.439271*r - 0.367833*g - 0.071438*b ;\n"
" y1=0.858885*y1 + 0.0625;\n"
" y2=0.858885*y2 + 0.0625;\n"
- " u=u + 0.5;\n" " v=v + 0.5;\n" " gl_FragColor=vec4(%s);\n" "}\n";
+ " u=u + 0.5;\n"
+ " v=v + 0.5;\n"
+ " gl_FragColor=vec4(%s);\n"
+ "}\n";
//no OpenGL ES 2.0 support because for now it's not possible
//to attach multiple textures to a frame buffer object
@@ -390,7 +412,8 @@ gst_gl_display_init (GstGLDisplay * display, GstGLDisplayClass * klass)
" v=v + 0.5;\n"
" gl_FragData[0] = vec4(y, 0.0, 0.0, 1.0);\n"
" gl_FragData[1] = vec4(u, 0.0, 0.0, 1.0);\n"
- " gl_FragData[2] = vec4(v, 0.0, 0.0, 1.0);\n" "}\n";
+ " gl_FragData[2] = vec4(v, 0.0, 0.0, 1.0);\n"
+ "}\n";
display->text_shader_download_AYUV =
#ifndef OPENGL_ES2
@@ -398,22 +421,28 @@ gst_gl_display_init (GstGLDisplay * display, GstGLDisplayClass * klass)
"uniform sampler2DRect tex;\n"
#else
"precision mediump float;\n"
- "varying vec2 v_texCoord;\n" "uniform sampler2D tex;\n"
+ "varying vec2 v_texCoord;\n"
+ "uniform sampler2D tex;\n"
#endif
- "void main(void) {\n" " float r,g,b,y,u,v;\n"
+ "void main(void) {\n"
+ " float r,g,b,y,u,v;\n"
#ifndef OPENGL_ES2
" vec2 nxy=gl_TexCoord[0].xy;\n"
" r=texture2DRect(tex,nxy).r;\n"
- " g=texture2DRect(tex,nxy).g;\n" " b=texture2DRect(tex,nxy).b;\n"
+ " g=texture2DRect(tex,nxy).g;\n"
+ " b=texture2DRect(tex,nxy).b;\n"
#else
" vec2 nxy=v_texCoord.xy;\n"
" r=texture2D(tex,nxy).r;\n"
- " g=texture2D(tex,nxy).g;\n" " b=texture2D(tex,nxy).b;\n"
+ " g=texture2D(tex,nxy).g;\n"
+ " b=texture2D(tex,nxy).b;\n"
#endif
" y=0.299011*r + 0.586987*g + 0.114001*b;\n"
" u=-0.148246*r -0.29102*g + 0.439266*b;\n"
" v=0.439271*r - 0.367833*g - 0.071438*b ;\n"
- " y=0.858885*y + 0.0625;\n" " u=u + 0.5;\n" " v=v + 0.5;\n"
+ " y=0.858885*y + 0.0625;\n"
+ " u=u + 0.5;\n"
+ " v=v + 0.5;\n"
#ifndef OPENGL_ES2
" gl_FragColor=vec4(y,u,v,1.0);\n"
#else
@@ -429,7 +458,8 @@ gst_gl_display_init (GstGLDisplay * display, GstGLDisplayClass * klass)
"void main() \n"
"{ \n"
" gl_Position = a_position; \n"
- " v_texCoord = a_texCoord; \n" "} \n";
+ " v_texCoord = a_texCoord; \n"
+ "} \n";
display->redisplay_fragment_shader_str =
"precision mediump float; \n"
@@ -447,7 +477,8 @@ gst_gl_display_init (GstGLDisplay * display, GstGLDisplayClass * klass)
"void main() \n"
"{ \n"
" gl_Position = a_position; \n"
- " v_texCoord = a_texCoord; \n" "} \n";
+ " v_texCoord = a_texCoord; \n"
+ "} \n";
display->text_vertex_shader_download =
"attribute vec4 a_position; \n"
@@ -456,7 +487,8 @@ gst_gl_display_init (GstGLDisplay * display, GstGLDisplayClass * klass)
"void main() \n"
"{ \n"
" gl_Position = a_position; \n"
- " v_texCoord = a_texCoord; \n" "} \n";
+ " v_texCoord = a_texCoord; \n"
+ "} \n";
display->text_fragment_shader_download_RGB =
"precision mediump float; \n"
@@ -467,6 +499,7 @@ gst_gl_display_init (GstGLDisplay * display, GstGLDisplayClass * klass)
" gl_FragColor = texture2D( s_texture, v_texCoord );\n"
"} \n";
#endif
+ /* *INDENT-ON* */
}
static void