gl: Don't punch hole if the subsurface is above

Saves some work.
This commit is contained in:
Benjamin Otte 2023-11-14 20:13:11 +01:00
parent 667f02ecd8
commit ef77a6fa73

View File

@ -4017,17 +4017,20 @@ gsk_gl_render_job_visit_subsurface_node (GskGLRenderJob *job,
if (job->offload && if (job->offload &&
gsk_offload_subsurface_is_offloaded (job->offload, subsurface)) gsk_offload_subsurface_is_offloaded (job->offload, subsurface))
{ {
/* Clear the area so we can see through */ if (!gdk_subsurface_is_above_parent (subsurface))
if (gsk_gl_render_job_begin_draw (job, CHOOSE_PROGRAM (job, color)))
{ {
GskGLCommandBatch *batch; /* Clear the area so we can see through */
guint16 color[4]; if (gsk_gl_render_job_begin_draw (job, CHOOSE_PROGRAM (job, color)))
rgba_to_half (&(GdkRGBA){0,0,0,0}, color); {
GskGLCommandBatch *batch;
guint16 color[4];
rgba_to_half (&(GdkRGBA){0,0,0,0}, color);
batch = gsk_gl_command_queue_get_batch (job->command_queue); batch = gsk_gl_command_queue_get_batch (job->command_queue);
batch->draw.blend = 0; batch->draw.blend = 0;
gsk_gl_render_job_draw_rect_with_color (job, &node->bounds, color); gsk_gl_render_job_draw_rect_with_color (job, &node->bounds, color);
gsk_gl_render_job_end_draw (job); gsk_gl_render_job_end_draw (job);
}
} }
} }
else else