mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2025-12-28 09:50:11 +01:00
cogl: Ensure onscreen framebuffers have an alpha component if required
Prior to this change, cogl often queried GLX so that it returned a framebuffer that could not support an alpha component. Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
This commit is contained in:
parent
02371a714e
commit
bb84bb650d
1 changed files with 19 additions and 1 deletions
|
|
@ -115,7 +115,25 @@ _cairo_boilerplate_cogl_create_onscreen_color_surface (const char *name,
|
|||
if (height < 1)
|
||||
height = 1;
|
||||
|
||||
context = cogl_context_new (NULL, NULL);
|
||||
if (content & CAIRO_CONTENT_ALPHA) {
|
||||
/* A hackish way to ensure that we get a framebuffer with
|
||||
* an alpha component */
|
||||
CoglSwapChain *swap_chain;
|
||||
CoglOnscreenTemplate *onscreen_template;
|
||||
CoglRenderer *renderer;
|
||||
CoglDisplay *display;
|
||||
|
||||
swap_chain = cogl_swap_chain_new ();
|
||||
cogl_swap_chain_set_has_alpha (swap_chain, TRUE);
|
||||
|
||||
onscreen_template = cogl_onscreen_template_new (swap_chain);
|
||||
renderer = cogl_renderer_new ();
|
||||
display = cogl_display_new (renderer, onscreen_template);
|
||||
|
||||
context = cogl_context_new (display, NULL);
|
||||
} else {
|
||||
context = cogl_context_new (NULL, NULL);
|
||||
}
|
||||
|
||||
device = cairo_cogl_device_create (context);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue