diff options
author | George Matsumura <gmmatsumura01@bvsd.org> | 2020-06-29 13:37:20 -0600 |
---|---|---|
committer | George Matsumura <gmmatsumura01@bvsd.org> | 2020-08-25 02:30:57 -0600 |
commit | 75d843208cf33b8ba0273745582bcaabf900ea24 (patch) | |
tree | 1cc78e485ddc26d0afaf2e48afd70ae22656aac3 /boilerplate | |
parent | a3233bc5df49a8fee4ba07ad56b9cc67e8bfc744 (diff) | |
download | cairo-75d843208cf33b8ba0273745582bcaabf900ea24.tar.gz |
cogl: Move context, device, and surface members to most fitting places
The buffer stack was moved from the surface to the device, as
mapped buffers are shared across all surfaces using the device
and more than one surface may be doing so. Stemming from this, if
a surface tries to map a buffer without first unmapping one that
has been mapped by another surface, it will trigger an error.
The parent backend functions were moved from the device to the
context, as it is possible that the context creation function could
be passed a non-cogl device. Prior to this change, many of the
subsurface tests segfaulted.
Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
Diffstat (limited to 'boilerplate')
-rw-r--r-- | boilerplate/cairo-boilerplate-cogl.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/boilerplate/cairo-boilerplate-cogl.c b/boilerplate/cairo-boilerplate-cogl.c index e11a8b8de..037a34147 100644 --- a/boilerplate/cairo-boilerplate-cogl.c +++ b/boilerplate/cairo-boilerplate-cogl.c @@ -70,7 +70,6 @@ _cairo_boilerplate_cogl_create_offscreen_color_surface (const char *name, { cairo_device_t *device; CoglTexture *tex; - CoglHandle offscreen; CoglFramebuffer *fb; cogl_closure_t *closure; cairo_status_t status; @@ -81,8 +80,7 @@ _cairo_boilerplate_cogl_create_offscreen_color_surface (const char *name, device = cairo_cogl_device_create (context); tex = cogl_texture_2d_new_with_size (context, width, height); cogl_texture_set_components (tex, COGL_TEXTURE_COMPONENTS_RGBA); - offscreen = cogl_offscreen_new_with_texture (tex); - fb = COGL_FRAMEBUFFER (offscreen); + fb = cogl_offscreen_new_with_texture (tex); cogl_framebuffer_allocate (fb, NULL); cogl_framebuffer_orthographic (fb, 0, 0, @@ -116,7 +114,6 @@ _cairo_boilerplate_cogl_create_onscreen_color_surface (const char *name, void **abstract_closure) { cairo_device_t *device; - CoglOnscreen *onscreen; CoglFramebuffer *fb; cogl_closure_t *closure; cairo_status_t status; @@ -125,10 +122,9 @@ _cairo_boilerplate_cogl_create_onscreen_color_surface (const char *name, context = cogl_context_new (NULL, NULL); device = cairo_cogl_device_create (context); - onscreen = cogl_onscreen_new (context, width, height); - fb = COGL_FRAMEBUFFER (onscreen); + fb = cogl_onscreen_new (context, width, height); - cogl_onscreen_show (onscreen); + cogl_onscreen_show (fb); cogl_framebuffer_orthographic (fb, 0, 0, cogl_framebuffer_get_width (fb), |