Lines Matching defs:node
189 stbrp_node extra[2]; // we allocate two extra nodes so optimal user-node-count is 'width' not 'width+2'
279 // node 0 is the full width, node 1 is the sentinel (lets us not store width explicitly)
295 stbrp_node *node = first;
304 // skip in case we're past the node
305 while (node->next->x <= x0)
306 ++node;
308 STBRP_ASSERT(node->next->x > x0); // we ended up handling this in the caller for efficiency
311 STBRP_ASSERT(node->x <= x0);
316 while (node->x < x1) {
317 if (node->y > min_y) {
321 waste_area += visited_width * (node->y - min_y);
322 min_y = node->y;
324 if (node->x < x0)
325 visited_width += node->next->x - x0;
327 visited_width += node->next->x - node->x;
330 int under_width = node->next->x - node->x;
333 waste_area += under_width * (min_y - node->y);
336 node = node->next;
353 stbrp_node **prev, *node, *tail, **best = NULL;
360 node = c->active_head;
362 while (node->x + width <= c->width) {
364 y = stbrp__skyline_find_min_y(c, node, node->x, width, &waste);
382 prev = &node->next;
383 node = node->next;
388 // if doing best-fit (BF), we also have to try aligning right edge to each node position
407 node = c->active_head;
409 // find first node that's admissible
417 while (node->next->x <= xpos) {
418 prev = &node->next;
419 node = node->next;
421 STBRP_ASSERT(node->next->x > xpos && node->x <= xpos);
422 y = stbrp__skyline_find_min_y(c, node, xpos, width, &waste);
448 stbrp_node *node, *cur;
452 // 2. the best node doesn't fit (we don't always check this)
459 // on success, create new node
460 node = context->free_head;
461 node->x = (stbrp_coord) res.x;
462 node->y = (stbrp_coord) (res.y + height);
464 context->free_head = node->next;
466 // insert the new node into the right starting point, and
474 cur->next = node;
477 *res.prev_link = node;
484 // move the current node to the free list
491 node->next = cur;