summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/readpix.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2013-03-28 01:50:21 +0100
committerMarek Olšák <[email protected]>2013-04-06 23:57:04 +0200
commit21d407c1b8bf3be1eff87121d528d03c240ce207 (patch)
tree5909f109a8e529e2e2663b42a10e56a5aca848d1 /src/mesa/main/readpix.c
parentc4629ad3f9440ec7ad3d9f4881d0aba41a93f2f5 (diff)
mesa: refactor clamping controls, get rid of _ClampReadColor
v2: cosmetic changes from Brian's email Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/main/readpix.c')
-rw-r--r--src/mesa/main/readpix.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mesa/main/readpix.c b/src/mesa/main/readpix.c
index d3d09dea345..0dee3806333 100644
--- a/src/mesa/main/readpix.c
+++ b/src/mesa/main/readpix.c
@@ -24,6 +24,7 @@
#include "glheader.h"
#include "imports.h"
+#include "blend.h"
#include "bufferobj.h"
#include "context.h"
#include "enums.h"
@@ -80,7 +81,7 @@ get_readpixels_transfer_ops(const struct gl_context *ctx, gl_format texFormat,
if (uses_blit) {
/* For blit-based ReadPixels packing, the clamping is done automatically
* unless the type is float. */
- if (ctx->Color._ClampReadColor == GL_TRUE &&
+ if (_mesa_get_clamp_read_color(ctx) &&
(type == GL_FLOAT || type == GL_HALF_FLOAT)) {
transferOps |= IMAGE_CLAMP_BIT;
}
@@ -88,7 +89,7 @@ get_readpixels_transfer_ops(const struct gl_context *ctx, gl_format texFormat,
else {
/* For CPU-based ReadPixels packing, the clamping must always be done
* for non-float types, */
- if (ctx->Color._ClampReadColor == GL_TRUE ||
+ if (_mesa_get_clamp_read_color(ctx) ||
(type != GL_FLOAT && type != GL_HALF_FLOAT)) {
transferOps |= IMAGE_CLAMP_BIT;
}