surface->compositor = compositor;
surface->image = EGL_NO_IMAGE_KHR;
- surface->alpha = 255;
- surface->brightness = 255;
- surface->saturation = 255;
+ surface->alpha = 1.0;
+ surface->brightness = 1.0;
+ surface->saturation = 1.0;
surface->blend = 1;
surface->opaque_rect[0] = 0.0;
surface->opaque_rect[1] = 0.0;
surface->geometry.width,
surface->geometry.height);
- if (surface->alpha == 255) {
+ if (surface->alpha == 1.0) {
pixman_region32_copy(&surface->transform.opaque,
&surface->opaque);
pixman_region32_translate(&surface->transform.opaque,
1, GL_FALSE, output->matrix.d);
glUniform1i(es->shader->tex_uniform, 0);
glUniform4fv(es->shader->color_uniform, 1, es->color);
- glUniform1f(es->shader->alpha_uniform, es->alpha / 255.0);
- glUniform1f(es->shader->brightness_uniform, es->brightness / 255.0);
- glUniform1f(es->shader->saturation_uniform, es->saturation / 255.0);
+ glUniform1f(es->shader->alpha_uniform, es->alpha);
+ glUniform1f(es->shader->brightness_uniform, es->brightness);
+ glUniform1f(es->shader->saturation_uniform, es->saturation);
glUniform1f(es->shader->texwidth_uniform,
(GLfloat)es->geometry.width / es->pitch);
glUniform4fv(es->shader->opaque_uniform, 1, es->opaque_rect);
&switcher->listener);
switcher->current = next;
- next->alpha = 255;
+ next->alpha = 1.0;
shsurf = get_shell_surface(switcher->current);
if (shsurf && shsurf->type ==SHELL_SURFACE_FULLSCREEN)
- shsurf->fullscreen.black_surface->alpha = 255;
+ shsurf->fullscreen.black_surface->alpha = 1.0;
}
static void
struct wl_keyboard *keyboard = switcher->grab.keyboard;
wl_list_for_each(surface, &compositor->surface_list, link) {
- surface->alpha = 255;
+ surface->alpha = 1.0;
weston_surface_damage(surface);
}
0.5f * es->geometry.width,
0.5f * es->geometry.height, 0);
- es->alpha = zoom->spring.current * 255;
- if (es->alpha > 255)
- es->alpha = 255;
+ es->alpha = zoom->spring.current;
+ if (es->alpha > 1.0)
+ es->alpha = 1.0;
zoom->surface->geometry.dirty = 1;
weston_compositor_schedule_repaint(es->compositor);
fade_factor = 0;
else
fade_factor = fade->spring.current;
- es->alpha = fade_factor * 255;
+ es->alpha = fade_factor;
fade->surface->geometry.dirty = 1;
weston_compositor_schedule_repaint(es->compositor);