mirror of
https://github.com/gnustep/libs-back.git
synced 2025-04-22 23:42:16 +00:00
rename WaylandCairoShmSurface
This commit is contained in:
parent
96f07c13f7
commit
317ca762a3
4 changed files with 19 additions and 12 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
WaylandCairoSurface.h
|
||||
WaylandCairoShmSurface.h
|
||||
|
||||
Copyright (C) 2020 Free Software Foundation, Inc.
|
||||
|
||||
|
@ -25,14 +25,15 @@
|
|||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef WaylandCairoSurface_h
|
||||
#define WaylandCairoSurface_h
|
||||
#ifndef WaylandCairoShmSurface_h
|
||||
#define WaylandCairoShmSurface_h
|
||||
|
||||
#include "cairo/CairoSurface.h"
|
||||
|
||||
@interface WaylandCairoSurface : CairoSurface
|
||||
@interface WaylandCairoShmSurface : CairoSurface
|
||||
{
|
||||
}
|
||||
- (void)destroySurface;
|
||||
@end
|
||||
|
||||
#endif
|
|
@ -73,9 +73,9 @@
|
|||
#elif BUILD_SERVER == SERVER_wayland
|
||||
# include "wayland/WaylandServer.h"
|
||||
# include "cairo/CairoGState.h"
|
||||
# include "cairo/WaylandCairoSurface.h"
|
||||
# include "cairo/WaylandCairoShmSurface.h"
|
||||
# define _CAIRO_GSTATE_CLASSNAME CairoGState
|
||||
# define _CAIRO_SURFACE_CLASSNAME WaylandCairoSurface
|
||||
# define _CAIRO_SURFACE_CLASSNAME WaylandCairoShmSurface
|
||||
#else
|
||||
# error Invalid server for Cairo backend : non implemented
|
||||
#endif /* BUILD_SERVER */
|
||||
|
|
|
@ -50,7 +50,7 @@ ifeq ($(BUILD_SERVER),x11)
|
|||
endif
|
||||
else
|
||||
ifeq ($(BUILD_SERVER),wayland)
|
||||
cairo_OBJC_FILES += WaylandCairoSurface.m
|
||||
cairo_OBJC_FILES += WaylandCairoShmSurface.m
|
||||
else
|
||||
ifeq ($(BUILD_GRAPHICS),cairo)
|
||||
ifeq ($(WITH_GLITZ),yes)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* WaylandCairoSurface
|
||||
|
||||
WaylandCairoSurface - Draw with Cairo onto Wayland surfaces
|
||||
|
||||
WaylandCairoShmSurface - Draw with Cairo onto Wayland surfaces
|
||||
|
||||
|
||||
Copyright (C) 2020 Free Software Foundation, Inc.
|
||||
|
||||
|
@ -31,7 +31,7 @@
|
|||
#define _GNU_SOURCE
|
||||
|
||||
#include "wayland/WaylandServer.h"
|
||||
#include "cairo/WaylandCairoSurface.h"
|
||||
#include "cairo/WaylandCairoShmSurface.h"
|
||||
#include <cairo/cairo.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
|
@ -135,7 +135,7 @@ create_shm_buffer(struct window *window)
|
|||
return surface;
|
||||
}
|
||||
|
||||
@implementation WaylandCairoSurface
|
||||
@implementation WaylandCairoShmSurface
|
||||
|
||||
- (id)initWithDevice:(void *)device
|
||||
{
|
||||
|
@ -178,7 +178,6 @@ create_shm_buffer(struct window *window)
|
|||
// the counterpart to create_shm_buffer.
|
||||
//
|
||||
// For instance, this is the wrong place to destroy the cairo surface:
|
||||
// cairo_surface_destroy(window->surface);
|
||||
// window->surface = NULL;
|
||||
// and likely to unmap the data, and destroy/release the buffer.
|
||||
// "Destroying the wl_buffer after wl_buffer.release does not change
|
||||
|
@ -188,6 +187,8 @@ create_shm_buffer(struct window *window)
|
|||
// Hence also skipping:
|
||||
// munmap(window->data, shm_buffer_size(window));
|
||||
|
||||
cairo_surface_destroy(_surface);
|
||||
_surface = NULL;
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
@ -233,4 +234,9 @@ create_shm_buffer(struct window *window)
|
|||
// NSDebugLog(@"[CairoSurface handleExposeRect end]");
|
||||
}
|
||||
|
||||
- (void)destroySurface
|
||||
{
|
||||
// noop this is an offscreen surface
|
||||
// no need to destroy it when not visible
|
||||
}
|
||||
@end
|
Loading…
Reference in a new issue