summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/intel
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2012-04-20 07:58:59 -0600
committerBrian Paul <[email protected]>2012-05-01 11:39:34 -0600
commit4433b0302d0aa9dc61002e8bb4fd1b752b0be338 (patch)
treea708fa134250670d76f6ea6ab13c5b465d14dda9 /src/mesa/drivers/dri/intel
parent264b584294dc1c00c53f6a0622b7e6e55e8dce37 (diff)
intel: use _mesa_is_winsys/user_fbo() helpers
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/intel')
-rw-r--r--src/mesa/drivers/dri/intel/intel_buffers.c5
-rw-r--r--src/mesa/drivers/dri/intel/intel_context.c4
-rw-r--r--src/mesa/drivers/dri/intel/intel_pixel_read.c5
3 files changed, 8 insertions, 6 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_buffers.c b/src/mesa/drivers/dri/intel/intel_buffers.c
index 9809f79bbee..2b0276327d2 100644
--- a/src/mesa/drivers/dri/intel/intel_buffers.c
+++ b/src/mesa/drivers/dri/intel/intel_buffers.c
@@ -30,6 +30,7 @@
#include "intel_fbo.h"
#include "intel_mipmap_tree.h"
+#include "main/fbobject.h"
#include "main/framebuffer.h"
#include "main/renderbuffer.h"
@@ -82,7 +83,7 @@ intel_check_front_buffer_rendering(struct intel_context *intel)
static void
intelDrawBuffer(struct gl_context * ctx, GLenum mode)
{
- if ((ctx->DrawBuffer != NULL) && (ctx->DrawBuffer->Name == 0)) {
+ if (ctx->DrawBuffer && _mesa_is_winsys_fbo(ctx->DrawBuffer)) {
struct intel_context *const intel = intel_context(ctx);
const bool was_front_buffer_rendering =
intel->is_front_buffer_rendering;
@@ -105,7 +106,7 @@ intelDrawBuffer(struct gl_context * ctx, GLenum mode)
static void
intelReadBuffer(struct gl_context * ctx, GLenum mode)
{
- if ((ctx->DrawBuffer != NULL) && (ctx->DrawBuffer->Name == 0)) {
+ if (ctx->DrawBuffer && _mesa_is_winsys_fbo(ctx->DrawBuffer)) {
struct intel_context *const intel = intel_context(ctx);
const bool was_front_buffer_reading =
intel->is_front_buffer_reading;
diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c
index b8472b6fd38..f572f382882 100644
--- a/src/mesa/drivers/dri/intel/intel_context.c
+++ b/src/mesa/drivers/dri/intel/intel_context.c
@@ -215,7 +215,7 @@ intel_flush_front(struct gl_context *ctx)
__DRIcontext *driContext = intel->driContext;
__DRIscreen *const screen = intel->intelScreen->driScrnPriv;
- if ((ctx->DrawBuffer->Name == 0) && intel->front_buffer_dirty) {
+ if (_mesa_is_winsys_fbo(ctx->DrawBuffer) && intel->front_buffer_dirty) {
if (screen->dri2.loader &&
(screen->dri2.loader->base.version >= 2)
&& (screen->dri2.loader->flushFrontBuffer != NULL) &&
@@ -454,7 +454,7 @@ intel_viewport(struct gl_context *ctx, GLint x, GLint y, GLsizei w, GLsizei h)
if (intel->saved_viewport)
intel->saved_viewport(ctx, x, y, w, h);
- if (ctx->DrawBuffer->Name == 0) {
+ if (_mesa_is_winsys_fbo(ctx->DrawBuffer)) {
dri2InvalidateDrawable(driContext->driDrawablePriv);
dri2InvalidateDrawable(driContext->driReadablePriv);
}
diff --git a/src/mesa/drivers/dri/intel/intel_pixel_read.c b/src/mesa/drivers/dri/intel/intel_pixel_read.c
index 34fed3d1f44..ab4e581c400 100644
--- a/src/mesa/drivers/dri/intel/intel_pixel_read.c
+++ b/src/mesa/drivers/dri/intel/intel_pixel_read.c
@@ -29,6 +29,7 @@
#include "main/enums.h"
#include "main/mtypes.h"
#include "main/macros.h"
+#include "main/fbobject.h"
#include "main/image.h"
#include "main/bufferobj.h"
#include "main/readpix.h"
@@ -116,7 +117,7 @@ do_blit_readpixels(struct gl_context * ctx,
return false;
}
else {
- if (ctx->ReadBuffer->Name == 0)
+ if (_mesa_is_winsys_fbo(ctx->ReadBuffer))
rowLength = -rowLength;
}
@@ -145,7 +146,7 @@ do_blit_readpixels(struct gl_context * ctx,
all ? INTEL_WRITE_FULL :
INTEL_WRITE_PART);
- if (ctx->ReadBuffer->Name == 0)
+ if (_mesa_is_winsys_fbo(ctx->ReadBuffer))
y = ctx->ReadBuffer->Height - (y + height);
if (!intelEmitCopyBlit(intel,