From cbedfe75135e3253c32ac8b89380f47d1b8a37c4 Mon Sep 17 00:00:00 2001 From: Zhigang Gong Date: Sun, 26 Jun 2011 20:00:26 +0800 Subject: [PATCH] glamor: Don't need to read dest if op is SRC or CLEAR. Signed-off-by: Zhigang Gong --- glamor/glamor_render.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/glamor/glamor_render.c b/glamor/glamor_render.c index 2d89cd48d..59a74dfb3 100644 --- a/glamor/glamor_render.c +++ b/glamor/glamor_render.c @@ -1084,6 +1084,7 @@ glamor_composite(CARD8 op, CARD16 height) { glamor_composite_rect_t rect; + glamor_access_t dest_access; /* Do two-pass PictOpOver componentAlpha, until we enable * dual source color blending. @@ -1150,7 +1151,11 @@ glamor_composite(CARD8 op, glUseProgramObjectARB(0); glDisable(GL_BLEND); - if (glamor_prepare_access_picture(dest, GLAMOR_ACCESS_RW)) { + if (op == PictOpSrc || op == PictOpClear) + dest_access = GLAMOR_ACCESS_WO; + else + dest_access = GLAMOR_ACCESS_RW; + if (glamor_prepare_access_picture(dest, dest_access)) { if (glamor_prepare_access_picture(source, GLAMOR_ACCESS_RO)) { if (!mask ||