GFXprim
2D bitmap graphics library with emphasis on speed and correctness
Loading...
Searching...
No Matches
Data Structures | Typedefs | Functions
gp_proxy_shm.h File Reference

A SHM pixmap. More...

#include <backends/gp_proxy_proto.h>
#include <core/gp_pixmap.h>

Go to the source code of this file.

Data Structures

struct  gp_proxy_shm
 A SHM pixmap. More...
 

Typedefs

typedef struct gp_proxy_shm gp_proxy_shm
 A SHM pixmap.
 

Functions

gp_proxy_shmgp_proxy_shm_init (const char *path, gp_size w, gp_size h, gp_pixel_type type)
 Creates an SHM pixmap.
 
int gp_proxy_shm_resize (gp_proxy_shm *self, gp_size w, gp_size h)
 Resizes a SHM pixmap.
 
void gp_proxy_shm_exit (gp_proxy_shm *self)
 Removes a SHM pixmap.
 

Detailed Description

A SHM pixmap.

Definition in file gp_proxy_shm.h.

Function Documentation

◆ gp_proxy_shm_exit()

void gp_proxy_shm_exit ( gp_proxy_shm self)

Removes a SHM pixmap.

Parameters
selfA SHM pixmap to be removed and deallocated.

◆ gp_proxy_shm_init()

gp_proxy_shm * gp_proxy_shm_init ( const char *  path,
gp_size  w,
gp_size  h,
gp_pixel_type  type 
)

Creates an SHM pixmap.

This is called by the server to initialize a SHM pixmap for the application to render to. The SHM segment size is rounded to PAGE_SIZE.

Parameters
pathin the /dev/shm/ filesystem, 64 bytes at max.
wImage width.
hImage height.
typeImage pixel type.
Returns
Newly created SHM pixmap.

◆ gp_proxy_shm_resize()

int gp_proxy_shm_resize ( gp_proxy_shm self,
gp_size  w,
gp_size  h 
)

Resizes a SHM pixmap.

Resizes SHM image. All applications have unmap the buffer before this call is called and have to remap the shm before they attempt to use it again.

Parameters
selfA SHM pixmap.
wNew width. @parm h New height.
Returns
0 if shm buffer haven't needed to be resized, only pixmap size has been changed 1 if buffer was resized -1 on failure