Render one scanline of a ring using incremental d² with phase-based scanning.
Templated on Overwrite for compile-time dispatch (no per-pixel branch). Zones (left to right): outside → outer-AA → solid → inner-AA → hole → inner-AA → solid → outer-AA → outside.
Definition at line 317 of file primitives.h.
319 {
320 PixelT* ptr = &buf[py * w + g.
xmin];
321 fl::i32 d2 = d2_row;
324
325 while (px <= g.xmax && d2 >= g.
oo2) {
326 d2 += xd; xd += 131072; ++ptr; ++px;
327 }
328
329 while (px <= g.xmax && d2 >= g.
oi2 && d2 < g.
oo2) {
330 fl::u16 diff =
static_cast<fl::u16
>(
static_cast<fl::u32
>(g.
oo2 - d2) >> g.
outer_shift);
332 PixelT c = g.
color; c.nscale8(br);
333 if (Overwrite) *ptr = c; else *ptr += c;
334 d2 += xd; xd += 131072; ++ptr; ++px;
335 }
336
337 while (px <= g.xmax && d2 >= g.
io2 && d2 < g.
oi2) {
338 if (Overwrite) *ptr = g.
color;
else *ptr += g.
color;
339 d2 += xd; xd += 131072; ++ptr; ++px;
340 }
341
342 while (px <= g.xmax && d2 >= g.
ii2 && d2 < g.
io2) {
343 fl::u16 diff =
static_cast<fl::u16
>(
static_cast<fl::u32
>(d2 - g.
ii2) >> g.
inner_shift);
345 PixelT c = g.
color; c.nscale8(br);
346 if (Overwrite) *ptr = c; else *ptr += c;
347 d2 += xd; xd += 131072; ++ptr; ++px;
348 }
349
350 while (px <= g.
xmax && d2 < g.
ii2) {
351 d2 += xd; xd += 131072; ++ptr; ++px;
352 }
353
354 while (px <= g.xmax && d2 >= g.
ii2 && d2 < g.
io2) {
355 fl::u16 diff =
static_cast<fl::u16
>(
static_cast<fl::u32
>(d2 - g.
ii2) >> g.
inner_shift);
357 PixelT c = g.
color; c.nscale8(br);
358 if (Overwrite) *ptr = c; else *ptr += c;
359 d2 += xd; xd += 131072; ++ptr; ++px;
360 }
361
362 while (px <= g.xmax && d2 >= g.
io2 && d2 < g.
oi2) {
363 if (Overwrite) *ptr = g.
color;
else *ptr += g.
color;
364 d2 += xd; xd += 131072; ++ptr; ++px;
365 }
366
367 while (px <= g.xmax && d2 >= g.
oi2 && d2 < g.
oo2) {
368 fl::u16 diff =
static_cast<fl::u16
>(
static_cast<fl::u32
>(g.
oo2 - d2) >> g.
outer_shift);
370 PixelT c = g.
color; c.nscale8(br);
371 if (Overwrite) *ptr = c; else *ptr += c;
372 d2 += xd; xd += 131072; ++ptr; ++px;
373 }
374}
References fl::gfx::detail::RingCtx< PixelT >::color, fl::gfx::detail::RingCtx< PixelT >::ii2, fl::gfx::detail::RingCtx< PixelT >::inner_inv, fl::gfx::detail::RingCtx< PixelT >::inner_shift, fl::gfx::detail::RingCtx< PixelT >::io2, fl::gfx::detail::RingCtx< PixelT >::oi2, fl::gfx::detail::RingCtx< PixelT >::oo2, fl::gfx::detail::RingCtx< PixelT >::outer_inv, fl::gfx::detail::RingCtx< PixelT >::outer_shift, renderRingRow(), fl::gfx::detail::RingCtx< PixelT >::xdelta0, fl::gfx::detail::RingCtx< PixelT >::xmax, and fl::gfx::detail::RingCtx< PixelT >::xmin.
Referenced by drawRingCore(), and renderRingRow().