stub out cursor code but have it be a white box at least for now
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good
This commit is contained in:
parent
709067c742
commit
41a874432d
1 changed files with 34 additions and 31 deletions
|
|
@ -2391,15 +2391,16 @@ static void MwLLSetIconImpl(MwLL handle, MwLLPixmap pixmap) {
|
||||||
}
|
}
|
||||||
handle->wayland.icon->surface = wl_compositor_create_surface(handle->wayland.compositor);
|
handle->wayland.icon->surface = wl_compositor_create_surface(handle->wayland.compositor);
|
||||||
|
|
||||||
|
buffer_setup(handle->wayland.icon, pixmap->common.width, pixmap->common.height);
|
||||||
|
|
||||||
wl_surface_attach(handle->wayland.icon->surface, handle->wayland.icon->shm_buffer, 0, 0);
|
wl_surface_attach(handle->wayland.icon->surface, handle->wayland.icon->shm_buffer, 0, 0);
|
||||||
wl_surface_commit(handle->wayland.icon->surface);
|
wl_surface_commit(handle->wayland.icon->surface);
|
||||||
|
|
||||||
buffer_setup(handle->wayland.icon, pixmap->common.width, pixmap->common.height);
|
|
||||||
|
|
||||||
for(; i < size; i += 2) {
|
for(; i < size; i += 2) {
|
||||||
handle->wayland.icon->buf_back[i] = pixmap->common.raw[i + 2];
|
MwU32* data = pixman_image_get_data(pixmap->wayland.img);
|
||||||
handle->wayland.icon->buf_back[i + 1] = pixmap->common.raw[i + 1];
|
handle->wayland.icon->buf_back[i] = data[i + 2];
|
||||||
handle->wayland.icon->buf_back[i + 2] = pixmap->common.raw[i + 0];
|
handle->wayland.icon->buf_back[i + 1] = data[i + 1];
|
||||||
|
handle->wayland.icon->buf_back[i + 2] = data[i + 0];
|
||||||
handle->wayland.icon->buf_back[i + 3] = 255;
|
handle->wayland.icon->buf_back[i + 3] = 255;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2429,39 +2430,41 @@ static void MwLLSetCursorImpl(MwLL handle, MwCursor* image, MwCursor* mask) {
|
||||||
wl_surface_destroy(handle->wayland.cursor.surface);
|
wl_surface_destroy(handle->wayland.cursor.surface);
|
||||||
}
|
}
|
||||||
buffer_setup(&handle->wayland.cursor, image->width, image->height);
|
buffer_setup(&handle->wayland.cursor, image->width, image->height);
|
||||||
memset(handle->wayland.cursor.buf_back, 0, handle->wayland.cursor.buf_size);
|
memset(handle->wayland.cursor.buf_back, 255, handle->wayland.cursor.buf_size);
|
||||||
|
|
||||||
xs = -mask->x + image->x;
|
xs = -mask->x + image->x;
|
||||||
ys = mask->height + mask->y;
|
ys = mask->height + mask->y;
|
||||||
ys = image->height + image->y - ys;
|
ys = image->height + image->y - ys;
|
||||||
|
|
||||||
for(y = 0; y < mask->height; y++) {
|
/* currently broken */
|
||||||
unsigned int d = mask->data[y];
|
/* for(y = 0; y < mask->height; y++) {
|
||||||
for(x = mask->width - 1; x >= 0; x--) {
|
unsigned int d = mask->data[y];
|
||||||
int idx = ((y * image->width) + x) * 4;
|
for(x = mask->width - 1; x >= 0; x--) {
|
||||||
|
int idx = ((y * image->width) + x) * 4;
|
||||||
|
|
||||||
if(d & 1) {
|
if(d & 1) {
|
||||||
handle->wayland.cursor.buf_back[idx + 3] = 255;
|
handle->wayland.cursor.buf_back[idx + 3] = 255;
|
||||||
};
|
};
|
||||||
d = d >> 1;
|
d = d >> 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
for(y = 0; y < image->height; y++) {
|
||||||
for(y = 0; y < image->height; y++) {
|
unsigned int d = image->data[y];
|
||||||
unsigned int d = image->data[y];
|
for(x = image->width - 1; x >= 0; x--) {
|
||||||
for(x = image->width - 1; x >= 0; x--) {
|
int px = 0;
|
||||||
int px = 0;
|
int idx = (((y + ys) * image->width) + (x + xs)) * 4;
|
||||||
int idx = (((y + ys) * image->width) + (x + xs)) * 4;
|
|
||||||
|
|
||||||
if(d & 1) {
|
if(d & 1) {
|
||||||
px = 255;
|
px = 255;
|
||||||
};
|
};
|
||||||
|
|
||||||
handle->wayland.cursor.buf_back[idx] = px;
|
handle->wayland.cursor.buf_back[idx] = px;
|
||||||
handle->wayland.cursor.buf_back[idx + 1] = px;
|
handle->wayland.cursor.buf_back[idx + 1] = px;
|
||||||
handle->wayland.cursor.buf_back[idx + 2] = px;
|
handle->wayland.cursor.buf_back[idx + 2] = px;
|
||||||
d = d >> 1;
|
handle->wayland.cursor.buf_back[idx + 3] = px;
|
||||||
}
|
d = d >> 1;
|
||||||
}
|
}
|
||||||
|
}*/
|
||||||
|
|
||||||
handle->wayland.cursor.surface = wl_compositor_create_surface(handle->wayland.compositor);
|
handle->wayland.cursor.surface = wl_compositor_create_surface(handle->wayland.compositor);
|
||||||
update_buffer(handle, &handle->wayland.cursor);
|
update_buffer(handle, &handle->wayland.cursor);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue