diff --git a/TODO b/TODO index 04f75ae..34954c9 100644 --- a/TODO +++ b/TODO @@ -348,3 +348,5 @@ Add option to save screenshot as .qoi. Use that then in gsr-ui for the backgroun Support pausing recording when recording while replay/streaming. Maybe use VK_VALVE_video_encode_rgb_conversion with vulkan encoding for shader-less rgb to yuv conversion. That would allow screen capture with no gpu processing. + +Cursor sometimes doesn't have color when capturing region scaled (on kde plasma wayland at least). \ No newline at end of file diff --git a/src/color_conversion.c b/src/color_conversion.c index ab2ed8d..1ac8338 100644 --- a/src/color_conversion.c +++ b/src/color_conversion.c @@ -483,6 +483,12 @@ static void gsr_color_conversion_draw_graphics(gsr_color_conversion *self, unsig const vec2i dest_texture_size = self->params.destination_textures_size[0]; const int texture_target = external_texture ? GL_TEXTURE_EXTERNAL_OES : GL_TEXTURE_2D; + if(rotation == GSR_ROT_90 || rotation == GSR_ROT_270) { + const float tmp = texture_size.x; + texture_size.x = texture_size.y; + texture_size.y = tmp; + } + self->params.egl->glBindTexture(texture_target, texture_id); gsr_color_conversion_swizzle_texture_source(self, source_color); @@ -501,18 +507,11 @@ static void gsr_color_conversion_draw_graphics(gsr_color_conversion *self, unsig (float)source_position.y / (texture_size.y == 0 ? 1.0f : (float)texture_size.y), }; - vec2f texture_size_norm = { + const vec2f texture_size_norm = { (float)source_size.x / (texture_size.x == 0 ? 1.0f : (float)texture_size.x), (float)source_size.y / (texture_size.y == 0 ? 1.0f : (float)texture_size.y), }; - if(rotation == GSR_ROT_90 || rotation == GSR_ROT_270) { - const float ratio_x = (double)source_size.x / (double)source_size.y; - const float ratio_y = (double)source_size.y / (double)source_size.x; - texture_size_norm.x *= ratio_y; - texture_size_norm.y *= ratio_x; - } - const float vertices[] = { -1.0f + 0.0f, -1.0f + 0.0f + size_norm.y, texture_pos_norm.x, texture_pos_norm.y + texture_size_norm.y, -1.0f + 0.0f, -1.0f + 0.0f, texture_pos_norm.x, texture_pos_norm.y,