compositor: Move surface color state to gles2-renderer.
This moves the surface color state into gles2-renderer. To do this it
adds two new weston_renderer functions. create_surface to be able to
create per-surface renderer state, and surface_set_color to set the
color of a surface and changes it to a color surface.
diff --git a/src/compositor.h b/src/compositor.h
index 57d363a..f66e58d 100644
--- a/src/compositor.h
+++ b/src/compositor.h
@@ -284,6 +284,10 @@
pixman_region32_t *output_damage);
void (*flush_damage)(struct weston_surface *surface);
void (*attach)(struct weston_surface *es, struct wl_buffer *buffer);
+ int (*create_surface)(struct weston_surface *surface);
+ void (*surface_set_color)(struct weston_surface *surface,
+ float red, float green,
+ float blue, float alpha);
void (*destroy_surface)(struct weston_surface *surface);
};
@@ -421,10 +425,11 @@
struct wl_list link;
struct wl_list layer_link;
struct weston_shader *shader;
- GLfloat color[4];
float alpha;
struct weston_plane *plane;
+ void *renderer_state;
+
/* Surface geometry state, mutable.
* If you change anything, set dirty = 1.
* That includes the transformations referenced from the list.