Merge branch 'fun-renderer-bug' into 'main'
gl renderer: Keep track of source Closes #6094 See merge request GNOME/gtk!6391
This commit is contained in:
@@ -142,6 +142,8 @@ struct _GskGLRenderJob
|
||||
const GskGLRenderModelview *current_modelview;
|
||||
GskGLProgram *current_program;
|
||||
|
||||
guint source_is_glyph_atlas : 1;
|
||||
|
||||
/* If we should be rendering red zones over fallback nodes */
|
||||
guint debug_fallback : 1;
|
||||
|
||||
@@ -1260,6 +1262,7 @@ done:
|
||||
GL_TEXTURE_2D,
|
||||
GL_TEXTURE0,
|
||||
texture_id);
|
||||
job->source_is_glyph_atlas = FALSE;
|
||||
gsk_gl_render_job_draw_offscreen_rect (job, &node->bounds);
|
||||
gsk_gl_render_job_end_draw (job);
|
||||
|
||||
@@ -1325,6 +1328,7 @@ blur_offscreen (GskGLRenderJob *job,
|
||||
GL_TEXTURE_2D,
|
||||
GL_TEXTURE0,
|
||||
offscreen->texture_id);
|
||||
job->source_is_glyph_atlas = FALSE;
|
||||
gsk_gl_program_set_uniform1f (job->current_program,
|
||||
UNIFORM_BLUR_RADIUS, 0,
|
||||
blur_radius_x);
|
||||
@@ -1354,6 +1358,7 @@ blur_offscreen (GskGLRenderJob *job,
|
||||
GL_TEXTURE_2D,
|
||||
GL_TEXTURE0,
|
||||
pass1->texture_id);
|
||||
job->source_is_glyph_atlas = FALSE;
|
||||
gsk_gl_program_set_uniform1f (job->current_program,
|
||||
UNIFORM_BLUR_RADIUS, 0,
|
||||
blur_radius_y);
|
||||
@@ -1461,7 +1466,8 @@ gsk_gl_render_job_visit_color_node (GskGLRenderJob *job,
|
||||
batch = gsk_gl_command_queue_get_batch (job->command_queue);
|
||||
|
||||
/* Limit the size, or we end up with a coordinate overflow somewhere. */
|
||||
if (node->bounds.size.width < 300 &&
|
||||
if (job->source_is_glyph_atlas &&
|
||||
node->bounds.size.width < 300 &&
|
||||
node->bounds.size.height < 300 &&
|
||||
batch->any.kind == GSK_GL_COMMAND_KIND_DRAW &&
|
||||
batch->any.program == program->id)
|
||||
@@ -1668,6 +1674,7 @@ gsk_gl_render_job_visit_clipped_child (GskGLRenderJob *job,
|
||||
GL_TEXTURE_2D,
|
||||
GL_TEXTURE0,
|
||||
offscreen.texture_id);
|
||||
job->source_is_glyph_atlas = FALSE;
|
||||
gsk_gl_render_job_draw_offscreen_rect (job, clip);
|
||||
gsk_gl_render_job_end_draw (job);
|
||||
}
|
||||
@@ -1758,6 +1765,7 @@ gsk_gl_render_job_visit_rounded_clip_node (GskGLRenderJob *job,
|
||||
GL_TEXTURE_2D,
|
||||
GL_TEXTURE0,
|
||||
offscreen.texture_id);
|
||||
job->source_is_glyph_atlas = FALSE;
|
||||
gsk_gl_render_job_draw_offscreen (job, &node->bounds, &offscreen);
|
||||
gsk_gl_render_job_end_draw (job);
|
||||
}
|
||||
@@ -2123,6 +2131,7 @@ gsk_gl_render_job_visit_transform_node (GskGLRenderJob *job,
|
||||
offscreen.texture_id,
|
||||
linear_filter ? GL_LINEAR : GL_NEAREST,
|
||||
linear_filter ? GL_LINEAR : GL_NEAREST);
|
||||
job->source_is_glyph_atlas = FALSE;
|
||||
gsk_gl_render_job_draw_offscreen (job, &child->bounds, &offscreen);
|
||||
gsk_gl_render_job_end_draw (job);
|
||||
}
|
||||
@@ -2332,6 +2341,7 @@ gsk_gl_render_job_visit_blurred_inset_shadow_node (GskGLRenderJob *job,
|
||||
GL_TEXTURE_2D,
|
||||
GL_TEXTURE0,
|
||||
blurred_texture_id);
|
||||
job->source_is_glyph_atlas = FALSE;
|
||||
gsk_gl_render_job_draw_offscreen (job, &node->bounds, &offscreen);
|
||||
gsk_gl_render_job_end_draw (job);
|
||||
}
|
||||
@@ -2597,6 +2607,7 @@ gsk_gl_render_job_visit_blurred_outset_shadow_node (GskGLRenderJob *job,
|
||||
GL_TEXTURE_2D,
|
||||
GL_TEXTURE0,
|
||||
blurred_texture_id);
|
||||
job->source_is_glyph_atlas = FALSE;
|
||||
gsk_gl_program_set_uniform_rounded_rect (job->current_program,
|
||||
UNIFORM_OUTSET_SHADOW_OUTLINE_RECT, 0,
|
||||
&transformed_outline);
|
||||
@@ -2622,6 +2633,7 @@ gsk_gl_render_job_visit_blurred_outset_shadow_node (GskGLRenderJob *job,
|
||||
GL_TEXTURE_2D,
|
||||
GL_TEXTURE0,
|
||||
blurred_texture_id);
|
||||
job->source_is_glyph_atlas = FALSE;
|
||||
gsk_gl_program_set_uniform_rounded_rect (job->current_program,
|
||||
UNIFORM_OUTSET_SHADOW_OUTLINE_RECT, 0,
|
||||
&transformed_outline);
|
||||
@@ -2859,6 +2871,7 @@ gsk_gl_render_job_visit_cross_fade_node (GskGLRenderJob *job,
|
||||
GL_TEXTURE_2D,
|
||||
GL_TEXTURE1,
|
||||
offscreen_end.texture_id);
|
||||
job->source_is_glyph_atlas = FALSE;
|
||||
gsk_gl_program_set_uniform1f (job->current_program,
|
||||
UNIFORM_CROSS_FADE_PROGRESS, 0,
|
||||
progress);
|
||||
@@ -2905,6 +2918,7 @@ gsk_gl_render_job_visit_opacity_node (GskGLRenderJob *job,
|
||||
GL_TEXTURE_2D,
|
||||
GL_TEXTURE0,
|
||||
offscreen.texture_id);
|
||||
job->source_is_glyph_atlas = FALSE;
|
||||
gsk_gl_render_job_draw_offscreen (job, &node->bounds, &offscreen);
|
||||
gsk_gl_render_job_end_draw (job);
|
||||
}
|
||||
@@ -3046,6 +3060,7 @@ gsk_gl_render_job_visit_text_node (GskGLRenderJob *job,
|
||||
GL_TEXTURE_2D,
|
||||
GL_TEXTURE0,
|
||||
texture_id);
|
||||
job->source_is_glyph_atlas = TRUE;
|
||||
last_texture = texture_id;
|
||||
}
|
||||
|
||||
@@ -3166,6 +3181,7 @@ gsk_gl_render_job_visit_shadow_node (GskGLRenderJob *job,
|
||||
GL_TEXTURE_2D,
|
||||
GL_TEXTURE0,
|
||||
offscreen.texture_id);
|
||||
job->source_is_glyph_atlas = FALSE;
|
||||
rgba_to_half (&shadow->color, color);
|
||||
gsk_gl_render_job_draw_offscreen_with_color (job, &bounds, &offscreen, color);
|
||||
gsk_gl_render_job_end_draw (job);
|
||||
@@ -3222,6 +3238,7 @@ gsk_gl_render_job_visit_blur_node (GskGLRenderJob *job,
|
||||
GL_TEXTURE_2D,
|
||||
GL_TEXTURE0,
|
||||
offscreen.texture_id);
|
||||
job->source_is_glyph_atlas = FALSE;
|
||||
gsk_gl_render_job_draw_coords (job,
|
||||
min_x, min_y, max_x, max_y,
|
||||
0, 1, 1, 0,
|
||||
@@ -3272,6 +3289,7 @@ gsk_gl_render_job_visit_blend_node (GskGLRenderJob *job,
|
||||
GL_TEXTURE_2D,
|
||||
GL_TEXTURE0,
|
||||
bottom_offscreen.texture_id);
|
||||
job->source_is_glyph_atlas = FALSE;
|
||||
gsk_gl_render_job_draw_offscreen (job, &node->bounds, &bottom_offscreen);
|
||||
gsk_gl_render_job_end_draw (job);
|
||||
}
|
||||
@@ -3294,6 +3312,7 @@ gsk_gl_render_job_visit_blend_node (GskGLRenderJob *job,
|
||||
GL_TEXTURE_2D,
|
||||
GL_TEXTURE1,
|
||||
top_offscreen.texture_id);
|
||||
job->source_is_glyph_atlas = FALSE;
|
||||
gsk_gl_program_set_uniform1i (job->current_program,
|
||||
UNIFORM_BLEND_MODE, 0,
|
||||
gsk_blend_node_get_blend_mode (node));
|
||||
@@ -3356,6 +3375,7 @@ gsk_gl_render_job_visit_mask_node (GskGLRenderJob *job,
|
||||
GL_TEXTURE_2D,
|
||||
GL_TEXTURE1,
|
||||
mask_offscreen.texture_id);
|
||||
job->source_is_glyph_atlas = FALSE;
|
||||
gsk_gl_program_set_uniform1i (job->current_program,
|
||||
UNIFORM_MASK_MODE, 0,
|
||||
gsk_mask_node_get_mask_mode (node));
|
||||
@@ -3392,6 +3412,7 @@ gsk_gl_render_job_visit_color_matrix_node (GskGLRenderJob *job,
|
||||
GL_TEXTURE_2D,
|
||||
GL_TEXTURE0,
|
||||
offscreen.texture_id);
|
||||
job->source_is_glyph_atlas = FALSE;
|
||||
gsk_gl_program_set_uniform_matrix (job->current_program,
|
||||
UNIFORM_COLOR_MATRIX_COLOR_MATRIX, 0,
|
||||
gsk_color_matrix_node_get_color_matrix (node));
|
||||
@@ -3474,6 +3495,7 @@ gsk_gl_render_job_visit_gl_shader_node (GskGLRenderJob *job,
|
||||
GL_TEXTURE_2D,
|
||||
GL_TEXTURE0 + i,
|
||||
offscreens[i].texture_id);
|
||||
job->source_is_glyph_atlas = FALSE;
|
||||
gsk_gl_program_set_uniform2f (program,
|
||||
UNIFORM_CUSTOM_SIZE, 0,
|
||||
node->bounds.size.width,
|
||||
@@ -3608,6 +3630,7 @@ gsk_gl_render_job_visit_texture (GskGLRenderJob *job,
|
||||
offscreen.has_mipmap ? GL_LINEAR_MIPMAP_LINEAR : GL_LINEAR,
|
||||
GL_LINEAR,
|
||||
offscreen.sync);
|
||||
job->source_is_glyph_atlas = FALSE;
|
||||
gsk_gl_render_job_draw_offscreen (job, bounds, &offscreen);
|
||||
gsk_gl_render_job_end_draw (job);
|
||||
}
|
||||
@@ -3645,6 +3668,7 @@ gsk_gl_render_job_visit_texture (GskGLRenderJob *job,
|
||||
slice->texture_id,
|
||||
use_mipmap ? GL_LINEAR_MIPMAP_LINEAR : GL_LINEAR,
|
||||
GL_LINEAR);
|
||||
job->source_is_glyph_atlas = FALSE;
|
||||
|
||||
gsk_gl_render_job_draw_coords (job,
|
||||
x1, y1, x2, y2,
|
||||
@@ -3763,6 +3787,7 @@ gsk_gl_render_job_visit_texture_scale_node (GskGLRenderJob *job,
|
||||
min_filter,
|
||||
mag_filter,
|
||||
sync);
|
||||
job->source_is_glyph_atlas = FALSE;
|
||||
gsk_gl_render_job_draw_coords (job,
|
||||
0, 0, clip_rect.size.width, clip_rect.size.height,
|
||||
u0, v0, u1, v1,
|
||||
@@ -3804,6 +3829,7 @@ gsk_gl_render_job_visit_texture_scale_node (GskGLRenderJob *job,
|
||||
slice->texture_id,
|
||||
min_filter,
|
||||
mag_filter);
|
||||
job->source_is_glyph_atlas = FALSE;
|
||||
gsk_gl_render_job_draw_coords (job,
|
||||
slice_bounds.origin.x,
|
||||
slice_bounds.origin.y,
|
||||
@@ -3836,6 +3862,7 @@ render_texture:
|
||||
GL_TEXTURE_2D,
|
||||
GL_TEXTURE0,
|
||||
texture_id);
|
||||
job->source_is_glyph_atlas = FALSE;
|
||||
gsk_gl_render_job_draw_coords (job,
|
||||
job->offset_x + clip_rect.origin.x,
|
||||
job->offset_y + clip_rect.origin.y,
|
||||
@@ -3888,6 +3915,7 @@ gsk_gl_render_job_visit_repeat_node (GskGLRenderJob *job,
|
||||
GL_TEXTURE_2D,
|
||||
GL_TEXTURE0,
|
||||
offscreen.texture_id);
|
||||
job->source_is_glyph_atlas = FALSE;
|
||||
gsk_gl_program_set_uniform4f (job->current_program,
|
||||
UNIFORM_REPEAT_CHILD_BOUNDS, 0,
|
||||
(node->bounds.origin.x - child_bounds->origin.x) / child_bounds->size.width,
|
||||
@@ -4382,6 +4410,7 @@ gsk_gl_render_job_render_flipped (GskGLRenderJob *job,
|
||||
GL_TEXTURE_2D,
|
||||
GL_TEXTURE0,
|
||||
texture_id);
|
||||
job->source_is_glyph_atlas = FALSE;
|
||||
gsk_gl_render_job_draw_rect (job, &job->viewport);
|
||||
gsk_gl_render_job_end_draw (job);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user