summaryrefslogtreecommitdiff
path: root/src/mesa/main/framebuffer.c
diff options
context:
space:
mode:
authorChia-I Wu <olvaffe@gmail.com>2010-01-12 11:25:02 +0800
committerChia-I Wu <olvaffe@gmail.com>2010-01-12 11:25:02 +0800
commit562c127693200822f04a145db50add1be2425d7b (patch)
tree9441774fb212b17ddf2a364f06abc43f166cc00b /src/mesa/main/framebuffer.c
parente5d351dcfde58777162552cf5cd2a9cd8299f4cd (diff)
parent077d6dd7508af88509dd0499c5dfbdaa186b4015 (diff)
Merge branch 'master' into opengl-es-v2
Conflicts: src/mesa/main/dd.h
Diffstat (limited to 'src/mesa/main/framebuffer.c')
-rw-r--r--src/mesa/main/framebuffer.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c
index 154dedacd5..d958dbf7d4 100644
--- a/src/mesa/main/framebuffer.c
+++ b/src/mesa/main/framebuffer.c
@@ -969,3 +969,29 @@ _mesa_dest_buffer_exists(GLcontext *ctx, GLenum format)
/* OK */
return GL_TRUE;
}
+
+GLenum
+_mesa_get_color_read_format(GLcontext *ctx)
+{
+ switch (ctx->ReadBuffer->_ColorReadBuffer->Format) {
+ case MESA_FORMAT_ARGB8888:
+ return GL_BGRA;
+ case MESA_FORMAT_RGB565:
+ return GL_BGR;
+ default:
+ return GL_RGBA;
+ }
+}
+
+GLenum
+_mesa_get_color_read_type(GLcontext *ctx)
+{
+ switch (ctx->ReadBuffer->_ColorReadBuffer->Format) {
+ case MESA_FORMAT_ARGB8888:
+ return GL_UNSIGNED_BYTE;
+ case MESA_FORMAT_RGB565:
+ return GL_UNSIGNED_SHORT_5_6_5_REV;
+ default:
+ return GL_UNSIGNED_BYTE;
+ }
+}