summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSiarhei Siamashka <siarhei.siamashka@nokia.com>2011-07-15 23:35:21 +0300
committerSiarhei Siamashka <siarhei.siamashka@nokia.com>2011-07-22 23:03:36 +0300
commit5754e5689d4cac8868d6416dffa4a7d0c2d15423 (patch)
treee4fcb149969068ab5cee5909cc4a962d86b010b9
parentc06af104546868ed748c8f771817f5e9ae9a6a2d (diff)
C fast path for scaled src_x888_8888 with nearest filter
The necessity is justified by a message in the pixman mailing list: http://lists.freedesktop.org/archives/pixman/2011-July/001330.html NONE repeat is not supported, but could be added by tweaking the interpretation and making use of 'fully_transparent_src' scanline function argument.
-rw-r--r--pixman/pixman-fast-path.c10
-rw-r--r--pixman/pixman-fast-path.h1
-rw-r--r--pixman/pixman-private.h1
3 files changed, 12 insertions, 0 deletions
diff --git a/pixman/pixman-fast-path.c b/pixman/pixman-fast-path.c
index 3c05383..9a6919e 100644
--- a/pixman/pixman-fast-path.c
+++ b/pixman/pixman-fast-path.c
@@ -1174,6 +1174,9 @@ FAST_NEAREST (8888_8888_cover, 8888, 8888, uint32_t, uint32_t, SRC, COVER)
FAST_NEAREST (8888_8888_none, 8888, 8888, uint32_t, uint32_t, SRC, NONE)
FAST_NEAREST (8888_8888_pad, 8888, 8888, uint32_t, uint32_t, SRC, PAD)
FAST_NEAREST (8888_8888_normal, 8888, 8888, uint32_t, uint32_t, SRC, NORMAL)
+FAST_NEAREST (x888_8888_cover, x888, 8888, uint32_t, uint32_t, SRC, COVER)
+FAST_NEAREST (x888_8888_pad, x888, 8888, uint32_t, uint32_t, SRC, PAD)
+FAST_NEAREST (x888_8888_normal, x888, 8888, uint32_t, uint32_t, SRC, NORMAL)
FAST_NEAREST (8888_8888_cover, 8888, 8888, uint32_t, uint32_t, OVER, COVER)
FAST_NEAREST (8888_8888_none, 8888, 8888, uint32_t, uint32_t, OVER, NONE)
FAST_NEAREST (8888_8888_pad, 8888, 8888, uint32_t, uint32_t, OVER, PAD)
@@ -1716,6 +1719,13 @@ static const pixman_fast_path_t c_fast_paths[] =
SIMPLE_NEAREST_FAST_PATH (SRC, r5g6b5, r5g6b5, 565_565),
+ SIMPLE_NEAREST_FAST_PATH_COVER (SRC, x8r8g8b8, a8r8g8b8, x888_8888),
+ SIMPLE_NEAREST_FAST_PATH_COVER (SRC, x8b8g8r8, a8b8g8r8, x888_8888),
+ SIMPLE_NEAREST_FAST_PATH_PAD (SRC, x8r8g8b8, a8r8g8b8, x888_8888),
+ SIMPLE_NEAREST_FAST_PATH_PAD (SRC, x8b8g8r8, a8b8g8r8, x888_8888),
+ SIMPLE_NEAREST_FAST_PATH_NORMAL (SRC, x8r8g8b8, a8r8g8b8, x888_8888),
+ SIMPLE_NEAREST_FAST_PATH_NORMAL (SRC, x8b8g8r8, a8b8g8r8, x888_8888),
+
SIMPLE_NEAREST_FAST_PATH (OVER, a8r8g8b8, x8r8g8b8, 8888_8888),
SIMPLE_NEAREST_FAST_PATH (OVER, a8b8g8r8, x8b8g8r8, 8888_8888),
SIMPLE_NEAREST_FAST_PATH (OVER, a8r8g8b8, a8r8g8b8, 8888_8888),
diff --git a/pixman/pixman-fast-path.h b/pixman/pixman-fast-path.h
index e94591a..2b55c2e 100644
--- a/pixman/pixman-fast-path.h
+++ b/pixman/pixman-fast-path.h
@@ -157,6 +157,7 @@ pad_repeat_get_scanline_bounds (int32_t source_image_width,
/* This is not actually used since we don't have an OVER with
565 source, but it is needed to build. */
#define GET_0565_ALPHA(s) 0xff
+#define GET_x888_ALPHA(s) 0xff
#define FAST_NEAREST_SCANLINE(scanline_func_name, SRC_FORMAT, DST_FORMAT, \
src_type_t, dst_type_t, OP, repeat_mode) \
diff --git a/pixman/pixman-private.h b/pixman/pixman-private.h
index 65494c9..6a3935e 100644
--- a/pixman/pixman-private.h
+++ b/pixman/pixman-private.h
@@ -763,6 +763,7 @@ pixman_region16_copy_from_region32 (pixman_region16_t *dst,
/* Trivial versions that are useful in macros */
#define CONVERT_8888_TO_8888(s) (s)
+#define CONVERT_x888_TO_8888(s) ((s) | 0xff000000)
#define CONVERT_0565_TO_0565(s) (s)
#define PIXMAN_FORMAT_IS_WIDE(f) \