mirror of
https://gitea.nishi.boats/pyrite-dev/milsko
synced 2026-02-04 10:03:05 +00:00
format
This commit is contained in:
@@ -860,12 +860,12 @@ static MwLLPixmap MwLLCreatePixmapImpl(MwLL handle, unsigned char* data, int wid
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void MwLLPixmapUpdateImpl(MwLLPixmap r) {
|
static void MwLLPixmapUpdateImpl(MwLLPixmap r) {
|
||||||
int i;
|
int i;
|
||||||
unsigned char* d;
|
unsigned char* d;
|
||||||
|
|
||||||
cairo_surface_flush(r->wayland.cs);
|
cairo_surface_flush(r->wayland.cs);
|
||||||
d = cairo_image_surface_get_data(r->wayland.cs);
|
d = cairo_image_surface_get_data(r->wayland.cs);
|
||||||
for(i = 0; i < r->common.width * r->common.height * 4; i += 4){
|
for(i = 0; i < r->common.width * r->common.height * 4; i += 4) {
|
||||||
MwU32* p = (MwU32*)&d[i];
|
MwU32* p = (MwU32*)&d[i];
|
||||||
*p <<= 8;
|
*p <<= 8;
|
||||||
*p |= r->common.raw[i + 3];
|
*p |= r->common.raw[i + 3];
|
||||||
@@ -886,11 +886,11 @@ static void MwLLDestroyPixmapImpl(MwLLPixmap pixmap) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void MwLLDrawPixmapImpl(MwLL handle, MwRect* rect, MwLLPixmap pixmap) {
|
static void MwLLDrawPixmapImpl(MwLL handle, MwRect* rect, MwLLPixmap pixmap) {
|
||||||
cairo_t* c;
|
cairo_t* c;
|
||||||
cairo_surface_t* cs;
|
cairo_surface_t* cs;
|
||||||
|
|
||||||
cs = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, rect->width, rect->height);
|
cs = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, rect->width, rect->height);
|
||||||
c = cairo_create(cs);
|
c = cairo_create(cs);
|
||||||
|
|
||||||
cairo_scale(c, (double)rect->width / pixmap->common.width, (double)rect->height / pixmap->common.height);
|
cairo_scale(c, (double)rect->width / pixmap->common.width, (double)rect->height / pixmap->common.height);
|
||||||
cairo_set_source_surface(c, pixmap->wayland.cs, 0, 0);
|
cairo_set_source_surface(c, pixmap->wayland.cs, 0, 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user