gl-renderer: remove backend pbuffer support
Drop the now unused output_pbuffer_create from gl_renderer_interface. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
This commit is contained in:
parent
c3d49732de
commit
499e617a62
@ -107,7 +107,6 @@ struct gl_output_state {
|
|||||||
EGLSurface egl_surface;
|
EGLSurface egl_surface;
|
||||||
struct gl_border_image borders[4];
|
struct gl_border_image borders[4];
|
||||||
enum gl_border_status border_status;
|
enum gl_border_status border_status;
|
||||||
bool swap_behavior_is_preserved;
|
|
||||||
|
|
||||||
struct weston_matrix output_matrix;
|
struct weston_matrix output_matrix;
|
||||||
|
|
||||||
@ -1665,8 +1664,6 @@ output_get_buffer_age(struct weston_output *output)
|
|||||||
weston_log("buffer age query failed.\n");
|
weston_log("buffer age query failed.\n");
|
||||||
gl_renderer_print_egl_error_state();
|
gl_renderer_print_egl_error_state();
|
||||||
}
|
}
|
||||||
} else if (go->swap_behavior_is_preserved) {
|
|
||||||
buffer_age = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return buffer_age;
|
return buffer_age;
|
||||||
@ -3721,61 +3718,6 @@ gl_renderer_output_window_create(struct weston_output *output,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
|
||||||
gl_renderer_output_pbuffer_create(struct weston_output *output,
|
|
||||||
const struct gl_renderer_pbuffer_options *options)
|
|
||||||
{
|
|
||||||
struct gl_renderer *gr = get_renderer(output->compositor);
|
|
||||||
struct gl_output_state *go;
|
|
||||||
EGLConfig pbuffer_config;
|
|
||||||
EGLSurface egl_surface;
|
|
||||||
EGLint value = 0;
|
|
||||||
int ret;
|
|
||||||
EGLint pbuffer_attribs[] = {
|
|
||||||
EGL_WIDTH, options->fb_size.width,
|
|
||||||
EGL_HEIGHT, options->fb_size.height,
|
|
||||||
EGL_NONE
|
|
||||||
};
|
|
||||||
|
|
||||||
pbuffer_config = gl_renderer_get_egl_config(gr, EGL_PBUFFER_BIT,
|
|
||||||
options->formats,
|
|
||||||
options->formats_count);
|
|
||||||
if (pbuffer_config == EGL_NO_CONFIG_KHR) {
|
|
||||||
weston_log("failed to choose EGL config for PbufferSurface\n");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
log_egl_config_info(gr->egl_display, pbuffer_config);
|
|
||||||
|
|
||||||
egl_surface = eglCreatePbufferSurface(gr->egl_display, pbuffer_config,
|
|
||||||
pbuffer_attribs);
|
|
||||||
if (egl_surface == EGL_NO_SURFACE) {
|
|
||||||
weston_log("failed to create egl surface\n");
|
|
||||||
gl_renderer_print_egl_error_state();
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
eglSurfaceAttrib(gr->egl_display, egl_surface,
|
|
||||||
EGL_SWAP_BEHAVIOR, EGL_BUFFER_PRESERVED);
|
|
||||||
if (!eglQuerySurface(gr->egl_display, egl_surface,
|
|
||||||
EGL_SWAP_BEHAVIOR, &value) ||
|
|
||||||
value != EGL_BUFFER_PRESERVED) {
|
|
||||||
weston_log("Error: pbuffer surface does not support EGL_BUFFER_PRESERVED, got 0x%x."
|
|
||||||
" Continuing anyway.\n", value);
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = gl_renderer_output_create(output, egl_surface,
|
|
||||||
&options->fb_size, &options->area);
|
|
||||||
if (ret < 0) {
|
|
||||||
eglDestroySurface(gr->egl_display, egl_surface);
|
|
||||||
} else {
|
|
||||||
go = get_output_state(output);
|
|
||||||
go->swap_behavior_is_preserved = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
gl_renderer_output_fbo_create(struct weston_output *output,
|
gl_renderer_output_fbo_create(struct weston_output *output,
|
||||||
const struct gl_renderer_fbo_options *options)
|
const struct gl_renderer_fbo_options *options)
|
||||||
@ -4355,7 +4297,6 @@ gl_renderer_setup(struct weston_compositor *ec, EGLSurface egl_surface)
|
|||||||
WL_EXPORT struct gl_renderer_interface gl_renderer_interface = {
|
WL_EXPORT struct gl_renderer_interface gl_renderer_interface = {
|
||||||
.display_create = gl_renderer_display_create,
|
.display_create = gl_renderer_display_create,
|
||||||
.output_window_create = gl_renderer_output_window_create,
|
.output_window_create = gl_renderer_output_window_create,
|
||||||
.output_pbuffer_create = gl_renderer_output_pbuffer_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,
|
.output_set_border = gl_renderer_output_set_border,
|
||||||
|
@ -94,17 +94,6 @@ struct gl_renderer_output_options {
|
|||||||
unsigned formats_count;
|
unsigned formats_count;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct gl_renderer_pbuffer_options {
|
|
||||||
/** Size of the framebuffer in pixels, including borders */
|
|
||||||
struct weston_size fb_size;
|
|
||||||
/** Area inside the framebuffer in pixels for composited content */
|
|
||||||
struct weston_geometry area;
|
|
||||||
/** Array of pixel formats acceptable for the pbuffer */
|
|
||||||
const struct pixel_format_info **formats;
|
|
||||||
/** The \c formats array length */
|
|
||||||
unsigned formats_count;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct gl_renderer_fbo_options {
|
struct gl_renderer_fbo_options {
|
||||||
/** Size of the framebuffer in pixels, including borders */
|
/** Size of the framebuffer in pixels, including borders */
|
||||||
struct weston_size fb_size;
|
struct weston_size fb_size;
|
||||||
@ -171,27 +160,6 @@ struct gl_renderer_interface {
|
|||||||
int (*output_window_create)(struct weston_output *output,
|
int (*output_window_create)(struct weston_output *output,
|
||||||
const struct gl_renderer_output_options *options);
|
const struct gl_renderer_output_options *options);
|
||||||
|
|
||||||
/**
|
|
||||||
* Attach GL-renderer to the output with internal pixel storage
|
|
||||||
*
|
|
||||||
* \param output The output to create a rendering surface for.
|
|
||||||
* \param options The options struct describing the pbuffer
|
|
||||||
* \return 0 on success, -1 on failure.
|
|
||||||
*
|
|
||||||
* This function creates the renderer data structures needed to repaint
|
|
||||||
* the output. The repaint results will be kept internal and can only
|
|
||||||
* be accessed through e.g. screen capture.
|
|
||||||
*
|
|
||||||
* The first format in formats that matches any EGLConfig
|
|
||||||
* determines which EGLConfig is chosen. See \c display_create about
|
|
||||||
* how the matching works and the possible limitations.
|
|
||||||
*
|
|
||||||
* This function should be used only if \c display_create was called
|
|
||||||
* with \c EGL_PBUFFER_BIT in \c egl_surface_type.
|
|
||||||
*/
|
|
||||||
int (*output_pbuffer_create)(struct weston_output *output,
|
|
||||||
const struct gl_renderer_pbuffer_options *options);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Attach GL-renderer to the output with a frame buffer object
|
* Attach GL-renderer to the output with a frame buffer object
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user