/* the amount of pixels for us to potentially save to warrant *carvingoutarectangleforanextrarenderpass
*/ #define MIN_PIXELS_FOR_OCCLUSION_PASS 1000 * 100
/* the amount of the whole image for us to potentially save to warrant *carvingoutarectangleforanextrarenderpass
*/ #define MIN_PERCENTAGE_FOR_OCCLUSION_PASS 10
if (!gsk_gpu_occlusion_user_to_device (self, clip, snap, &device)) returnFALSE;
if (!gdk_rectangle_intersect (&device, &self->device_clip, &device)) returnFALSE;
/* Only check pixel amount if the rect got smaller. *Thisway,weguaranteethatcoveringthefullrectangle
* will always start an occlusion pass */ if ((device.width < self->device_clip.width || device.height < self->device_clip.height) &&
device.width * device.height < gsk_gpu_occlusion_get_min_pixels (self)) returnFALSE;
/* This catches the corner cases of empty nodes, so after this check *there'squaranteedtobeatleast1pixelthatneedstobedrawn
*/ if (node->bounds.size.width == 0 || node->bounds.size.height == 0 ||
!gsk_render_node_get_opaque_rect (node, &opaque)) return NULL;
if (!gsk_gpu_occlusion_push_clip (self, &opaque, GSK_RECT_SNAP_NONE, &prev_clip)) return NULL;
result = GSK_RENDER_NODE_GET_CLASS (node)->occlusion (node, self);
if (result == NULL)
{
gsk_gpu_occlusion_pop_clip (self, &prev_clip);
}
/* NB: not the passed in device clip, we might have shrunk the region */
cairo_region_subtract_rectangle (self->clip_region, &self->device_clip);
gsk_gpu_render_pass_pop_clip_device_rect (self->pass, &self->scissor_storage);
return result;
}
void
gsk_gpu_occlusion_render_node (GskGpuFrame *frame,
GskGpuImage *target,
GdkColorState *target_color_state,
GskRenderPassType pass_type,
cairo_region_t *clip, const graphene_rect_t *viewport,
GskRenderNode *node)
{
GskGpuOcclusion self; int i, n, best, best_size;
cairo_rectangle_int_t rect;
gboolean do_culling;
while (cairo_region_num_rectangles (clip) > 0)
{
cairo_region_get_rectangle (clip, 0, &rect);
gsk_gpu_occlusion_run (&self, &rect, node);
}
gsk_gpu_occlusion_finish (&self);
}
Messung V0.5 in Prozent
¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.17Angebot
(Wie Sie bei der Firma Beratungs- und Dienstleistungen beauftragen können 2026-07-02)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.