mirror of
https://github.com/hyprwm/Hyprland.git
synced 2024-09-11 13:25:42 +03:00
parent
37d7a8c64d
commit
ab66fa430e
@ -481,11 +481,11 @@ bool CScreencopyProtocolManager::copyFrameShm(SScreencopyFrame* frame, timespec*
|
|||||||
uint32_t packStride = pixel_format_info_min_stride(drmFmtWlr, frame->box.w);
|
uint32_t packStride = pixel_format_info_min_stride(drmFmtWlr, frame->box.w);
|
||||||
|
|
||||||
if (packStride == stride) {
|
if (packStride == stride) {
|
||||||
glReadPixels(frame->box.x, frame->box.y, frame->box.w, frame->box.h, PFORMAT->glFormat, PFORMAT->glType, data);
|
glReadPixels(0, 0, frame->box.w, frame->box.h, PFORMAT->glFormat, PFORMAT->glType, data);
|
||||||
} else {
|
} else {
|
||||||
for (size_t i = 0; i < frame->box.h; ++i) {
|
for (size_t i = 0; i < frame->box.h; ++i) {
|
||||||
uint32_t y = frame->box.x + i;
|
uint32_t y = i;
|
||||||
glReadPixels(frame->box.x, y, frame->box.w, 1, PFORMAT->glFormat, PFORMAT->glType, ((unsigned char*)data) + i * stride);
|
glReadPixels(0, y, frame->box.w, 1, PFORMAT->glFormat, PFORMAT->glType, ((unsigned char*)data) + i * stride);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user