diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-10-06 12:36:30 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-10-06 12:45:46 +0100 |
commit | 1444ea35706992a1f094fe029e6a7d9eec0f93c6 (patch) | |
tree | e8448031c752bb6e31301701a15ad1325fd1c761 /src | |
parent | f286891d1415fc607f0c1b574e6bce4b3759493e (diff) |
dri+shadow: Only tweak the acceleration of CopyRegion if using shadow.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r-- | src/intel_dri.c | 42 |
1 files changed, 25 insertions, 17 deletions
diff --git a/src/intel_dri.c b/src/intel_dri.c index bc4dc504..8c7a707f 100644 --- a/src/intel_dri.c +++ b/src/intel_dri.c @@ -409,7 +409,6 @@ I830DRI2CopyRegion(DrawablePtr drawable, RegionPtr pRegion, DrawablePtr dst = (dstPrivate->attachment == DRI2BufferFrontLeft) ? drawable : &dstPrivate->pixmap->drawable; RegionPtr pCopyClip; - struct intel_pixmap *src_pixmap, *dst_pixmap; GCPtr gc; gc = GetScratchGC(dst->depth, screen); @@ -507,23 +506,32 @@ I830DRI2CopyRegion(DrawablePtr drawable, RegionPtr pRegion, * again. */ /* Re-enable 2D acceleration... */ - src_pixmap = intel_get_pixmap_private(get_drawable_pixmap(src)); - src_pixmap->offscreen = 1; - src_pixmap->busy = 1; - - dst_pixmap = intel_get_pixmap_private(get_drawable_pixmap(dst)); - dst_pixmap->offscreen = 1; - dst_pixmap->busy = 1; - - gc->ops->CopyArea(src, dst, gc, - 0, 0, - drawable->width, drawable->height, - 0, 0); - FreeScratchGC(gc); + if (intel->use_shadow) { + struct intel_pixmap *src_pixmap, *dst_pixmap; + + src_pixmap = intel_get_pixmap_private(get_drawable_pixmap(src)); + src_pixmap->offscreen = 1; + src_pixmap->busy = 1; + + dst_pixmap = intel_get_pixmap_private(get_drawable_pixmap(dst)); + dst_pixmap->offscreen = 1; + dst_pixmap->busy = 1; + + gc->ops->CopyArea(src, dst, gc, + 0, 0, + drawable->width, drawable->height, + 0, 0); - /* and restore 2D/3D coherency */ - src_pixmap->offscreen = 0; - dst_pixmap->offscreen = 0; + /* and restore 2D/3D coherency */ + src_pixmap->offscreen = 0; + dst_pixmap->offscreen = 0; + } else { + gc->ops->CopyArea(src, dst, gc, + 0, 0, + drawable->width, drawable->height, + 0, 0); + } + FreeScratchGC(gc); } #if DRI2INFOREC_VERSION >= 4 |