diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-03-17 15:22:00 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-17 15:22:00 -0400 |
commit | 1956d3cedb533fb44a7f6a446afe84572838ca39 (patch) | |
tree | d39aed6d0c9b6b1cb88d5666197570886239253f /backend/drm | |
parent | 09413aa7f1eab176c12675217a17ebe367fa7d8f (diff) | |
parent | f1cbbac636d59d22373883f6bc85f8863e01c8c5 (diff) |
Merge pull request #722 from emersion/matrix-redesign
Matrix redesign
Diffstat (limited to 'backend/drm')
-rw-r--r-- | backend/drm/drm.c | 12 | ||||
-rw-r--r-- | backend/drm/renderer.c | 22 |
2 files changed, 17 insertions, 17 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c index 0d1d527d..fd436659 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -17,7 +17,7 @@ #include <wlr/interfaces/wlr_output.h> #include <wlr/render.h> #include <wlr/render/gles2.h> -#include <wlr/render/matrix.h> +#include <wlr/types/wlr_matrix.h> #include <wlr/util/log.h> #include <xf86drm.h> #include <xf86drmMode.h> @@ -587,8 +587,8 @@ static bool wlr_drm_connector_set_cursor(struct wlr_output *output, enum wl_output_transform transform = wlr_output_transform_compose( wlr_output_transform_invert(output->transform), WL_OUTPUT_TRANSFORM_FLIPPED_180); - wlr_matrix_texture(plane->matrix, plane->surf.width, plane->surf.height, - transform); + wlr_matrix_projection(plane->matrix, plane->surf.width, + plane->surf.height, transform); plane->wlr_tex = wlr_render_texture_create(plane->surf.renderer->wlr_rend); @@ -647,10 +647,8 @@ static bool wlr_drm_connector_set_cursor(struct wlr_output *output, glClearColor(0.0, 0.0, 0.0, 0.0); glClear(GL_COLOR_BUFFER_BIT); - float matrix[16]; - wlr_texture_get_matrix(plane->wlr_tex, &matrix, &plane->matrix, 0, 0); - wlr_render_with_matrix(plane->surf.renderer->wlr_rend, plane->wlr_tex, - &matrix, 1.0f); + wlr_render_texture(plane->surf.renderer->wlr_rend, plane->wlr_tex, + plane->matrix, 0, 0, 1.0f); glFinish(); glPixelStorei(GL_UNPACK_ROW_LENGTH_EXT, bo_stride); diff --git a/backend/drm/renderer.c b/backend/drm/renderer.c index 7ee13843..f700dd59 100644 --- a/backend/drm/renderer.c +++ b/backend/drm/renderer.c @@ -1,3 +1,4 @@ +#include <assert.h> #include <EGL/egl.h> #include <EGL/eglext.h> #include <gbm.h> @@ -9,7 +10,7 @@ #include <wlr/render.h> #include <wlr/render/egl.h> #include <wlr/render/gles2.h> -#include <wlr/render/matrix.h> +#include <wlr/types/wlr_matrix.h> #include <wlr/util/log.h> #include "backend/drm/drm.h" #include "glapi.h" @@ -226,20 +227,21 @@ struct gbm_bo *wlr_drm_surface_mgpu_copy(struct wlr_drm_surface *dest, wlr_drm_surface_make_current(dest, NULL); struct wlr_texture *tex = get_tex_for_bo(dest->renderer, src); + assert(tex); - static const float matrix[16] = { + static const float color[] = {0.0, 0.0, 0.0, 1.0}; + + static const float mat[9] = { [0] = 2.0f, - [3] = -1.0f, - [5] = 2.0f, - [7] = -1.0f, - [10] = 1.0f, - [15] = 1.0f, + [2] = -1.0f, + [4] = 2.0f, + [5] = -1.0f, + [8] = 1.0f, }; glViewport(0, 0, dest->width, dest->height); - glClearColor(0.0, 0.0, 0.0, 1.0); - glClear(GL_COLOR_BUFFER_BIT); - wlr_render_with_matrix(dest->renderer->wlr_rend, tex, &matrix, 1.0f); + wlr_renderer_clear(dest->renderer->wlr_rend, color); + wlr_render_texture_with_matrix(dest->renderer->wlr_rend, tex, mat, 1.0f); return wlr_drm_surface_swap_buffers(dest, NULL); } |