Christoph Egger writes:
>
> Hi!
>
>
> I have set up an API for libblt from the few responses I got.
> If you think, there is something missing, then let me know.
>
> If anything is unclear for you, then feel free to ask.
>
> #ifdef HAVE_STRUCT_BLT
> typedef struct ggiBlt *ggiBlt_t;
> #else
> struct ggiBlt { };
>
> typedef struct ggiBlt *ggiBlt_t;
> #endif
>
>
> enum ggiBlt_rops {
> BLT_NONE = 0x00000000,
> BLT_AND = 0x00000001,
> BLT_OR = 0x00000002,
> BLT_XOR = 0x00000004,
> BLT_NOT = 0x00000008,
> };
>
>
> struct ggiBlt_source {
> ggiBlt_t blt;
> ggi_visual_t vis;
> enum ggiBlt_rops rop;
>
> /* 0 means to use vis as blt-source and
> * non-zero to use blt as blt-source
> */
> int flag;
> };
>
> typedef ggiBlt_source *ggiBlt_source_list;
I think you should allow argument to be given to the raster operation,
e.g. the alpha value, or a stencil buffer, or a color or whatever.
Is there a way to define a set of 'standard' ROP definition throughout
GGI? Thus every extension could use a generic semantic for raster ops,
even if they don't implement or allow all of those.
libxmi defines a number of these and I'm also doing this kind of thing
in the libart renderer. It would be good to have this unified.
>
> /* SYNC/ASYNC mode. Blits instantly or when thw HW likes to. Default is sync */
> #define BLTFLAG_SYNC 0x0000
> #define BLTFLAG_ASYNC GGIFLAG_ASYNC
>
Shouldn't it rather follow the ggi sync mode?
> /* API functions
> */
>
>
> int ggiBltAddBob(ggiGA_resource_list *reqlist,
> struct GA_ResourceProperties *props,
> ggiGA_resource_handle *handle);
Could you please explain the GA_ stuff?
> ggiBlt_t ggiBltTie(ggiGA_resource_handle handle);
>
> int ggiBltUntie(ggiBlt_t *blt);
>
>
> ggiBlt_t ggiBltCreateBob(ggi_visual_t vis,
> struct GA_ResourceProperties *props);
>
> int ggiBltDestroyBob(ggiBlt_t *blt);
>
>
> /* Set the default base for the coordinates: Either pixels or dots
> */
> int ggiBltSetCoordBase(ggiBlt_t blt, enum ggiGA_coord_mode cm);
>
>
> int ggiBltSetSyncMode(ggiBlt_t blt, ggi_flags sync);
Shouldn't it always follow the GGI_SYNC flag?
> /* Does all blitting operations, if it is in ASYNC -mode */
> int ggiBltFlush(ggiBlt_t blt);
>
>
> /* Set the given image (vis) to the blt-area with grabbing the image
> * from a visual at pos (x,y)
> */
> int ggiBltSetImage(ggiBlt_t blt, ggi_visual_t vis,
> int x, int y, unsigned char *alpha);
How do you define the blit image properties? e.g. does it
have an alpha value, z value, etc?
Or am I missing something completely?
> /* Multi-Source blitting operation. Blits all bobs from
> * the source-list into blt using the given rop from the list.
> * It performs stretching, if width and height are != 0
> */
> int ggiBltCrossBlit(ggiBlt_source_list src, size_t nmemb,
> ggiBlt_t blt, int width, int height);
>
>
> int ggiBltBlit(ggiBlt_t src, ggiBlt_t dst,
> int width, int height,
> enum ggiBlt_rops rop);
>
>
> int ggiBltBlit2Vis(ggiBlt_t blt, ggi_visual_t vis,
> int dx, int dy, int width, int height,
> enum ggiBlt_rops rop, enum ggiGA_coord_mode cm);
>
>
> int ggiBltVis2Vis(ggi_visual_t *src, size_t nmemb,
> ggi_visual_t dst, int dx, int dy, int width, int height,
> enum ggiBlt_rops *rop, enum ggiGA_coord_mode cm);
>
>
>
> __END_DECLS
>
> #endif /* _GGI_BLT_H */