/** * Apply the current logic operator to a span of RGBA pixels. * We can handle horizontal runs of pixels (spans) or arrays of x/y * pixel coordinates. */ void _swrast_logicop_rgba_span(struct gl_context *ctx, struct gl_renderbuffer *rb, SWspan *span) { void *rbPixels; ASSERT(span->end < SWRAST_MAX_WIDTH); ASSERT(span->arrayMask & SPAN_RGBA); rbPixels = _swrast_get_dest_rgba(ctx, rb, span); if (span->array->ChanType == GL_UNSIGNED_BYTE) { /* treat 4*GLubyte as GLuint */ logicop_uint1(ctx, span->end, (GLuint *) span->array->rgba8, (const GLuint *) rbPixels, span->array->mask); } else if (span->array->ChanType == GL_UNSIGNED_SHORT) { /* treat 2*GLushort as GLuint */ logicop_uint2(ctx, 2 * span->end, (GLuint *) span->array->rgba16, (const GLuint *) rbPixels, span->array->mask); } else { logicop_uint4(ctx, 4 * span->end, (GLuint *) span->array->attribs[VARYING_SLOT_COL0], (const GLuint *) rbPixels, span->array->mask); } }
/** * Apply the current logic operator to a span of RGBA pixels. * We can handle horizontal runs of pixels (spans) or arrays of x/y * pixel coordinates. */ void _swrast_logicop_rgba_span(GLcontext *ctx, struct gl_renderbuffer *rb, SWspan *span) { void *rbPixels; ASSERT(span->end < MAX_WIDTH); ASSERT(span->arrayMask & SPAN_RGBA); ASSERT(rb->DataType == span->array->ChanType); rbPixels = _swrast_get_dest_rgba(ctx, rb, span); if (span->array->ChanType == GL_UNSIGNED_BYTE) { /* treat 4*GLubyte as GLuint */ logicop_uint1(ctx, span->end, (GLuint *) span->array->color.sz1.rgba, (const GLuint *) rbPixels, span->array->mask); } else if (span->array->ChanType == GL_UNSIGNED_SHORT) { /* treat 2*GLushort as GLuint */ logicop_uint2(ctx, 2 * span->end, (GLuint *) span->array->color.sz2.rgba, (const GLuint *) rbPixels, span->array->mask); } else { logicop_uint4(ctx, 4 * span->end, (GLuint *) span->array->attribs[FRAG_ATTRIB_COL0], (const GLuint *) rbPixels, span->array->mask); } }