mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2025-12-20 03:30:19 +01:00
libweston: move gl-borders up to weston_renderer
This just moves gl-borders up to libweston weston_renderer as-is, with no change in functionality. This is a preparation step so that other renderers can use the same interface. Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
This commit is contained in:
parent
f71db77341
commit
4ab8d6d2c4
10 changed files with 101 additions and 101 deletions
|
|
@ -42,7 +42,7 @@
|
||||||
#include "pixel-formats.h"
|
#include "pixel-formats.h"
|
||||||
#include "pixman-renderer.h"
|
#include "pixman-renderer.h"
|
||||||
#include "renderer-gl/gl-renderer.h"
|
#include "renderer-gl/gl-renderer.h"
|
||||||
#include "gl-borders.h"
|
#include "renderer-borders.h"
|
||||||
#include "shared/weston-drm-fourcc.h"
|
#include "shared/weston-drm-fourcc.h"
|
||||||
#include "shared/weston-egl-ext.h"
|
#include "shared/weston-egl-ext.h"
|
||||||
#include "shared/cairo-util.h"
|
#include "shared/cairo-util.h"
|
||||||
|
|
@ -84,9 +84,7 @@ struct headless_output {
|
||||||
weston_renderbuffer_t renderbuffer;
|
weston_renderbuffer_t renderbuffer;
|
||||||
|
|
||||||
struct frame *frame;
|
struct frame *frame;
|
||||||
struct {
|
struct weston_renderer_borders borders;
|
||||||
struct weston_gl_borders borders;
|
|
||||||
} gl;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static const uint32_t headless_formats[] = {
|
static const uint32_t headless_formats[] = {
|
||||||
|
|
@ -144,15 +142,15 @@ finish_frame_handler(void *data)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
headless_output_update_gl_border(struct headless_output *output)
|
headless_output_update_renderer_border(struct headless_output *output)
|
||||||
{
|
{
|
||||||
if (!output->frame)
|
if (!output->frame)
|
||||||
return;
|
return;
|
||||||
if (!(frame_status(output->frame) & FRAME_STATUS_REPAINT))
|
if (!(frame_status(output->frame) & FRAME_STATUS_REPAINT))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
weston_gl_borders_update(&output->gl.borders, output->frame,
|
weston_renderer_borders_update(&output->borders, output->frame,
|
||||||
&output->base);
|
&output->base);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|
@ -166,7 +164,7 @@ headless_output_repaint(struct weston_output *output_base)
|
||||||
|
|
||||||
ec = output->base.compositor;
|
ec = output->base.compositor;
|
||||||
|
|
||||||
headless_output_update_gl_border(output);
|
headless_output_update_renderer_border(output);
|
||||||
|
|
||||||
pixman_region32_init(&damage);
|
pixman_region32_init(&damage);
|
||||||
|
|
||||||
|
|
@ -188,7 +186,7 @@ headless_output_disable_gl(struct headless_output *output)
|
||||||
struct weston_compositor *compositor = output->base.compositor;
|
struct weston_compositor *compositor = output->base.compositor;
|
||||||
const struct weston_renderer *renderer = compositor->renderer;
|
const struct weston_renderer *renderer = compositor->renderer;
|
||||||
|
|
||||||
weston_gl_borders_fini(&output->gl.borders, &output->base);
|
weston_renderer_borders_fini(&output->borders, &output->base);
|
||||||
|
|
||||||
renderer->destroy_renderbuffer(output->renderbuffer);
|
renderer->destroy_renderbuffer(output->renderbuffer);
|
||||||
output->renderbuffer = NULL;
|
output->renderbuffer = NULL;
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ plugin_headless = shared_library(
|
||||||
dep_libweston_private,
|
dep_libweston_private,
|
||||||
dep_libdrm_headers,
|
dep_libdrm_headers,
|
||||||
dep_lib_cairo_shared,
|
dep_lib_cairo_shared,
|
||||||
dep_lib_gl_borders,
|
dep_lib_renderer_borders,
|
||||||
],
|
],
|
||||||
name_prefix: '',
|
name_prefix: '',
|
||||||
install: true,
|
install: true,
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ deps_wlwl = [
|
||||||
dep_libweston_private,
|
dep_libweston_private,
|
||||||
dep_libdrm_headers,
|
dep_libdrm_headers,
|
||||||
dep_lib_cairo_shared,
|
dep_lib_cairo_shared,
|
||||||
dep_lib_gl_borders,
|
dep_lib_renderer_borders,
|
||||||
]
|
]
|
||||||
|
|
||||||
if get_option('renderer-gl')
|
if get_option('renderer-gl')
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@
|
||||||
#include <libweston/libweston.h>
|
#include <libweston/libweston.h>
|
||||||
#include <libweston/backend-wayland.h>
|
#include <libweston/backend-wayland.h>
|
||||||
#include "renderer-gl/gl-renderer.h"
|
#include "renderer-gl/gl-renderer.h"
|
||||||
#include "gl-borders.h"
|
#include "renderer-borders.h"
|
||||||
#include "shared/weston-drm-fourcc.h"
|
#include "shared/weston-drm-fourcc.h"
|
||||||
#include "shared/weston-egl-ext.h"
|
#include "shared/weston-egl-ext.h"
|
||||||
#include "pixman-renderer.h"
|
#include "pixman-renderer.h"
|
||||||
|
|
@ -135,7 +135,6 @@ struct wayland_output {
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
struct wl_egl_window *egl_window;
|
struct wl_egl_window *egl_window;
|
||||||
struct weston_gl_borders borders;
|
|
||||||
} gl;
|
} gl;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
|
|
@ -143,6 +142,8 @@ struct wayland_output {
|
||||||
struct wl_list free_buffers;
|
struct wl_list free_buffers;
|
||||||
} shm;
|
} shm;
|
||||||
|
|
||||||
|
struct weston_renderer_borders borders;
|
||||||
|
|
||||||
struct weston_mode mode;
|
struct weston_mode mode;
|
||||||
struct weston_mode native_mode;
|
struct weston_mode native_mode;
|
||||||
|
|
||||||
|
|
@ -471,15 +472,15 @@ draw_initial_frame(struct wayland_output *output)
|
||||||
|
|
||||||
#ifdef ENABLE_EGL
|
#ifdef ENABLE_EGL
|
||||||
static void
|
static void
|
||||||
wayland_output_update_gl_border(struct wayland_output *output)
|
wayland_output_update_renderer_border(struct wayland_output *output)
|
||||||
{
|
{
|
||||||
if (!output->frame)
|
if (!output->frame)
|
||||||
return;
|
return;
|
||||||
if (!(frame_status(output->frame) & FRAME_STATUS_REPAINT))
|
if (!(frame_status(output->frame) & FRAME_STATUS_REPAINT))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
weston_gl_borders_update(&output->gl.borders, output->frame,
|
weston_renderer_borders_update(&output->borders, output->frame,
|
||||||
&output->base);
|
&output->base);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -519,7 +520,7 @@ wayland_output_repaint_gl(struct weston_output *output_base)
|
||||||
output->frame_cb = wl_surface_frame(output->parent.surface);
|
output->frame_cb = wl_surface_frame(output->parent.surface);
|
||||||
wl_callback_add_listener(output->frame_cb, &frame_listener, output);
|
wl_callback_add_listener(output->frame_cb, &frame_listener, output);
|
||||||
|
|
||||||
wayland_output_update_gl_border(output);
|
wayland_output_update_renderer_border(output);
|
||||||
|
|
||||||
ec->renderer->repaint_output(&output->base, &damage, NULL);
|
ec->renderer->repaint_output(&output->base, &damage, NULL);
|
||||||
|
|
||||||
|
|
@ -703,7 +704,7 @@ wayland_output_disable(struct weston_output *base)
|
||||||
break;
|
break;
|
||||||
#ifdef ENABLE_EGL
|
#ifdef ENABLE_EGL
|
||||||
case WESTON_RENDERER_GL:
|
case WESTON_RENDERER_GL:
|
||||||
weston_gl_borders_fini(&output->gl.borders, &output->base);
|
weston_renderer_borders_fini(&output->borders, &output->base);
|
||||||
|
|
||||||
renderer->gl->output_destroy(&output->base);
|
renderer->gl->output_destroy(&output->base);
|
||||||
wl_egl_window_destroy(output->gl.egl_window);
|
wl_egl_window_destroy(output->gl.egl_window);
|
||||||
|
|
@ -858,7 +859,7 @@ wayland_output_resize_surface(struct wayland_output *output)
|
||||||
weston_renderer_resize_output(&output->base, &fb_size, &area);
|
weston_renderer_resize_output(&output->base, &fb_size, &area);
|
||||||
|
|
||||||
/* These will need to be re-created due to the resize */
|
/* These will need to be re-created due to the resize */
|
||||||
weston_gl_borders_fini(&output->gl.borders, &output->base);
|
weston_renderer_borders_fini(&output->borders, &output->base);
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -76,6 +76,13 @@ struct linux_dmabuf_memory {
|
||||||
void (*destroy)(struct linux_dmabuf_memory *dmabuf);
|
void (*destroy)(struct linux_dmabuf_memory *dmabuf);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum weston_renderer_border_side {
|
||||||
|
WESTON_RENDERER_BORDER_TOP = 0,
|
||||||
|
WESTON_RENDERER_BORDER_LEFT = 1,
|
||||||
|
WESTON_RENDERER_BORDER_RIGHT = 2,
|
||||||
|
WESTON_RENDERER_BORDER_BOTTOM = 3,
|
||||||
|
};
|
||||||
|
|
||||||
struct weston_renderer {
|
struct weston_renderer {
|
||||||
int (*read_pixels)(struct weston_output *output,
|
int (*read_pixels)(struct weston_output *output,
|
||||||
const struct pixel_format_info *format, void *pixels,
|
const struct pixel_format_info *format, void *pixels,
|
||||||
|
|
@ -202,6 +209,39 @@ struct weston_renderer {
|
||||||
enum weston_renderer_type type;
|
enum weston_renderer_type type;
|
||||||
const struct gl_renderer_interface *gl;
|
const struct gl_renderer_interface *gl;
|
||||||
const struct pixman_renderer_interface *pixman;
|
const struct pixman_renderer_interface *pixman;
|
||||||
|
|
||||||
|
/* Sets the output border.
|
||||||
|
*
|
||||||
|
* The side specifies the side for which we are setting the border.
|
||||||
|
* The width and height are the width and height of the border.
|
||||||
|
* The tex_width patemeter specifies the width of the actual
|
||||||
|
* texture; this may be larger than width if the data is not
|
||||||
|
* tightly packed.
|
||||||
|
*
|
||||||
|
* The top and bottom textures will extend over the sides to the
|
||||||
|
* full width of the bordered window. The right and left edges,
|
||||||
|
* however, will extend only to the top and bottom of the
|
||||||
|
* compositor surface. This is demonstrated by the picture below:
|
||||||
|
*
|
||||||
|
* +-----------------------+
|
||||||
|
* | TOP |
|
||||||
|
* +-+-------------------+-+
|
||||||
|
* | | | |
|
||||||
|
* |L| |R|
|
||||||
|
* |E| |I|
|
||||||
|
* |F| |G|
|
||||||
|
* |T| |H|
|
||||||
|
* | | |T|
|
||||||
|
* | | | |
|
||||||
|
* +-+-------------------+-+
|
||||||
|
* | BOTTOM |
|
||||||
|
* +-----------------------+
|
||||||
|
*/
|
||||||
|
void (*output_set_border)(struct weston_output *output,
|
||||||
|
enum weston_renderer_border_side side,
|
||||||
|
int32_t width, int32_t height,
|
||||||
|
int32_t tex_width, unsigned char *data);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct weston_tearing_control {
|
struct weston_tearing_control {
|
||||||
|
|
|
||||||
|
|
@ -223,9 +223,9 @@ dep_vertex_clipping = declare_dependency(
|
||||||
include_directories: include_directories('.')
|
include_directories: include_directories('.')
|
||||||
)
|
)
|
||||||
|
|
||||||
lib_gl_borders = static_library(
|
lib_renderer_borders = static_library(
|
||||||
'gl-borders',
|
'renderer-borders',
|
||||||
'gl-borders.c',
|
'renderer-borders.c',
|
||||||
include_directories: common_inc,
|
include_directories: common_inc,
|
||||||
dependencies: [
|
dependencies: [
|
||||||
dep_lib_cairo_shared,
|
dep_lib_cairo_shared,
|
||||||
|
|
@ -235,8 +235,8 @@ lib_gl_borders = static_library(
|
||||||
build_by_default: false,
|
build_by_default: false,
|
||||||
install: false
|
install: false
|
||||||
)
|
)
|
||||||
dep_lib_gl_borders = declare_dependency(
|
dep_lib_renderer_borders = declare_dependency(
|
||||||
link_with: lib_gl_borders,
|
link_with: lib_renderer_borders,
|
||||||
dependencies: dep_lib_cairo_shared
|
dependencies: dep_lib_cairo_shared
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,16 +28,16 @@
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#include "gl-borders.h"
|
#include "renderer-borders.h"
|
||||||
#include "shared/helpers.h"
|
#include "shared/helpers.h"
|
||||||
|
|
||||||
void
|
void
|
||||||
weston_gl_borders_update(struct weston_gl_borders *borders,
|
weston_renderer_borders_update(struct weston_renderer_borders *borders,
|
||||||
struct frame *frame,
|
struct frame *frame,
|
||||||
struct weston_output *output)
|
struct weston_output *output)
|
||||||
{
|
{
|
||||||
const struct gl_renderer_interface *glri =
|
const struct weston_renderer *renderer =
|
||||||
output->compositor->renderer->gl;
|
output->compositor->renderer;
|
||||||
int32_t ix, iy, iwidth, iheight, fwidth, fheight;
|
int32_t ix, iy, iwidth, iheight, fwidth, fheight;
|
||||||
|
|
||||||
fwidth = frame_width(frame);
|
fwidth = frame_width(frame);
|
||||||
|
|
@ -45,19 +45,19 @@ weston_gl_borders_update(struct weston_gl_borders *borders,
|
||||||
frame_interior(frame, &ix, &iy, &iwidth, &iheight);
|
frame_interior(frame, &ix, &iy, &iwidth, &iheight);
|
||||||
|
|
||||||
struct weston_geometry border_area[4] = {
|
struct weston_geometry border_area[4] = {
|
||||||
[GL_RENDERER_BORDER_TOP] = {
|
[WESTON_RENDERER_BORDER_TOP] = {
|
||||||
.x = 0, .y = 0,
|
.x = 0, .y = 0,
|
||||||
.width = fwidth, .height = iy
|
.width = fwidth, .height = iy
|
||||||
},
|
},
|
||||||
[GL_RENDERER_BORDER_LEFT] = {
|
[WESTON_RENDERER_BORDER_LEFT] = {
|
||||||
.x = 0, .y = iy,
|
.x = 0, .y = iy,
|
||||||
.width = ix, .height = 1
|
.width = ix, .height = 1
|
||||||
},
|
},
|
||||||
[GL_RENDERER_BORDER_RIGHT] = {
|
[WESTON_RENDERER_BORDER_RIGHT] = {
|
||||||
.x = iwidth + ix, .y = iy,
|
.x = iwidth + ix, .y = iy,
|
||||||
.width = fwidth - (ix + iwidth), .height = 1
|
.width = fwidth - (ix + iwidth), .height = 1
|
||||||
},
|
},
|
||||||
[GL_RENDERER_BORDER_BOTTOM] = {
|
[WESTON_RENDERER_BORDER_BOTTOM] = {
|
||||||
.x = 0, .y = iy + iheight,
|
.x = 0, .y = iy + iheight,
|
||||||
.width = fwidth, .height = fheight - (iy + iheight)
|
.width = fwidth, .height = fheight - (iy + iheight)
|
||||||
},
|
},
|
||||||
|
|
@ -80,20 +80,20 @@ weston_gl_borders_update(struct weston_gl_borders *borders,
|
||||||
cairo_translate(cr, -g->x, -g->y);
|
cairo_translate(cr, -g->x, -g->y);
|
||||||
frame_repaint(frame, cr);
|
frame_repaint(frame, cr);
|
||||||
cairo_destroy(cr);
|
cairo_destroy(cr);
|
||||||
glri->output_set_border(output, i, g->width, g->height, tex_width,
|
renderer->output_set_border(output, i, g->width, g->height, tex_width,
|
||||||
cairo_image_surface_get_data(borders->tile[i]));
|
cairo_image_surface_get_data(borders->tile[i]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
weston_gl_borders_fini(struct weston_gl_borders *borders,
|
weston_renderer_borders_fini(struct weston_renderer_borders *borders,
|
||||||
struct weston_output *output)
|
struct weston_output *output)
|
||||||
{
|
{
|
||||||
const struct gl_renderer_interface *glri =
|
const struct weston_renderer *renderer =
|
||||||
output->compositor->renderer->gl;
|
output->compositor->renderer;
|
||||||
|
|
||||||
for (unsigned i = 0; i < ARRAY_LENGTH(borders->tile); i++) {
|
for (unsigned i = 0; i < ARRAY_LENGTH(borders->tile); i++) {
|
||||||
glri->output_set_border(output, i, 0, 0, 0, NULL);
|
renderer->output_set_border(output, i, 0, 0, 0, NULL);
|
||||||
cairo_surface_destroy(borders->tile[i]);
|
cairo_surface_destroy(borders->tile[i]);
|
||||||
borders->tile[i] = NULL;
|
borders->tile[i] = NULL;
|
||||||
}
|
}
|
||||||
|
|
@ -25,18 +25,18 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "renderer-gl/gl-renderer.h"
|
#include "libweston-internal.h"
|
||||||
#include "shared/cairo-util.h"
|
#include "shared/cairo-util.h"
|
||||||
|
|
||||||
struct weston_gl_borders {
|
struct weston_renderer_borders {
|
||||||
cairo_surface_t *tile[4]; /* enum gl_renderer_border_side */
|
cairo_surface_t *tile[4];
|
||||||
};
|
};
|
||||||
|
|
||||||
void
|
void
|
||||||
weston_gl_borders_update(struct weston_gl_borders *borders,
|
weston_renderer_borders_update(struct weston_renderer_borders *borders,
|
||||||
struct frame *frame,
|
struct frame *frame,
|
||||||
struct weston_output *output);
|
struct weston_output *output);
|
||||||
|
|
||||||
void
|
void
|
||||||
weston_gl_borders_fini(struct weston_gl_borders *borders,
|
weston_renderer_borders_fini(struct weston_renderer_borders *borders,
|
||||||
struct weston_output *output);
|
struct weston_output *output);
|
||||||
|
|
@ -97,10 +97,10 @@ enum gl_debug_mode {
|
||||||
|
|
||||||
enum gl_border_status {
|
enum gl_border_status {
|
||||||
BORDER_STATUS_CLEAN = 0,
|
BORDER_STATUS_CLEAN = 0,
|
||||||
BORDER_TOP_DIRTY = 1 << GL_RENDERER_BORDER_TOP,
|
BORDER_TOP_DIRTY = 1 << WESTON_RENDERER_BORDER_TOP,
|
||||||
BORDER_LEFT_DIRTY = 1 << GL_RENDERER_BORDER_LEFT,
|
BORDER_LEFT_DIRTY = 1 << WESTON_RENDERER_BORDER_LEFT,
|
||||||
BORDER_RIGHT_DIRTY = 1 << GL_RENDERER_BORDER_RIGHT,
|
BORDER_RIGHT_DIRTY = 1 << WESTON_RENDERER_BORDER_RIGHT,
|
||||||
BORDER_BOTTOM_DIRTY = 1 << GL_RENDERER_BORDER_BOTTOM,
|
BORDER_BOTTOM_DIRTY = 1 << WESTON_RENDERER_BORDER_BOTTOM,
|
||||||
BORDER_ALL_DIRTY = 0xf,
|
BORDER_ALL_DIRTY = 0xf,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -2129,7 +2129,7 @@ static void
|
||||||
draw_output_border_texture(struct gl_renderer *gr,
|
draw_output_border_texture(struct gl_renderer *gr,
|
||||||
struct gl_output_state *go,
|
struct gl_output_state *go,
|
||||||
struct gl_shader_config *sconf,
|
struct gl_shader_config *sconf,
|
||||||
enum gl_renderer_border_side side,
|
enum weston_renderer_border_side side,
|
||||||
int32_t x, int32_t y,
|
int32_t x, int32_t y,
|
||||||
int32_t width, int32_t height)
|
int32_t width, int32_t height)
|
||||||
{
|
{
|
||||||
|
|
@ -2167,42 +2167,42 @@ output_has_borders(struct weston_output *output)
|
||||||
{
|
{
|
||||||
struct gl_output_state *go = get_output_state(output);
|
struct gl_output_state *go = get_output_state(output);
|
||||||
|
|
||||||
return go->borders_current[GL_RENDERER_BORDER_TOP].data ||
|
return go->borders_current[WESTON_RENDERER_BORDER_TOP].data ||
|
||||||
go->borders_current[GL_RENDERER_BORDER_RIGHT].data ||
|
go->borders_current[WESTON_RENDERER_BORDER_RIGHT].data ||
|
||||||
go->borders_current[GL_RENDERER_BORDER_BOTTOM].data ||
|
go->borders_current[WESTON_RENDERER_BORDER_BOTTOM].data ||
|
||||||
go->borders_current[GL_RENDERER_BORDER_LEFT].data;
|
go->borders_current[WESTON_RENDERER_BORDER_LEFT].data;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct weston_geometry
|
static struct weston_geometry
|
||||||
output_get_border_area(const struct gl_output_state *go,
|
output_get_border_area(const struct gl_output_state *go,
|
||||||
enum gl_renderer_border_side side)
|
enum weston_renderer_border_side side)
|
||||||
{
|
{
|
||||||
const struct weston_size *fb = &go->fb_size;
|
const struct weston_size *fb = &go->fb_size;
|
||||||
const struct weston_geometry *area = &go->area;
|
const struct weston_geometry *area = &go->area;
|
||||||
|
|
||||||
switch (side) {
|
switch (side) {
|
||||||
case GL_RENDERER_BORDER_TOP:
|
case WESTON_RENDERER_BORDER_TOP:
|
||||||
return (struct weston_geometry){
|
return (struct weston_geometry){
|
||||||
.x = 0,
|
.x = 0,
|
||||||
.y = 0,
|
.y = 0,
|
||||||
.width = fb->width,
|
.width = fb->width,
|
||||||
.height = area->y
|
.height = area->y
|
||||||
};
|
};
|
||||||
case GL_RENDERER_BORDER_LEFT:
|
case WESTON_RENDERER_BORDER_LEFT:
|
||||||
return (struct weston_geometry){
|
return (struct weston_geometry){
|
||||||
.x = 0,
|
.x = 0,
|
||||||
.y = area->y,
|
.y = area->y,
|
||||||
.width = area->x,
|
.width = area->x,
|
||||||
.height = area->height
|
.height = area->height
|
||||||
};
|
};
|
||||||
case GL_RENDERER_BORDER_RIGHT:
|
case WESTON_RENDERER_BORDER_RIGHT:
|
||||||
return (struct weston_geometry){
|
return (struct weston_geometry){
|
||||||
.x = area->x + area->width,
|
.x = area->x + area->width,
|
||||||
.y = area->y,
|
.y = area->y,
|
||||||
.width = fb->width - area->x - area->width,
|
.width = fb->width - area->x - area->width,
|
||||||
.height = area->height
|
.height = area->height
|
||||||
};
|
};
|
||||||
case GL_RENDERER_BORDER_BOTTOM:
|
case WESTON_RENDERER_BORDER_BOTTOM:
|
||||||
return (struct weston_geometry){
|
return (struct weston_geometry){
|
||||||
.x = 0,
|
.x = 0,
|
||||||
.y = area->y + area->height,
|
.y = area->y + area->height,
|
||||||
|
|
@ -4133,7 +4133,7 @@ log_gl_info(struct gl_renderer *gr)
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gl_renderer_output_set_border(struct weston_output *output,
|
gl_renderer_output_set_border(struct weston_output *output,
|
||||||
enum gl_renderer_border_side side,
|
enum weston_renderer_border_side side,
|
||||||
int32_t width, int32_t height,
|
int32_t width, int32_t height,
|
||||||
int32_t tex_width, unsigned char *data)
|
int32_t tex_width, unsigned char *data)
|
||||||
{
|
{
|
||||||
|
|
@ -4637,6 +4637,7 @@ gl_renderer_display_create(struct weston_compositor *ec,
|
||||||
gr->base.surface_copy_content = gl_renderer_surface_copy_content;
|
gr->base.surface_copy_content = gl_renderer_surface_copy_content;
|
||||||
gr->base.fill_buffer_info = gl_renderer_fill_buffer_info;
|
gr->base.fill_buffer_info = gl_renderer_fill_buffer_info;
|
||||||
gr->base.buffer_init = gl_renderer_buffer_init;
|
gr->base.buffer_init = gl_renderer_buffer_init;
|
||||||
|
gr->base.output_set_border = gl_renderer_output_set_border;
|
||||||
gr->base.type = WESTON_RENDERER_GL;
|
gr->base.type = WESTON_RENDERER_GL;
|
||||||
|
|
||||||
if (gl_renderer_setup_egl_display(gr, options->egl_native_display) < 0)
|
if (gl_renderer_setup_egl_display(gr, options->egl_native_display) < 0)
|
||||||
|
|
@ -5085,6 +5086,5 @@ WL_EXPORT struct gl_renderer_interface gl_renderer_interface = {
|
||||||
.output_window_create = gl_renderer_output_window_create,
|
.output_window_create = gl_renderer_output_window_create,
|
||||||
.output_fbo_create = gl_renderer_output_fbo_create,
|
.output_fbo_create = gl_renderer_output_fbo_create,
|
||||||
.output_destroy = gl_renderer_output_destroy,
|
.output_destroy = gl_renderer_output_destroy,
|
||||||
.output_set_border = gl_renderer_output_set_border,
|
|
||||||
.create_fence_fd = gl_renderer_create_fence_fd,
|
.create_fence_fd = gl_renderer_create_fence_fd,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -53,13 +53,6 @@ typedef intptr_t EGLNativeWindowType;
|
||||||
|
|
||||||
#endif /* ENABLE_EGL */
|
#endif /* ENABLE_EGL */
|
||||||
|
|
||||||
enum gl_renderer_border_side {
|
|
||||||
GL_RENDERER_BORDER_TOP = 0,
|
|
||||||
GL_RENDERER_BORDER_LEFT = 1,
|
|
||||||
GL_RENDERER_BORDER_RIGHT = 2,
|
|
||||||
GL_RENDERER_BORDER_BOTTOM = 3,
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Options passed to the \c display_create method of the GL renderer interface.
|
* Options passed to the \c display_create method of the GL renderer interface.
|
||||||
*
|
*
|
||||||
|
|
@ -176,38 +169,6 @@ struct gl_renderer_interface {
|
||||||
|
|
||||||
void (*output_destroy)(struct weston_output *output);
|
void (*output_destroy)(struct weston_output *output);
|
||||||
|
|
||||||
/* Sets the output border.
|
|
||||||
*
|
|
||||||
* The side specifies the side for which we are setting the border.
|
|
||||||
* The width and height are the width and height of the border.
|
|
||||||
* The tex_width patemeter specifies the width of the actual
|
|
||||||
* texture; this may be larger than width if the data is not
|
|
||||||
* tightly packed.
|
|
||||||
*
|
|
||||||
* The top and bottom textures will extend over the sides to the
|
|
||||||
* full width of the bordered window. The right and left edges,
|
|
||||||
* however, will extend only to the top and bottom of the
|
|
||||||
* compositor surface. This is demonstrated by the picture below:
|
|
||||||
*
|
|
||||||
* +-----------------------+
|
|
||||||
* | TOP |
|
|
||||||
* +-+-------------------+-+
|
|
||||||
* | | | |
|
|
||||||
* |L| |R|
|
|
||||||
* |E| |I|
|
|
||||||
* |F| |G|
|
|
||||||
* |T| |H|
|
|
||||||
* | | |T|
|
|
||||||
* | | | |
|
|
||||||
* +-+-------------------+-+
|
|
||||||
* | BOTTOM |
|
|
||||||
* +-----------------------+
|
|
||||||
*/
|
|
||||||
void (*output_set_border)(struct weston_output *output,
|
|
||||||
enum gl_renderer_border_side side,
|
|
||||||
int32_t width, int32_t height,
|
|
||||||
int32_t tex_width, unsigned char *data);
|
|
||||||
|
|
||||||
/* Create fence sync FD to wait for GPU rendering.
|
/* Create fence sync FD to wait for GPU rendering.
|
||||||
*
|
*
|
||||||
* Return FD on success, -1 on failure or unsupported
|
* Return FD on success, -1 on failure or unsupported
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue