summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPekka Paalanen <pekka.paalanen@collabora.co.uk>2015-02-09 13:56:56 +0200
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>2015-02-25 14:48:09 +0200
commitaeb917ee5debc21a9636f32cfd1ebbd89fc934bd (patch)
treeb6e259c293be814e003efef414d2cf67c1b5a8f6
parent312fe5f4453c3637ed8d8fd35609dc1e64aec19e (diff)
gl-renderer: add BUFFER_TYPE_SOLID
Add a new buffer type identifying the solid color contents which do not have a real buffer. Solid color surfaces now pretend to have 1x1 pixel content data. This helps the future surface_get_data_size() implementation. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Tested-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp> Reviewed-by: Daniel Stone <daniels@collabora.com>
-rw-r--r--src/gl-renderer.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gl-renderer.c b/src/gl-renderer.c
index 3a70c3b9..8a7a44bd 100644
--- a/src/gl-renderer.c
+++ b/src/gl-renderer.c
@@ -79,6 +79,7 @@ struct gl_output_state {
enum buffer_type {
BUFFER_TYPE_NULL,
+ BUFFER_TYPE_SOLID, /* internal solid color surfaces without a buffer */
BUFFER_TYPE_SHM,
BUFFER_TYPE_EGL
};
@@ -1355,6 +1356,9 @@ gl_renderer_surface_set_color(struct weston_surface *surface,
gs->color[1] = green;
gs->color[2] = blue;
gs->color[3] = alpha;
+ gs->buffer_type = BUFFER_TYPE_SOLID;
+ gs->pitch = 1;
+ gs->height = 1;
gs->shader = &gr->solid_shader;
}