aboutsummaryrefslogtreecommitdiff
path: root/render/gles2
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2017-06-22 16:32:47 -0400
committerDrew DeVault <sir@cmpwn.com>2017-06-23 13:41:07 -0400
commit2aafb5dd19f8a3e3436f8843071fa2076a6d2716 (patch)
tree6fe60ddeb499ebad270fae0c929ef4c79188e969 /render/gles2
parentf252c5a79214a3d3cd7ab3f239050b234e4ae9e2 (diff)
Add wlcore/wl_shm (WIP)
Diffstat (limited to 'render/gles2')
-rw-r--r--render/gles2/renderer.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/render/gles2/renderer.c b/render/gles2/renderer.c
index 623f378e..f3906125 100644
--- a/render/gles2/renderer.c
+++ b/render/gles2/renderer.c
@@ -129,6 +129,7 @@ static void draw_quad() {
static bool wlr_gles2_render_surface(struct wlr_renderer_state *state,
struct wlr_surface *surface, const float (*matrix)[16]) {
assert(surface && surface->valid);
+ // TODO: Convert GL formats to WL_SHM formats
switch (surface->format) {
case GL_RGB:
GL_CALL(glUseProgram(shaders.rgb));
@@ -163,6 +164,16 @@ static void wlr_gles2_render_ellipse(struct wlr_renderer_state *state,
draw_quad();
}
+static const enum wl_shm_format *wlr_gles2_formats(
+ struct wlr_renderer_state *state, size_t *len) {
+ static enum wl_shm_format formats[] = {
+ WL_SHM_FORMAT_ARGB8888,
+ WL_SHM_FORMAT_XRGB8888,
+ };
+ *len = sizeof(formats) / sizeof(formats[0]);
+ return formats;
+}
+
static void wlr_gles2_destroy(struct wlr_renderer_state *state) {
// no-op
}
@@ -174,6 +185,7 @@ static struct wlr_renderer_impl wlr_renderer_impl = {
.render_with_matrix = wlr_gles2_render_surface,
.render_quad = wlr_gles2_render_quad,
.render_ellipse = wlr_gles2_render_ellipse,
+ .formats = wlr_gles2_formats,
.destroy = wlr_gles2_destroy
};