gl-renderer: Replace window-create args with struct
gl_rendererer's output_window_create has a lot of arguments now. Add a structure for the options to make it more clear what is what. This is in preparation for adding bare-integer arguments which are ripe for confusion when passing positional arguments. Signed-off-by: Daniel Stone <daniels@collabora.com>
This commit is contained in:
committed by
Pekka Paalanen
parent
c890c384c8
commit
db6e6e1ec5
+15
-11
@@ -854,14 +854,16 @@ x11_output_switch_mode(struct weston_output *base, struct weston_mode *mode)
|
||||
}
|
||||
} else {
|
||||
Window xid = (Window) output->window;
|
||||
const struct gl_renderer_output_options options = {
|
||||
.window_for_legacy = (EGLNativeWindowType) output->window,
|
||||
.window_for_platform = &xid,
|
||||
.drm_formats = x11_formats,
|
||||
.drm_formats_count = ARRAY_LENGTH(x11_formats),
|
||||
};
|
||||
|
||||
gl_renderer->output_destroy(&output->base);
|
||||
|
||||
ret = gl_renderer->output_window_create(&output->base,
|
||||
(EGLNativeWindowType) output->window,
|
||||
&xid,
|
||||
x11_formats,
|
||||
ARRAY_LENGTH(x11_formats));
|
||||
ret = gl_renderer->output_window_create(&output->base, &options);
|
||||
if (ret < 0)
|
||||
return -1;
|
||||
}
|
||||
@@ -1030,13 +1032,15 @@ x11_output_enable(struct weston_output *base)
|
||||
/* eglCreatePlatformWindowSurfaceEXT takes a Window*
|
||||
* but eglCreateWindowSurface takes a Window. */
|
||||
Window xid = (Window) output->window;
|
||||
const struct gl_renderer_output_options options = {
|
||||
.window_for_legacy = (EGLNativeWindowType) output->window,
|
||||
.window_for_platform = &xid,
|
||||
.drm_formats = x11_formats,
|
||||
.drm_formats_count = ARRAY_LENGTH(x11_formats),
|
||||
};
|
||||
|
||||
ret = gl_renderer->output_window_create(
|
||||
&output->base,
|
||||
(EGLNativeWindowType) output->window,
|
||||
&xid,
|
||||
x11_formats,
|
||||
ARRAY_LENGTH(x11_formats));
|
||||
ret = gl_renderer->output_window_create(&output->base,
|
||||
&options);
|
||||
if (ret < 0)
|
||||
goto err;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user