aboutsummaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
Diffstat (limited to 'render')
-rw-r--r--render/egl.c18
-rw-r--r--render/wlr_renderer.c9
2 files changed, 15 insertions, 12 deletions
diff --git a/render/egl.c b/render/egl.c
index 644f94ac..cc00dece 100644
--- a/render/egl.c
+++ b/render/egl.c
@@ -1,11 +1,12 @@
#include <assert.h>
-#include <stdio.h>
+#include <drm_fourcc.h>
#include <EGL/egl.h>
#include <EGL/eglext.h>
+#include <stdio.h>
#include <stdlib.h>
-#include <drm_fourcc.h>
#include <wlr/render/egl.h>
#include <wlr/util/log.h>
+#include <wlr/util/region.h>
#include "glapi.h"
static bool egl_get_config(EGLDisplay disp, EGLint *attribs, EGLConfig *out,
@@ -329,9 +330,18 @@ bool wlr_egl_swap_buffers(struct wlr_egl *egl, EGLSurface surface,
EGLBoolean ret;
if (damage != NULL && (egl->exts.swap_buffers_with_damage_ext ||
egl->exts.swap_buffers_with_damage_khr)) {
+ EGLint width = 0, height = 0;
+ eglQuerySurface(egl->display, surface, EGL_WIDTH, &width);
+ eglQuerySurface(egl->display, surface, EGL_HEIGHT, &height);
+
+ pixman_region32_t flipped_damage;
+ pixman_region32_init(&flipped_damage);
+ wlr_region_transform(&flipped_damage, damage,
+ WL_OUTPUT_TRANSFORM_FLIPPED_180, width, height);
+
int nrects;
pixman_box32_t *rects =
- pixman_region32_rectangles(damage, &nrects);
+ pixman_region32_rectangles(&flipped_damage, &nrects);
EGLint egl_damage[4 * nrects];
for (int i = 0; i < nrects; ++i) {
egl_damage[4*i] = rects[i].x1;
@@ -340,6 +350,8 @@ bool wlr_egl_swap_buffers(struct wlr_egl *egl, EGLSurface surface,
egl_damage[4*i + 3] = rects[i].y2 - rects[i].y1;
}
+ pixman_region32_fini(&flipped_damage);
+
if (egl->exts.swap_buffers_with_damage_ext) {
ret = eglSwapBuffersWithDamageEXT(egl->display, surface, egl_damage,
nrects);
diff --git a/render/wlr_renderer.c b/render/wlr_renderer.c
index ca1a337d..58731d7f 100644
--- a/render/wlr_renderer.c
+++ b/render/wlr_renderer.c
@@ -139,15 +139,6 @@ int wlr_renderer_get_dmabuf_modifiers(struct wlr_renderer *r, int format,
return r->impl->get_dmabuf_modifiers(r, format, modifiers);
}
-bool wlr_renderer_preferred_read_format(struct wlr_renderer *r,
- enum wl_shm_format *fmt) {
- if (!r->impl->preferred_read_format || !r->impl->read_pixels) {
- return false;
- }
- *fmt = r->impl->preferred_read_format(r);
- return true;
-}
-
bool wlr_renderer_read_pixels(struct wlr_renderer *r, enum wl_shm_format fmt,
uint32_t *flags, uint32_t stride, uint32_t width, uint32_t height,
uint32_t src_x, uint32_t src_y, uint32_t dst_x, uint32_t dst_y,