* gsk_gl_command_queue_execute:
* @self: a `GskGLCommandQueue`
* @surface_height: the height of the backing surface
- * @scale_factor: the scale factor of the backing surface
+ * @scale: the scale of the backing surface
* @scissor: (nullable): the scissor clip if any
* @default_framebuffer: the default framebuffer id if not zero
*
void
gsk_gl_command_queue_execute (GskGLCommandQueue *self,
guint surface_height,
- guint scale_factor,
+ float scale,
const cairo_region_t *scissor,
guint default_framebuffer)
{
g_assert (cairo_region_num_rectangles (scissor) == 1);
cairo_region_get_rectangle (scissor, 0, &r);
- scissor_test.origin.x = r.x * scale_factor;
- scissor_test.origin.y = surface_height - (r.height * scale_factor) - (r.y * scale_factor);
- scissor_test.size.width = r.width * scale_factor;
- scissor_test.size.height = r.height * scale_factor;
+ scissor_test.origin.x = (int) floor (r.x * scale);
+ scissor_test.origin.y = (int) floor (surface_height - (r.height * scale) - (r.y * scale));
+ scissor_test.size.width = (int) ceil (r.width * scale);
+ scissor_test.size.height = (int) ceil (r.height * scale);
}
next_batch_index = self->head_batch_index;
void gsk_gl_command_queue_end_frame (GskGLCommandQueue *self);
void gsk_gl_command_queue_execute (GskGLCommandQueue *self,
guint surface_height,
- guint scale_factor,
+ float scale,
const cairo_region_t *scissor,
guint default_framebuffer);
int gsk_gl_command_queue_upload_texture (GskGLCommandQueue *self,
GskRenderNode *root)
{
G_GNUC_UNUSED gint64 start_time;
- guint scale_factor;
+ float scale;
guint surface_height;
g_return_if_fail (job != NULL);
g_return_if_fail (root != NULL);
g_return_if_fail (GSK_IS_GL_DRIVER (job->driver));
- scale_factor = MAX (job->scale_x, job->scale_y);
+ scale = MAX (job->scale_x, job->scale_y);
surface_height = job->viewport.size.height;
gsk_gl_command_queue_make_current (job->command_queue);
start_time = GDK_PROFILER_CURRENT_TIME;
gsk_gl_command_queue_make_current (job->command_queue);
gdk_gl_context_push_debug_group (job->command_queue->context, "Executing command queue");
- gsk_gl_command_queue_execute (job->command_queue, surface_height, scale_factor, job->region, job->default_framebuffer);
+ gsk_gl_command_queue_execute (job->command_queue, surface_height, scale, job->region, job->default_framebuffer);
gdk_gl_context_pop_debug_group (job->command_queue->context);
gdk_profiler_add_mark (start_time, GDK_PROFILER_CURRENT_TIME-start_time, "Execute GL command queue", "");
}