diff -Nru clutk-0.3.60+gles2+2/clutk/ctk-effect-blur.c clutk-0.3.60+gles2+2rev286alf/clutk/ctk-effect-blur.c --- clutk-0.3.60+gles2+2/clutk/ctk-effect-blur.c 2010-09-28 15:57:49.000000000 +0000 +++ clutk-0.3.60+gles2+2rev286alf/clutk/ctk-effect-blur.c 2010-10-06 12:43:03.000000000 +0000 @@ -326,7 +326,7 @@ CHECKGL (glClearDepth (1.0f)); #endif CHECKGL (glClearStencil (0)); - CHECKGL (glClearColor (0.0f, 0.0f, 0.0f, 1.0f)); + CHECKGL (glClearColor (0.0f, 0.0f, 0.0f, 0.0f)); CHECKGL (glColorMask (GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE)); /* clear the FBO content */ @@ -336,9 +336,7 @@ /* Paint the actor and its children. If ctk_actor_set_effects_painting has been set to true for this actor, it will draw itself without any effect (avoiding an infinite loop). */ paint_func (actor); -#ifndef WITH_GLES cogl_flush (); -#endif /* Deactivate blending state set by clutter */ glDisable(GL_BLEND); diff -Nru clutk-0.3.60+gles2+2/clutk/ctk-effect-drop-shadow.c clutk-0.3.60+gles2+2rev286alf/clutk/ctk-effect-drop-shadow.c --- clutk-0.3.60+gles2+2/clutk/ctk-effect-drop-shadow.c 2010-09-28 15:57:49.000000000 +0000 +++ clutk-0.3.60+gles2+2rev286alf/clutk/ctk-effect-drop-shadow.c 2010-10-06 12:43:03.000000000 +0000 @@ -363,9 +363,7 @@ /* Paint the actor and its children. If ctk_actor_set_effects_painting has been set to true for this actor, it will draw itself without any effect (avoiding an infinite loop). */ paint_func (actor); -#ifndef WITH_GLES cogl_flush (); -#endif /* Deactivate blending state set by clutter */ glDisable(GL_BLEND); @@ -449,7 +447,6 @@ actor_screen_width, actor_screen_height); #endif - for (iPass = 0; iPass < num_passes; iPass++) { ctk_render_target_bind(rt1); @@ -602,9 +599,7 @@ if (is_last_effect) { paint_func (actor); -#ifndef WITH_GLES cogl_flush (); -#endif } /* leave and make sure the top render target on the stack is binded */ diff -Nru clutk-0.3.60+gles2+2/clutk/ctk-effect-glow.c clutk-0.3.60+gles2+2rev286alf/clutk/ctk-effect-glow.c --- clutk-0.3.60+gles2+2/clutk/ctk-effect-glow.c 2010-09-28 15:57:49.000000000 +0000 +++ clutk-0.3.60+gles2+2rev286alf/clutk/ctk-effect-glow.c 2010-10-06 12:43:03.000000000 +0000 @@ -391,9 +391,7 @@ /* Paint the actor and its children. If ctk_actor_set_effects_painting has been set to true for this actor, it will draw itself without any effect (avoiding an infinite loop). */ paint_func (actor); -#ifndef WITH_GLES cogl_flush (); -#endif /* Deactivate blending state set by clutter */ glDisable(GL_BLEND); @@ -663,9 +661,7 @@ if (is_last_effect) { paint_func (actor); -#ifndef WITH_GLES cogl_flush (); -#endif } /* leave and make sure the top render target on the stack is binded */ diff -Nru clutk-0.3.60+gles2+2/clutk/ctk-gfx-private.c clutk-0.3.60+gles2+2rev286alf/clutk/ctk-gfx-private.c --- clutk-0.3.60+gles2+2/clutk/ctk-gfx-private.c 2010-09-28 15:57:49.000000000 +0000 +++ clutk-0.3.60+gles2+2rev286alf/clutk/ctk-gfx-private.c 2010-10-06 12:43:03.000000000 +0000 @@ -49,6 +49,8 @@ #include "ctk-gfx-private.h" #include +/* Whether to display information about coordinate normalization */ +#define DEBUG_COORD_NORMALIZATION 0 void print_shader_object_error(GLuint obj) { @@ -177,12 +179,28 @@ GLfloat vertex_positions[] = { - (2*vtx[0].x-window_w)/window_w, (2*vtx[0].y-window_h)/window_h, 0.0f, 1.0f, - (2*vtx[1].x-window_w)/window_w, (2*vtx[1].y-window_h)/window_h, 0.0f, 1.0f, - (2*vtx[2].x-window_w)/window_w, (2*vtx[2].y-window_h)/window_h, 0.0f, 1.0f, - (2*vtx[3].x-window_w)/window_w, (2*vtx[3].y-window_h)/window_h, 0.0f, 1.0f, + (2.0*vtx[0].x-window_w)/window_w, -(2.0*vtx[0].y-window_h)/window_h, 0.0f, 1.0f, + (2.0*vtx[1].x-window_w)/window_w, -(2.0*vtx[1].y-window_h)/window_h, 0.0f, 1.0f, + (2.0*vtx[2].x-window_w)/window_w, -(2.0*vtx[2].y-window_h)/window_h, 0.0f, 1.0f, + (2.0*vtx[3].x-window_w)/window_w, -(2.0*vtx[3].y-window_h)/window_h, 0.0f, 1.0f, }; +#if DEBUG_COORD_NORMALIZATION == 1 + g_message("CustomQuad: (%f, %f) (%f, %f) (%f, %f) (%f, %f) =>\n" + " (%f, %f) (%f, %f) (%f, %f) (%f, %f)\n" + " window_w: %d window_h: %d", + vtx[0].x, vtx[0].y, + vtx[1].x, vtx[1].y, + vtx[2].x, vtx[2].y, + vtx[3].x, vtx[3].y, + vertex_positions[0], vertex_positions[1], + vertex_positions[4], vertex_positions[5], + vertex_positions[8], vertex_positions[9], + vertex_positions[12], vertex_positions[13], + window_w, window_h); +#endif + + /* Set texture 0 environment mode */ { CHECKGL( glActiveTexture(GL_TEXTURE0) ); @@ -200,17 +218,6 @@ loc = glGetUniformLocation(shader->shprog, "color"); CHECKGL( glUniform4f(loc, Opacity*red, Opacity*green, Opacity*blue, Opacity) ); - /*int blend; - int blend_src; - int blend_dst; - - glGetIntegerv(GL_BLEND, &blend); - glGetIntegerv(GL_BLEND_SRC, &blend_src); - glGetIntegerv(GL_BLEND_DST, &blend_dst); - - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);*/ - posId = glGetAttribLocation(shader->shprog, "a_position"); texCoordId = glGetAttribLocation(shader->shprog, "a_texcoord0"); @@ -222,8 +229,6 @@ CHECKGL( glDrawArrays(GL_TRIANGLE_FAN, 0, 4) ); - /*glBlendFunc(blend_src, blend_dst);*/ - CHECKGL( glDisableVertexAttribArray(posId) ); CHECKGL( glDisableVertexAttribArray(texCoordId) ); @@ -251,16 +256,31 @@ GLfloat vertex_positions[] = { - (2*x-window_w)/window_w, (2*y-window_h)/window_h, 0.0f, 1.0f, - (2*(x+w)-window_w)/window_w, (2*y-window_h)/window_h, 0.0f, 1.0f, - (2*(x+w)-window_w)/window_w, (2*(y+h)-window_h)/window_h, 0.0f, 1.0f, - (2*x-window_w)/window_w, (2*(y+h)-window_h)/window_h, 0.0f, 1.0f, + (2.0*x-window_w)/window_w, -(2.0*y-window_h)/window_h, 0.0f, 1.0f, + (2.0*(x+w)-window_w)/window_w, -(2.0*y-window_h)/window_h, 0.0f, 1.0f, + (2.0*(x+w)-window_w)/window_w, -(2.0*(y+h)-window_h)/window_h, 0.0f, 1.0f, + (2.0*x-window_w)/window_w, -(2.0*(y+h)-window_h)/window_h, 0.0f, 1.0f, }; +#if DEBUG_COORD_NORMALIZATION == 1 + g_message("AMask: (%d, %d) (%d, %d) (%d, %d) (%d, %d) =>\n" + " (%f, %f) (%f, %f) (%f, %f) (%f, %f)\n" + " window_w: %d window_h: %d", + x, y, + x + w, y, + x + w, y + h, + x , y + h, + vertex_positions[0], vertex_positions[1], + vertex_positions[4], vertex_positions[5], + vertex_positions[8], vertex_positions[9], + vertex_positions[12], vertex_positions[13], + window_w, window_h); +#endif + /* Set texture 0 environment mode */ { CHECKGL( glActiveTexture(GL_TEXTURE0) ); - CHECKGL( glBindTexture(GL_TEXTURE_2D, texid /*ctk_render_target_get_color_buffer_ogl_id(rt)*/) ); + CHECKGL( glBindTexture(GL_TEXTURE_2D, texid)); } /* Use the shader */ @@ -317,10 +337,10 @@ GLfloat vertex_positions[] = { - (2*x-window_w)/window_w, (2*y-window_h)/window_h, 0.0f, 1.0f, - (2*(x+w)-window_w)/window_w, (2*y-window_h)/window_h, 0.0f, 1.0f, - (2*(x+w)-window_w)/window_w, (2*(y+h)-window_h)/window_h, 0.0f, 1.0f, - (2*x-window_w)/window_w, (2*(y+h)-window_h)/window_h, 0.0f, 1.0f, + (2.0*x-window_w)/window_w, -(2.0*y-window_h)/window_h, 0.0f, 1.0f, + (2.0*(x+w)-window_w)/window_w, -(2.0*y-window_h)/window_h, 0.0f, 1.0f, + (2.0*(x+w)-window_w)/window_w, -(2.0*(y+h)-window_h)/window_h, 0.0f, 1.0f, + (2.0*x-window_w)/window_w, -(2.0*(y+h)-window_h)/window_h, 0.0f, 1.0f, }; guint num_tap = 7; /* must be odd number */ @@ -365,17 +385,6 @@ loc = glGetUniformLocation(shader->shprog, "color"); CHECKGL( glUniform4f(loc, 1.0f, 1.0f, 1.0f, 1.0f) ); - /*int blend; - int blend_src; - int blend_dst; - - glGetIntegerv(GL_BLEND, &blend); - glGetIntegerv(GL_BLEND_SRC, &blend_src); - glGetIntegerv(GL_BLEND_DST, &blend_dst); - - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);*/ - posId = glGetAttribLocation(g_shTextureAlpha->shprog, "a_position"); texCoordId = glGetAttribLocation(g_shTextureAlpha->shprog, "a_texcoord0"); @@ -387,8 +396,6 @@ CHECKGL( glDrawArrays(GL_TRIANGLE_FAN, 0, 4) ); - /*glBlendFunc(blend_src, blend_dst);*/ - CHECKGL( glDisableVertexAttribArray(posId) ); CHECKGL( glDisableVertexAttribArray(texCoordId) ); @@ -433,12 +440,27 @@ GLfloat vertex_positions[] = { - (2*x-window_w)/window_w, (2*y-window_h)/window_h, 0.0f, 1.0f, - (2*(x+w)-window_w)/window_w, (2*y-window_h)/window_h, 0.0f, 1.0f, - (2*(x+w)-window_w)/window_w, (2*(y+h)-window_h)/window_h, 0.0f, 1.0f, - (2*x-window_w)/window_w, (2*(y+h)-window_h)/window_h, 0.0f, 1.0f, + (2.0*x-window_w)/window_w, -(2.0*y-window_h)/window_h, 0.0f, 1.0f, + (2.0*(x+w)-window_w)/window_w, -(2.0*y-window_h)/window_h, 0.0f, 1.0f, + (2.0*(x+w)-window_w)/window_w, -(2.0*(y+h)-window_h)/window_h, 0.0f, 1.0f, + (2.0*x-window_w)/window_w, -(2.0*(y+h)-window_h)/window_h, 0.0f, 1.0f, }; +#if DEBUG_COORD_NORMALIZATION == 1 + g_message("TMask: (%d, %d) (%d, %d) (%d, %d) (%d, %d) =>\n" + " (%f, %f) (%f, %f) (%f, %f) (%f, %f)\n" + " window_w: %d window_h: %d", + x, y, + x + w, y, + x + w, y + h, + x , y + h, + vertex_positions[0], vertex_positions[1], + vertex_positions[4], vertex_positions[5], + vertex_positions[8], vertex_positions[9], + vertex_positions[12], vertex_positions[13], + window_w, window_h); +#endif + /* Use the shader */ CHECKGL( glUseProgram(shader->shprog) ); @@ -469,10 +491,6 @@ loc = glGetUniformLocation(shader->shprog, "color"); CHECKGL( glUniform4f(loc, Opacity, Opacity, Opacity, Opacity) ); - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - //glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); - posId = glGetAttribLocation(shader->shprog, "a_position"); texCoord0Id = glGetAttribLocation(shader->shprog, "a_texcoord0"); texCoord1Id = glGetAttribLocation(shader->shprog, "a_texcoord1"); @@ -489,7 +507,7 @@ CHECKGL( glDisableVertexAttribArray(posId) ); CHECKGL( glDisableVertexAttribArray(texCoord0Id) ); - //CHECKGL( glDisableVertexAttribArray(texCoord1Id) ); + CHECKGL( glDisableVertexAttribArray(texCoord1Id) ); /* Disable texture 1 environment mode */ { @@ -519,12 +537,27 @@ GLfloat vertex_positions[] = { - (2*x_dst-window_w)/window_w, (2*y_dst-window_h)/window_h, 0.0f, 1.0f, - (2*x_dst-window_w)/window_w, (2*(y_dst+h_dst)-window_h)/window_h, 0.0f, 1.0f, - (2*(x_dst+w_dst)-window_w)/window_w, (2*(y_dst+h_dst)-window_h)/window_h, 0.0f, 1.0f, - (2*(x_dst+w_dst)-window_w)/window_w, (2*y_dst-window_h)/window_h, 0.0f, 1.0f, + (2.0*x_dst-window_w)/window_w, -(2.0*y_dst-window_h)/window_h, 0.0f, 1.0f, + (2.0*x_dst-window_w)/window_w, -(2.0*(y_dst+h_dst)-window_h)/window_h, 0.0f, 1.0f, + (2.0*(x_dst+w_dst)-window_w)/window_w, -(2.0*(y_dst+h_dst)-window_h)/window_h, 0.0f, 1.0f, + (2.0*(x_dst+w_dst)-window_w)/window_w, -(2.0*y_dst-window_h)/window_h, 0.0f, 1.0f, }; +#if DEBUG_COORD_NORMALIZATION == 1 + g_message("RT2RT: (%d, %d) (%d, %d) (%d, %d) (%d, %d) =>\n" + " (%f, %f) (%f, %f) (%f, %f) (%f, %f)\n" + " window_w: %d window_h: %d", + x_dst, y_dst, + x_dst, y_dst + h_dst, + x_dst + w_dst, y_dst + h_dst, + x_dst + w_dst, y_dst, + vertex_positions[0], vertex_positions[1], + vertex_positions[4], vertex_positions[5], + vertex_positions[8], vertex_positions[9], + vertex_positions[12], vertex_positions[13], + window_w, window_h); +#endif + ctk_render_target_bind(rt_dst); /* Use the shader */ CHECKGL( glUseProgram(g_shTexture->shprog) ); @@ -547,10 +580,6 @@ loc = glGetUniformLocation(g_shTexture->shprog, "color"); CHECKGL( glUniform4f(loc, 1.0f, 1.0f, 1.0f, 1.0f) ); -// loc = glGetUniformLocationARB(shader->shprog, "TextureSize"); -// CHECKGL_MSG( "glGetUniformLocationARB" ); -// CHECKGL( glUniform2fARB(loc, ctk_render_target_get_width(fbo), ctk_render_target_get_height(fbo)) ); - glDisable(GL_BLEND); posId = glGetAttribLocation(g_shTexture->shprog, "a_position"); @@ -588,16 +617,6 @@ CHECKGL (glBindFramebuffer (GL_FRAMEBUFFER, dest_fbo)); -//CHECKGL (glBindRenderbufferEXT (GL_RENDERBUFFER_EXT, priv->cached_renderbuffer_texture)); -//CHECKGL (glRenderbufferStorageEXT (GL_RENDERBUFFER_EXT, -// GL_DEPTH_COMPONENT, -// actor_screen_width, -// actor_screen_height)); -//CHECKGL (glFramebufferRenderbufferEXT (GL_FRAMEBUFFER_EXT, -// GL_DEPTH_ATTACHMENT_EXT, -// GL_RENDERBUFFER_EXT, -// priv->cached_renderbuffer_texture)); - CHECKGL (glActiveTexture(GL_TEXTURE0) ); CHECKGL (glBindTexture (GL_TEXTURE_2D, texid) ); CHECKGL (glTexImage2D (GL_TEXTURE_2D, @@ -654,10 +673,10 @@ GLfloat vertex_positions[] = { - (2*x-window_w)/window_w, (2*y-window_h)/window_h, 0.0f, 1.0f, - (2*(x+w)-window_w)/window_w, (2*y-window_h)/window_h, 0.0f, 1.0f, - (2*(x+w)-window_w)/window_w, (2*(y+h)-window_h)/window_h, 0.0f, 1.0f, - (2*x-window_w)/window_w, (2*(y+h)-window_h)/window_h, 0.0f, 1.0f, + (2.0*x-window_w)/window_w, -(2.0*y-window_h)/window_h, 0.0f, 1.0f, + (2.0*(x+w)-window_w)/window_w, -(2.0*y-window_h)/window_h, 0.0f, 1.0f, + (2.0*(x+w)-window_w)/window_w, -(2.0*(y+h)-window_h)/window_h, 0.0f, 1.0f, + (2.0*x-window_w)/window_w, -(2.0*(y+h)-window_h)/window_h, 0.0f, 1.0f, }; /* Set texture 0 environment mode */ @@ -851,10 +870,10 @@ GLfloat vertex_positions[] = { - (2*x-window_w)/window_w, (2*y-window_h)/window_h, 0.0f, 1.0f, - (2*x-window_w)/window_w, (2*(y+height)-window_h)/window_h, 0.0f, 1.0f, - (2*(x+width)-window_w)/window_w, (2*(y+height)-window_h)/window_h, 0.0f, 1.0f, - (2*(x+width)-window_w)/window_w, (2*y-window_h)/window_h, 0.0f, 1.0f, + (2.0*x-window_w)/window_w, -(2.0*y-window_h)/window_h, 0.0f, 1.0f, + (2.0*x-window_w)/window_w, -(2.0*(y+height)-window_h)/window_h, 0.0f, 1.0f, + (2.0*(x+width)-window_w)/window_w, -(2.0*(y+height)-window_h)/window_h, 0.0f, 1.0f, + (2.0*(x+width)-window_w)/window_w, -(2.0*y-window_h)/window_h, 0.0f, 1.0f, }; /* Set texture 0 environment mode */ @@ -866,11 +885,6 @@ /* Use the shader */ CHECKGL( glUseProgram(g_shTexture->shprog) ); - /* - int VertexLocation = ATTRIB_POSITION; - int TextureCoord0Location = ATTRIB_COLOR_TEXCOORD0; - int VertexColorLocation = ATTRIB_COLOR;*/ - /* Save the blending states */ glEnable(GL_BLEND); @@ -897,7 +911,6 @@ CHECKGL( glUseProgram(0) ); CHECKGL( glActiveTexture (GL_TEXTURE0) ); CHECKGL( glBindTexture (GL_TEXTURE_2D, 0) ) - } void @@ -934,15 +947,12 @@ GLfloat vertex_positions[] = { - (2*x-window_w)/window_w, (2*y-window_h)/window_h, 0.0f, 1.0f, - (2*x-window_w)/window_w, (2*(y+height)-window_h)/window_h, 0.0f, 1.0f, - (2*(x+width)-window_w)/window_w, (2*(y+height)-window_h)/window_h, 0.0f, 1.0f, - (2*(x+width)-window_w)/window_w, (2*y-window_h)/window_h, 0.0f, 1.0f, + (2.0*x-window_w)/window_w, -(2.0*y-window_h)/window_h, 0.0f, 1.0f, + (2.0*x-window_w)/window_w, -(2.0*(y+height)-window_h)/window_h, 0.0f, 1.0f, + (2.0*(x+width)-window_w)/window_w, -(2.0*(y+height)-window_h)/window_h, 0.0f, 1.0f, + (2.0*(x+width)-window_w)/window_w, -(2.0*y-window_h)/window_h, 0.0f, 1.0f, }; - /* sanity check */ - - /* Set texture 0 environment mode */ { CHECKGL( glActiveTexture(GL_TEXTURE0) ); diff -Nru clutk-0.3.60+gles2+2/data/shaders/ExponentProgram.fparb.h clutk-0.3.60+gles2+2rev286alf/data/shaders/ExponentProgram.fparb.h --- clutk-0.3.60+gles2+2/data/shaders/ExponentProgram.fparb.h 2010-09-28 17:42:46.000000000 +0000 +++ clutk-0.3.60+gles2+2rev286alf/data/shaders/ExponentProgram.fparb.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,42 +0,0 @@ -const char * ExponentProgram_fparb = -"!!ARBfp1.0\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"PARAM Exponent = program.local[0];\n" -"\n" -"TEMP tex0;\n" -"TEMP exp_result;\n" -"\n" -"TEX tex0, fragment.texcoord[0], texture[0], 2D;\n" -"\n" -"POW exp_result, tex0.a, Exponent.r;\n" -"MOV result.color, exp_result;\n" -"\n" -"END\n" -"\n" -; diff -Nru clutk-0.3.60+gles2+2/data/shaders/Gaussian7x7Program.fparb.h clutk-0.3.60+gles2+2rev286alf/data/shaders/Gaussian7x7Program.fparb.h --- clutk-0.3.60+gles2+2/data/shaders/Gaussian7x7Program.fparb.h 2010-09-28 17:42:46.000000000 +0000 +++ clutk-0.3.60+gles2+2rev286alf/data/shaders/Gaussian7x7Program.fparb.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,71 +0,0 @@ -const char * Gaussian7x7Program_fparb = -"!!ARBfp1.0\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -" \n" -"TEMP tex0;\n" -"TEMP texcoord;\n" -"TEMP final;\n" -"\n" -"\n" -"MOV final, {0, 0, 0, 0};\n" -"MOV texcoord, {0, 0, 0, 0};\n" -"\n" -"ADD texcoord, program.local[0], fragment.texcoord[0];\n" -"TEX tex0, texcoord, texture[0], 2D;\n" -"MAD final, tex0, program.local[3], final;\n" -"\n" -"ADD texcoord, program.local[1], fragment.texcoord[0];\n" -"TEX tex0, texcoord, texture[0], 2D;\n" -"MAD final, tex0, program.local[4], final;\n" -"\n" -"ADD texcoord, program.local[2], fragment.texcoord[0];\n" -"TEX tex0, texcoord, texture[0], 2D;\n" -"MAD final, tex0, program.local[5], final;\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"MOV result.color, final;\n" -"\n" -"END\n" -"\n" -; diff -Nru clutk-0.3.60+gles2+2/data/shaders/Makefile.am clutk-0.3.60+gles2+2rev286alf/data/shaders/Makefile.am --- clutk-0.3.60+gles2+2/data/shaders/Makefile.am 2010-09-28 17:08:02.000000000 +0000 +++ clutk-0.3.60+gles2+2rev286alf/data/shaders/Makefile.am 2010-10-06 12:43:47.000000000 +0000 @@ -10,9 +10,9 @@ BlurV1.frag \ ColorMask.frag \ Exponent.frag \ - MultipassBlur.frag \ + MultipassBlur.frag \ PassThrough.frag \ - TextureMask.frag \ + TextureMask.frag \ PostProcessVertexShader.vtx \ shaders.h \ ExponentProgram.fparb.h \ diff -Nru clutk-0.3.60+gles2+2/data/shaders/MultipassBlur.fparb.h clutk-0.3.60+gles2+2rev286alf/data/shaders/MultipassBlur.fparb.h --- clutk-0.3.60+gles2+2/data/shaders/MultipassBlur.fparb.h 2010-09-28 17:42:46.000000000 +0000 +++ clutk-0.3.60+gles2+2rev286alf/data/shaders/MultipassBlur.fparb.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,76 +0,0 @@ -const char * MultipassBlur_fparb = -"!!ARBfp1.0\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"ATTRIB primColor = fragment.color.primary;\n" -"\n" -"\n" -"PARAM factors1 = program.local[0];\n" -"PARAM factors2 = program.local[1];\n" -"\n" -"OUTPUT fragColor = result.color;\n" -"\n" -"TEMP sample;\n" -"TEMP sum;\n" -"\n" -"MOV sum.rgba, 0.0;\n" -"\n" -"TEX sample, fragment.texcoord[0], texture[0], 2D;\n" -"MAD sum.rgba, sample, factors1.x, sum;\n" -"\n" -"TEX sample, fragment.texcoord[1], texture[0], 2D;\n" -"MAD sum.rgba, sample, factors1.y, sum;\n" -"\n" -"TEX sample, fragment.texcoord[2], texture[0], 2D;\n" -"MAD sum.rgba, sample, factors1.z, sum;\n" -"\n" -"TEX sample, fragment.texcoord[3], texture[0], 2D;\n" -"MAD sum.rgba, sample, factors1.w, sum;\n" -"\n" -"TEX sample, fragment.texcoord[4], texture[0], 2D;\n" -"MAD sum.rgba, sample, factors2.x, sum;\n" -"\n" -"TEX sample, fragment.texcoord[5], texture[0], 2D;\n" -"MAD sum.rgba, sample, factors2.y, sum;\n" -"\n" -"TEX sample, fragment.texcoord[6], texture[0], 2D;\n" -"MAD sum.rgba, sample, factors2.z, sum;\n" -"\n" -"MUL fragColor, sum, primColor;\n" -"\n" -"END\n" -"\n" -; diff -Nru clutk-0.3.60+gles2+2/data/shaders/TextureAlphaProgram.fparb.h clutk-0.3.60+gles2+2rev286alf/data/shaders/TextureAlphaProgram.fparb.h --- clutk-0.3.60+gles2+2/data/shaders/TextureAlphaProgram.fparb.h 2010-09-28 17:42:46.000000000 +0000 +++ clutk-0.3.60+gles2+2rev286alf/data/shaders/TextureAlphaProgram.fparb.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ -const char * TextureAlphaProgram_fparb = -"!!ARBfp1.0\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"TEMP tex0;\n" -"TEX tex0, fragment.texcoord[0], texture[0], 2D;\n" -"MUL result.color, tex0.aaaa, fragment.color;\n" -"\n" -"END\n" -"\n" -; diff -Nru clutk-0.3.60+gles2+2/data/shaders/TextureColorMask.fparb.h clutk-0.3.60+gles2+2rev286alf/data/shaders/TextureColorMask.fparb.h --- clutk-0.3.60+gles2+2/data/shaders/TextureColorMask.fparb.h 2010-09-28 17:42:46.000000000 +0000 +++ clutk-0.3.60+gles2+2rev286alf/data/shaders/TextureColorMask.fparb.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,39 +0,0 @@ -const char * TextureColorMask_fparb = -"!!ARBfp1.0\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"TEMP tex0;\n" -"TEMP tex1;\n" -"TEX tex0, fragment.texcoord[0], texture[0], 2D;\n" -"TEX tex1, fragment.texcoord[1], texture[1], 2D;\n" -"MUL tex0.a, tex0.a, tex1.a;\n" -"MUL tex0.a, tex0.a, fragment.color.primary;\n" -"MOV result.color, tex0;\n" -"END\n" -"\n" -; diff -Nru clutk-0.3.60+gles2+2/data/shaders/TextureMask.fparb.h clutk-0.3.60+gles2+2rev286alf/data/shaders/TextureMask.fparb.h --- clutk-0.3.60+gles2+2/data/shaders/TextureMask.fparb.h 2010-09-28 17:42:46.000000000 +0000 +++ clutk-0.3.60+gles2+2rev286alf/data/shaders/TextureMask.fparb.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ -const char * TextureMask_fparb = -"!!ARBfp1.0\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"TEMP tex0;\n" -"TEMP tex1;\n" -"TEX tex0, fragment.texcoord[0], texture[0], 2D;\n" -"TEX tex1, fragment.texcoord[1], texture[1], 2D;\n" -"MUL tex0, tex0, tex1;\n" -"MUL result.color, tex0, fragment.color.primary;\n" -"END\n" -"\n" -; diff -Nru clutk-0.3.60+gles2+2/data/shaders/TextureProgram.fparb.h clutk-0.3.60+gles2+2rev286alf/data/shaders/TextureProgram.fparb.h --- clutk-0.3.60+gles2+2/data/shaders/TextureProgram.fparb.h 2010-09-28 17:42:46.000000000 +0000 +++ clutk-0.3.60+gles2+2rev286alf/data/shaders/TextureProgram.fparb.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ -const char * TextureProgram_fparb = -"!!ARBfp1.0\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"TEMP tex0;\n" -"TEX tex0, fragment.texcoord[0], texture[0], 2D;\n" -"MUL result.color, tex0, fragment.color.primary;\n" -"\n" -"END\n" -"\n" -; diff -Nru clutk-0.3.60+gles2+2/data/shaders/VertexProgram.vparb.h clutk-0.3.60+gles2+2rev286alf/data/shaders/VertexProgram.vparb.h --- clutk-0.3.60+gles2+2/data/shaders/VertexProgram.vparb.h 2010-09-28 17:42:46.000000000 +0000 +++ clutk-0.3.60+gles2+2rev286alf/data/shaders/VertexProgram.vparb.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,62 +0,0 @@ -const char * VertexProgram_vparb = -"!!ARBvp1.0\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"\n" -"ATTRIB iPos = vertex.position;\n" -"PARAM mvp[4] = { state.matrix.mvp };\n" -"\n" -"OUTPUT oPos = result.position;\n" -"OUTPUT oColor = result.color.primary;\n" -"OUTPUT oTexCoord0 = result.texcoord[0];\n" -"OUTPUT oTexCoord1 = result.texcoord[1];\n" -"OUTPUT oTexCoord2 = result.texcoord[2];\n" -"OUTPUT oTexCoord3 = result.texcoord[3];\n" -"OUTPUT oTexCoord4 = result.texcoord[4];\n" -"OUTPUT oTexCoord5 = result.texcoord[5];\n" -"OUTPUT oTexCoord6 = result.texcoord[6];\n" -"OUTPUT oTexCoord7 = result.texcoord[7];\n" -"\n" -"\n" -"DP4 oPos.x, mvp[0], iPos;\n" -"DP4 oPos.y, mvp[1], iPos;\n" -"DP4 oPos.z, mvp[2], iPos;\n" -"DP4 oPos.w, mvp[3], iPos;\n" -"\n" -"MOV oColor, vertex.color;\n" -"MOV oTexCoord0, vertex.texcoord[0];\n" -"MOV oTexCoord1, vertex.texcoord[1];\n" -"MOV oTexCoord2, vertex.texcoord[2];\n" -"MOV oTexCoord3, vertex.texcoord[3];\n" -"MOV oTexCoord4, vertex.texcoord[4];\n" -"MOV oTexCoord5, vertex.texcoord[5];\n" -"MOV oTexCoord6, vertex.texcoord[6];\n" -"MOV oTexCoord7, vertex.texcoord[7];\n" -"\n" -"END\n" -"\n" -; diff -Nru clutk-0.3.60+gles2+2/debian/changelog clutk-0.3.60+gles2+2rev286alf/debian/changelog --- clutk-0.3.60+gles2+2/debian/changelog 2010-09-28 17:40:54.000000000 +0000 +++ clutk-0.3.60+gles2+2rev286alf/debian/changelog 2010-10-06 12:51:20.000000000 +0000 @@ -1,3 +1,9 @@ +clutk (0.3.60+gles2+2rev286alf) maverick; urgency=low + + * New version (rev. 286 of lp:~afrantzis/+junk/gles2-shaders.alf). + + -- Alexandros Frantzis Wed, 06 Oct 2010 15:46:52 +0300 + clutk (0.3.60+gles2+2) maverick; urgency=low * debian/control: Add libegl1-mesa-dev and libgles2-mesa-dev build dependencies. diff -Nru clutk-0.3.60+gles2+2/tests/Makefile.am clutk-0.3.60+gles2+2rev286alf/tests/Makefile.am --- clutk-0.3.60+gles2+2/tests/Makefile.am 2010-09-28 15:57:49.000000000 +0000 +++ clutk-0.3.60+gles2+2rev286alf/tests/Makefile.am 2010-10-06 12:43:03.000000000 +0000 @@ -1,7 +1,8 @@ check_PROGRAMS = \ test-clutk \ test-clutk-perf \ - test-clutk-text + test-clutk-text \ + test-clutk-effect test_clutk_SOURCES = \ test-actor.c \ @@ -25,6 +26,9 @@ test_clutk_text_SOURCES = \ test-clutk-text.c +test_clutk_effect_SOURCES = \ + test-clutk-effect.c + test_clutk_CPPFLAGS = \ -I$(top_srcdir) \ -I$(top_srcdir)/clutk \ @@ -58,6 +62,17 @@ $(GTK_CFLAGS) \ $(MAINTAINER_CFLAGS) +test_clutk_effect_CPPFLAGS = \ + -I$(top_srcdir) \ + -I$(top_srcdir)/clutk \ + -I$(top_builddir)/clutk \ + -DTESTDIR=\""$(top_srcdir)/tests"\" \ + $(GCC_FLAGS) \ + $(CLUTTER_CFLAGS) \ + $(CLUTTER_GTK_CFLAGS) \ + $(GTK_CFLAGS) \ + $(MAINTAINER_CFLAGS) + test_clutk_LDADD = \ $(top_builddir)/clutk/libclutk-0.3.la \ $(CLUTTER_LIBS) \ @@ -77,6 +92,12 @@ $(CLUTTER_GTK_LIBS) \ $(GTK_LIBS) +test_clutk_effect_LDADD = \ + $(top_builddir)/clutk/libclutk-0.3.la \ + $(CLUTTER_LIBS) \ + $(CLUTTER_GTK_LIBS) \ + $(GTK_LIBS) + EXTRA_DIST = \ 20x20.png \ ubuntu.svg \ diff -Nru clutk-0.3.60+gles2+2/tests/test-clutk.c clutk-0.3.60+gles2+2rev286alf/tests/test-clutk.c --- clutk-0.3.60+gles2+2/tests/test-clutk.c 2010-09-28 17:14:43.000000000 +0000 +++ clutk-0.3.60+gles2+2rev286alf/tests/test-clutk.c 2010-10-06 12:45:50.000000000 +0000 @@ -40,6 +40,12 @@ { g_type_init (); g_test_init (&argc, &argv, NULL); + + /* + * g_test_init causes all warnings to be fatal. In some cases and hardware, + * however, we get some harmless warnings that nevertheless cause the tests + * to abort, so we reset the log fatal mask here. + */ g_log_set_always_fatal((GLogLevelFlags) G_LOG_FATAL_MASK); ctk_init (&argc, &argv); diff -Nru clutk-0.3.60+gles2+2/tests/test-clutk-effect.c clutk-0.3.60+gles2+2rev286alf/tests/test-clutk-effect.c --- clutk-0.3.60+gles2+2/tests/test-clutk-effect.c 1970-01-01 00:00:00.000000000 +0000 +++ clutk-0.3.60+gles2+2rev286alf/tests/test-clutk-effect.c 2010-10-06 12:43:03.000000000 +0000 @@ -0,0 +1,117 @@ +/* + * Copyright (C) 2010 Canonical Ltd + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 3 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * Authored by Alexandros Frantzis + * + */ + +#include +#include +#include +#include +#include +#include + +#define DROP_SHADOW_BLUR 2.0 +#define DROP_SHADOW_OFFSET 10 +#define ACTOR_SIZE 125 +#define TIMELINE_SECONDS 10 + +void +on_completed (ClutterTimeline* timeline, + gpointer data) +{ + clutter_main_quit (); +} + +int +main (int argc, + char** argv) +{ + ClutterColor bg_color = {128, 128, 128, 255}; + ClutterActor* stage; + ClutterActor* actor_blur; + ClutterActor* actor_glow; + ClutterActor* actor_shadow; + CtkEffect* blur; + CtkEffect* glow; + CtkEffect* shadow; + ClutterTimeline* timeline; + gfloat stage_width; + gfloat stage_height; + + /* Make sure rendering is not throttled by sync-to-vblank */ + g_setenv ("CLUTTER_VBLANK", "none", FALSE); + + ctk_init (&argc, &argv); + + /* Create the stage to draw on */ + stage = clutter_stage_get_default (); + clutter_stage_set_color (CLUTTER_STAGE (stage), &bg_color); + clutter_actor_get_size (stage, &stage_width, &stage_height); + + /* Create the effects */ + blur = CTK_EFFECT (ctk_effect_blur_new ()); + glow = CTK_EFFECT (ctk_effect_glow_new ()); + shadow = CTK_EFFECT (ctk_effect_drop_shadow_new (DROP_SHADOW_BLUR, + DROP_SHADOW_OFFSET, + DROP_SHADOW_OFFSET)); + + /* Create the actors and attach effects */ + actor_blur = ctk_image_new_from_filename (ACTOR_SIZE, "./ubuntu.svg"); + actor_glow = ctk_image_new_from_filename (ACTOR_SIZE, "./ubuntu.svg"); + actor_shadow = ctk_image_new_from_filename (ACTOR_SIZE, "./ubuntu.svg"); + + ctk_actor_add_effect (CTK_ACTOR (actor_blur), CTK_EFFECT (blur)); + ctk_actor_add_effect (CTK_ACTOR (actor_glow), CTK_EFFECT (glow)); + ctk_actor_add_effect (CTK_ACTOR (actor_shadow), CTK_EFFECT (shadow)); + + /* Place actors on the stage */ + clutter_actor_set_anchor_point (actor_blur, ACTOR_SIZE / 2, ACTOR_SIZE / 2); + clutter_actor_set_position (actor_blur, + stage_width / 4, + stage_height / 2); + + clutter_actor_set_anchor_point (actor_glow, ACTOR_SIZE / 2, ACTOR_SIZE / 2); + clutter_actor_set_position (actor_glow, + 2 * stage_width / 4, + stage_height / 2); + + clutter_actor_set_anchor_point (actor_shadow, ACTOR_SIZE / 2, ACTOR_SIZE / 2); + clutter_actor_set_position (actor_shadow, + 3 * stage_width / 4, + stage_height / 2); + + clutter_container_add_actor (CLUTTER_CONTAINER (stage), actor_blur); + clutter_container_add_actor (CLUTTER_CONTAINER (stage), actor_glow); + clutter_container_add_actor (CLUTTER_CONTAINER (stage), actor_shadow); + + /* Make sure we actually see all the actors that have just been created */ + clutter_actor_show_all (stage); + + timeline = clutter_timeline_new (TIMELINE_SECONDS * 1000); + g_signal_connect (timeline, + "completed", + G_CALLBACK (on_completed), + NULL); + + clutter_timeline_start (timeline); + clutter_timeline_set_loop (timeline, FALSE); + + clutter_main (); + + return 0; +} + diff -Nru clutk-0.3.60+gles2+2/tests/test-clutk-perf.c clutk-0.3.60+gles2+2rev286alf/tests/test-clutk-perf.c --- clutk-0.3.60+gles2+2/tests/test-clutk-perf.c 2010-09-28 17:14:41.000000000 +0000 +++ clutk-0.3.60+gles2+2rev286alf/tests/test-clutk-perf.c 2010-10-06 12:44:52.000000000 +0000 @@ -81,6 +81,12 @@ g_type_init (); g_test_init (&argc, &argv, NULL); + + /* + * g_test_init causes all warnings to be fatal. In some cases and hardware, + * however, we get some harmless warnings that nevertheless cause the tests + * to abort, so we reset the log fatal mask here. + */ g_log_set_always_fatal((GLogLevelFlags) G_LOG_FATAL_MASK); if (argc != 13)