[PATCH 2/3] renderer: introduce destroy callback
John Kåre Alsaker
john.kare.alsaker at gmail.com
Tue Jan 8 12:56:09 PST 2013
On Tue, Jan 8, 2013 at 9:14 PM, Vasily Khoruzhick <anarsoul at gmail.com> wrote:
> On Tue, Jan 8, 2013 at 10:50 PM, John Kåre Alsaker
> <john.kare.alsaker at gmail.com> wrote:
>
> Hi John,
>
>> I'd like for output_create, output_destroy, renderer_destroy,
>> set_border and repaint_output to be virtual functions as part of a new
>> abstraction which is responsible for handling buffers and renderers
>> for the backends. These may simply be new fields in weston_renderer
>> that the backends override as necessary, or a new structure private to
>> the backends which the renderers may partially initialize.
>>
>> This way we can replace this nice peace of code
>
> We still need to initialize x11 shm part (and it's x11 specific,
> fbdev backend will initialize something else), it'll just replace
> output create part.
That code will be in the x11-shm buffer manager.
> But again it's very renderer-specific (gl renderer needs
> EGLNativeWindowType, pixman
> renderer currently needs nothing, same for no-op renderer).
We simply pass along a pointer to the native window type then.
> Also
> pixman renderer does not manage
> buffers at all, backend is responsible in providing buffer(s) for
> pixman renderer (see pixman_renderer_output_set_buffer)
Which will now be handled by the buffer manager abstraction, which is
still in backend.
>
>> if (c->use_pixman) {
>> if (x11_output_init_shm(c, output, width, height) < 0)
>> return NULL;
>> if (pixman_renderer_output_create(&output->base) < 0) {
>> x11_output_deinit_shm(c, output);
>> return NULL;
>> }
>> } else {
>> if (gl_renderer_output_create(&output->base, output->window) < 0)
>> return NULL;
>> }
>> with this
>> if (buff_manager->output_create(&output->base, output->window) < 0)
>> return NULL;
>> and generally reduce the number of branches. Which will help making
>> EGL/gl_renderer switchable.
>
> Regards
> Vasily
More information about the wayland-devel
mailing list