#ifndef rasterizeSpan
#endif
-#define GET_IMAGE(image) \
- uint32_t *buf = (image)->bits.bits; \
- uint32_t stride = (image)->bits.rowstride; \
- uint32_t width = (image)->bits.width;
-
static void
rasterizeEdges (pixman_image_t *image,
pixman_edge_t *l,
{
pixman_fixed_t y = t;
uint32_t *line;
- GET_IMAGE(image);
+ uint32_t *buf = (image)->bits.bits;
+ uint32_t stride = (image)->bits.rowstride;
+ uint32_t width = (image)->bits.width;
- line = buf + pixman_fixed_to_int (y) * (stride / sizeof (uint32_t));
+ line = buf + pixman_fixed_to_int (y) * stride;
- for (;;)
+ for (;;)
+ {
+ pixman_fixed_t lx;
+ pixman_fixed_t rx;
+ int lxi;
+ int rxi;
+
+ /* clip X */
+ lx = l->x;
+ if (lx < 0)
+ lx = 0;
+ rx = r->x;
+ if (pixman_fixed_to_int (rx) >= width)
+ rx = pixman_int_to_fixed (width);
+
+ /* Skip empty (or backwards) sections */
+ if (rx > lx)
{
- pixman_fixed_t lx;
- pixman_fixed_t rx;
- int lxi;
- int rxi;
- /* clip X */
- lx = l->x;
- if (lx < 0)
- lx = 0;
- rx = r->x;
- if (pixman_fixed_to_int (rx) >= width)
- rx = pixman_int_to_fixed (width);
+ /* Find pixel bounds for span */
+ lxi = pixman_fixed_to_int (lx);
+ rxi = pixman_fixed_to_int (rx);
- /* Skip empty (or backwards) sections */
- if (rx > lx)
+#if N_BITS == 1
{
+ uint32_t *a = line;
+ uint32_t startmask;
+ uint32_t endmask;
+ int nmiddle;
+ int width = rxi - lxi;
+ int x = lxi;
- /* Find pixel bounds for span */
- lxi = pixman_fixed_to_int (lx);
- rxi = pixman_fixed_to_int (rx);
+ a += x >> FB_SHIFT;
+ x &= FB_MASK;
-#if N_BITS == 1
- {
- uint32_t *a = line;
- uint32_t startmask;
- uint32_t endmask;
- int nmiddle;
- int width = rxi - lxi;
- int x = lxi;
-
- a += x >> FB_SHIFT;
- x &= FB_MASK;
-
- ACCESS_MEM(
- FbMaskBits (x, width, startmask, nmiddle, endmask);
- if (startmask) {
- WRITE(a, READ(a) | startmask);
- a++;
- }
- while (nmiddle--)
- WRITE(a++, FB_ALLONES);
- if (endmask)
- WRITE(a, READ(a) | endmask);
- );
- }
+ FbMaskBits (x, width, startmask, nmiddle, endmask);
+ ACCESS_MEM(
+ if (startmask) {
+ WRITE(a, READ(a) | startmask);
+ a++;
+ }
+ while (nmiddle--)
+ WRITE(a++, FB_ALLONES);
+ if (endmask)
+ WRITE(a, READ(a) | endmask);
+ );
+ }
#else
- {
- DefineAlpha(line,lxi);
- int lxs;
- int rxs;
-
- /* Sample coverage for edge pixels */
- lxs = RenderSamplesX (lx, N_BITS);
- rxs = RenderSamplesX (rx, N_BITS);
-
- /* Add coverage across row */
- ACCESS_MEM(
- if (lxi == rxi)
- {
- AddAlpha (rxs - lxs);
- }
- else
+ {
+ DefineAlpha(line,lxi);
+ int lxs;
+ int rxs;
+
+ /* Sample coverage for edge pixels */
+ lxs = RenderSamplesX (lx, N_BITS);
+ rxs = RenderSamplesX (rx, N_BITS);
+
+ /* Add coverage across row */
+ ACCESS_MEM(
+ if (lxi == rxi)
+ {
+ AddAlpha (rxs - lxs);
+ }
+ else
+ {
+ int xi;
+
+ AddAlpha (N_X_FRAC(N_BITS) - lxs);
+ StepAlpha;
+ for (xi = lxi + 1; xi < rxi; xi++)
{
- int xi;
-
- AddAlpha (N_X_FRAC(N_BITS) - lxs);
+ AddAlpha (N_X_FRAC(N_BITS));
StepAlpha;
- for (xi = lxi + 1; xi < rxi; xi++)
- {
- AddAlpha (N_X_FRAC(N_BITS));
- StepAlpha;
- }
- /* Do not add in a 0 alpha here. This check is necessary
- * to avoid a buffer overrun when rx is exactly on a pixel
- * boundary.
- */
- if (rxs != 0)
- AddAlpha (rxs);
- });
- }
-#endif
+ }
+ /* Do not add in a 0 alpha here. This check is necessary
+ * to avoid a buffer overrun when rx is exactly on a pixel
+ * boundary.
+ */
+ if (rxs != 0)
+ AddAlpha (rxs);
+ });
}
-
- if (y == b)
- break;
-
+#endif
+ }
+
+ if (y == b)
+ break;
+
#if N_BITS > 1
- if (pixman_fixed_frac (y) != Y_FRAC_LAST(N_BITS))
- {
- RenderEdgeStepSmall (l);
- RenderEdgeStepSmall (r);
- y += STEP_Y_SMALL(N_BITS);
- }
- else
+ if (pixman_fixed_frac (y) != Y_FRAC_LAST(N_BITS))
+ {
+ RenderEdgeStepSmall (l);
+ RenderEdgeStepSmall (r);
+ y += STEP_Y_SMALL(N_BITS);
+ }
+ else
#endif
- {
- RenderEdgeStepBig (l);
- RenderEdgeStepBig (r);
- y += STEP_Y_BIG(N_BITS);
- line += stride;
- }
+ {
+ RenderEdgeStepBig (l);
+ RenderEdgeStepBig (r);
+ y += STEP_Y_BIG(N_BITS);
+ line += stride;
}
+ }
}
#undef rasterizeSpan