[Pixman] [PATCH] Don't discriminate PAD and REFLECT repeat in standard fast paths
Siarhei Siamashka
siarhei.siamashka at gmail.com
Tue Sep 21 21:04:17 PDT 2010
From: Siarhei Siamashka <siarhei.siamashka at nokia.com>
Without this fix, setting PAD repeat on a source image prevents
the use of any nonscaled standard fast paths, affecting performance
a lot. But as long as no pixels outside the source image boundaries
are touched by the compositing operation, all the repeat types
behave the same and can take the same fast paths.
This is important because setting PAD repeat instead of NONE is
more hardware acceleration friendly (for the drivers implementing
RENDER extension) and does not inhibit OVER->SRC operator
optimization in pixman.
---
We discussed this problem and the related code with Soeren on IRC the
other day, and it may be that the code dealing with FAST_PATH_COVERS_CLIP
and FAST_PATH_SAMPLES_COVER_CLIP would better to be changed a bit. Along
with the selection of fast path functions dealing with SOLID sources or
masks (for example, any transformation set on a SOLID source image does
not actually make any difference for end result, so it can be ignored).
And there is a special optimization for NORMAL repeat in walk_region_internal()
function which is also somehow related. Well, I guess this all stuff
carried us away from the original problem :)
But now returning back to this issue. Ideally, PAD repeat would be a better
default instead of NONE. Just because NONE repeat is a bit strange and
hard to accelerate in hardware. This is one example from freedesktop.org
bugzilla (and there are more similar reports):
https://bugs.freedesktop.org/show_bug.cgi?id=27954
But right now setting PAD repeat for everying will cause serious performance
problems for pixman, because it will stop using simple non-transformed fast
paths.
This patch tries to address the problem. It passes current pixman tests and
I think that it is most likely fine. But I'm still not totally sure if it is
really safe in all possible cases.
pixman/pixman-image.c | 6 ++----
pixman/pixman-private.h | 2 --
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/pixman/pixman-image.c b/pixman/pixman-image.c
index 8397f6a..14a2219 100644
--- a/pixman/pixman-image.c
+++ b/pixman/pixman-image.c
@@ -363,16 +363,14 @@ compute_image_info (pixman_image_t *image)
flags |=
FAST_PATH_NO_PAD_REPEAT |
FAST_PATH_NO_NONE_REPEAT |
- FAST_PATH_NO_NORMAL_REPEAT |
- FAST_PATH_COVERS_CLIP;
+ FAST_PATH_NO_NORMAL_REPEAT;
break;
case PIXMAN_REPEAT_PAD:
flags |=
FAST_PATH_NO_REFLECT_REPEAT |
FAST_PATH_NO_NONE_REPEAT |
- FAST_PATH_NO_NORMAL_REPEAT |
- FAST_PATH_COVERS_CLIP;
+ FAST_PATH_NO_NORMAL_REPEAT;
break;
default:
diff --git a/pixman/pixman-private.h b/pixman/pixman-private.h
index d85868f..80b1ed3 100644
--- a/pixman/pixman-private.h
+++ b/pixman/pixman-private.h
@@ -597,8 +597,6 @@ _pixman_choose_implementation (void);
(FAST_PATH_ID_TRANSFORM | \
FAST_PATH_NO_ALPHA_MAP | \
FAST_PATH_NO_CONVOLUTION_FILTER | \
- FAST_PATH_NO_PAD_REPEAT | \
- FAST_PATH_NO_REFLECT_REPEAT | \
FAST_PATH_NO_ACCESSORS | \
FAST_PATH_NARROW_FORMAT | \
FAST_PATH_COVERS_CLIP)
--
1.7.2.2
More information about the Pixman
mailing list