mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-09 08:20:12 +01:00
st/mesa: simplify a bit of the previous patch
Grrr, this was supposed to go in the previous commit.
This commit is contained in:
parent
6e9c7c4c11
commit
2c57caa893
1 changed files with 8 additions and 5 deletions
|
|
@ -211,9 +211,11 @@ st_fast_readpixels(struct gl_context *ctx, struct st_renderbuffer *strb,
|
|||
|
||||
if (strb->format == PIPE_FORMAT_B8G8R8A8_UNORM) {
|
||||
alphaORoperand = 0;
|
||||
} else if (strb->format == PIPE_FORMAT_B8G8R8X8_UNORM ) {
|
||||
}
|
||||
else if (strb->format == PIPE_FORMAT_B8G8R8X8_UNORM ) {
|
||||
alphaORoperand = 0xff;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -312,9 +314,10 @@ st_fast_readpixels(struct gl_context *ctx, struct st_renderbuffer *strb,
|
|||
const GLubyte *src = map + y * trans->stride;
|
||||
memcpy(dst, src, 4 * width);
|
||||
if (alphaORoperand) {
|
||||
for (col = 0; col < width; col++) {
|
||||
dst[col*4+3] |= alphaORoperand;
|
||||
}
|
||||
assert(alphaORoperand == 0xff);
|
||||
for (col = 0; col < width; col++) {
|
||||
dst[col*4+3] = 0xff;
|
||||
}
|
||||
}
|
||||
dst += dstStride;
|
||||
y += dy;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue