surface->alpha = 255;
surface->brightness = 255;
surface->saturation = 255;
+ surface->opaque_rect[0] = 0.0;
+ surface->opaque_rect[1] = 0.0;
+ surface->opaque_rect[2] = 0.0;
+ surface->opaque_rect[3] = 0.0;
surface->pitch = 1;
surface->buffer = NULL;
glUniform1f(es->shader->saturation_uniform, es->saturation / 255.0);
glUniform1f(es->shader->texwidth_uniform,
(GLfloat)es->geometry.width / es->pitch);
+ glUniform4fv(es->shader->opaque_uniform, 1, es->opaque_rect);
if (es->transform.enabled || output->zoom.active)
filter = GL_LINEAR;
"uniform float bright;\n"
"uniform float saturation;\n"
"uniform float texwidth;\n"
+ "uniform vec4 opaque;\n"
"void main()\n"
"{\n"
" if (v_texcoord.x < 0.0 || v_texcoord.x > texwidth ||\n"
" vec3 range = (gl_FragColor.rgb - vec3 (gray, gray, gray)) * saturation;\n"
" gl_FragColor = vec4(vec3(gray + range), gl_FragColor.a);\n"
" gl_FragColor = vec4(vec3(bright, bright, bright) * gl_FragColor.rgb, gl_FragColor.a);\n"
+ " if (opaque.x <= v_texcoord.x && v_texcoord.x < opaque.y &&\n"
+ " opaque.z <= v_texcoord.y && v_texcoord.y < opaque.w)\n"
+ " gl_FragColor.a = 1.0;\n"
" gl_FragColor = alpha * gl_FragColor;\n"
"}\n";
shader->color_uniform = glGetUniformLocation(shader->program, "color");
shader->texwidth_uniform = glGetUniformLocation(shader->program,
"texwidth");
+ shader->opaque_uniform =
+ glGetUniformLocation(shader->program, "opaque");
return 0;
}
cairo_destroy(cr);
cairo_surface_destroy(surface);
+
+ if (window->surface) {
+ /* We leave an extra pixel around the X window area to
+ * make sure we don't sample from the undefined alpha
+ * channel when filtering. */
+ window->surface->opaque_rect[0] =
+ (double) (t->margin + t->width - 1) / width;
+ window->surface->opaque_rect[1] =
+ (double) (t->margin + t->width +
+ window->width + 1) / width;
+ window->surface->opaque_rect[2] =
+ (double) (t->margin + t->titlebar_height - 1) / height;
+ window->surface->opaque_rect[3] =
+ (double) (t->margin + t->titlebar_height +
+ window->height + 1) / height;
+ }
}
static void
wl_signal_add(&surface->resource.destroy_signal,
&window->surface_destroy_listener);
+ weston_wm_window_schedule_repaint(window);
+
if (shell_interface->create_shell_surface) {
shell_interface->create_shell_surface(shell_interface->shell,
window->surface,