pixman: Branch 'master' - 2 commits
Søren Sandmann Pedersen
sandmann at kemper.freedesktop.org
Sat May 23 09:24:21 PDT 2009
pixman/pixman-access.c | 8 +-
pixman/pixman-bits-image.c | 133 +++++++++++++++++++++++++++++++++++++++++++-
pixman/pixman-compose.c | 9 +-
pixman/pixman-image.c | 48 ---------------
pixman/pixman-private.h | 25 ++++----
pixman/pixman-transformed.c | 75 ------------------------
6 files changed, 154 insertions(+), 144 deletions(-)
New commits:
commit 25509f4b0b3a6b17810605706e5b93e0b9f4cb08
Author: Søren Sandmann Pedersen <sandmann at redhat.com>
Date: Wed May 20 18:28:03 2009 -0400
Move fbStoreExternalAlpha{,64} into pixman-bits-image.c
diff --git a/pixman/pixman-access.c b/pixman/pixman-access.c
index a451e80..6b3ce34 100644
--- a/pixman/pixman-access.c
+++ b/pixman/pixman-access.c
@@ -678,10 +678,10 @@ fbFetch_yuy2 (bits_image_t *pict, int x, int line, int width, uint32_t *buffer)
/* B = 1.164(Y - 16) + 2.018(U - 128) */
b = 0x012b27 * y + 0x0206a2 * u;
- WRITE(pict, buffer++, 0xff000000 |
- (r >= 0 ? r < 0x1000000 ? r & 0xff0000 : 0xff0000 : 0) |
- (g >= 0 ? g < 0x1000000 ? (g >> 8) & 0x00ff00 : 0x00ff00 : 0) |
- (b >= 0 ? b < 0x1000000 ? (b >> 16) & 0x0000ff : 0x0000ff : 0));
+ WRITE(pict, buffer++, 0xff000000 |
+ (r >= 0 ? r < 0x1000000 ? r & 0xff0000 : 0xff0000 : 0) |
+ (g >= 0 ? g < 0x1000000 ? (g >> 8) & 0x00ff00 : 0x00ff00 : 0) |
+ (b >= 0 ? b < 0x1000000 ? (b >> 16) & 0x0000ff : 0x0000ff : 0));
}
}
diff --git a/pixman/pixman-bits-image.c b/pixman/pixman-bits-image.c
index 2178372..888e487 100644
--- a/pixman/pixman-bits-image.c
+++ b/pixman/pixman-bits-image.c
@@ -112,6 +112,81 @@ fbStore64 (bits_image_t * image, int x, int y, int width, uint64_t *buffer)
}
static void
+fbStoreExternalAlpha (bits_image_t * image, int x, int y, int width,
+ uint32_t *buffer)
+{
+ uint32_t *bits, *alpha_bits;
+ int32_t stride, astride;
+ int ax, ay;
+ storeProc32 store;
+ storeProc32 astore;
+ const pixman_indexed_t * indexed = image->indexed;
+ const pixman_indexed_t * aindexed;
+
+ if (!image->common.alpha_map) {
+ // XXX[AGP]: This should never happen!
+ // fbStore(image, x, y, width, buffer);
+ abort();
+ return;
+ }
+
+ store = WRITE_ACCESS(pixman_storeProcForPicture32)(image);
+ astore = WRITE_ACCESS(pixman_storeProcForPicture32)(image->common.alpha_map);
+ aindexed = image->common.alpha_map->indexed;
+
+ ax = x;
+ ay = y;
+
+ bits = image->bits;
+ stride = image->rowstride;
+
+ alpha_bits = image->common.alpha_map->bits;
+ astride = image->common.alpha_map->rowstride;
+
+ bits += y*stride;
+ alpha_bits += (ay - image->common.alpha_origin.y)*astride;
+
+
+ store((pixman_image_t *)image, bits, buffer, x, width, indexed);
+ astore((pixman_image_t *)image->common.alpha_map,
+ alpha_bits, buffer, ax - image->common.alpha_origin.x, width, aindexed);
+}
+
+static void
+fbStoreExternalAlpha64 (bits_image_t * image, int x, int y, int width,
+ uint64_t *buffer)
+{
+ uint32_t *bits, *alpha_bits;
+ int32_t stride, astride;
+ int ax, ay;
+ storeProc64 store;
+ storeProc64 astore;
+ const pixman_indexed_t * indexed = image->indexed;
+ const pixman_indexed_t * aindexed;
+
+ store = ACCESS(pixman_storeProcForPicture64)(image);
+ astore = ACCESS(pixman_storeProcForPicture64)(image->common.alpha_map);
+ aindexed = image->common.alpha_map->indexed;
+
+ ax = x;
+ ay = y;
+
+ bits = image->bits;
+ stride = image->rowstride;
+
+ alpha_bits = image->common.alpha_map->bits;
+ astride = image->common.alpha_map->rowstride;
+
+ bits += y*stride;
+ alpha_bits += (ay - image->common.alpha_origin.y)*astride;
+
+
+ store((pixman_image_t *)image, bits, buffer, x, width, indexed);
+ astore((pixman_image_t *)image->common.alpha_map,
+ alpha_bits, buffer, ax - image->common.alpha_origin.x, width, aindexed);
+}
+
+static void
bits_image_property_changed (pixman_image_t *image)
{
bits_image_t *bits = (bits_image_t *)image;
@@ -148,10 +223,8 @@ bits_image_property_changed (pixman_image_t *image)
if (bits->common.alpha_map)
{
- bits->store_scanline_64 =
- (scanStoreProc)WRITE_ACCESS(fbStoreExternalAlpha64);
- bits->store_scanline_32 =
- (scanStoreProc)WRITE_ACCESS(fbStoreExternalAlpha);
+ bits->store_scanline_64 = (scanStoreProc)fbStoreExternalAlpha64;
+ bits->store_scanline_32 = fbStoreExternalAlpha;
}
else
{
@@ -174,7 +247,6 @@ _pixman_image_store_scanline_64 (bits_image_t *image, int x, int y, int width,
image->store_scanline_64 (image, x, y, width, buffer);
}
-
static uint32_t *
create_bits (pixman_format_code_t format,
int width,
diff --git a/pixman/pixman-private.h b/pixman/pixman-private.h
index e1f4ba2..7432e97 100644
--- a/pixman/pixman-private.h
+++ b/pixman/pixman-private.h
@@ -255,8 +255,6 @@ void _pixman_image_get_scanline_64_generic (pixman_image_t * pict, int x, int y,
uint64_t *buffer, uint64_t *mask, uint32_t maskBits);
void fbFetchTransformed(bits_image_t *, int x, int y, int width,
uint32_t *buffer, uint32_t *mask, uint32_t maskBits);
-void fbStoreExternalAlpha(bits_image_t *, int x, int y, int width,
- uint32_t *buffer);
void fbFetchExternalAlpha(bits_image_t *, int x, int y, int width,
uint32_t *buffer, uint32_t *mask, uint32_t maskBits);
@@ -269,12 +267,6 @@ void fbFetchExternalAlpha_accessors(bits_image_t *, int x, int y, int width,
uint32_t *buffer, uint32_t *mask,
uint32_t maskBits);
-void fbStoreExternalAlpha64(bits_image_t *, int x, int y, int width,
- uint64_t *buffer);
-
-void fbStoreExternalAlpha64_accessors(bits_image_t *, int x, int y, int width,
- uint64_t *buffer);
-
/* end */
typedef enum
diff --git a/pixman/pixman-transformed.c b/pixman/pixman-transformed.c
index 997d24e..d721b35 100644
--- a/pixman/pixman-transformed.c
+++ b/pixman/pixman-transformed.c
@@ -508,78 +508,3 @@ ACCESS(fbFetchExternalAlpha)(bits_image_t * pict, int x, int y, int width,
if (alpha_buffer != _alpha_buffer)
free(alpha_buffer);
}
-
-void
-ACCESS(fbStoreExternalAlpha)(bits_image_t * pict, int x, int y, int width,
- uint32_t *buffer)
-{
- uint32_t *bits, *alpha_bits;
- int32_t stride, astride;
- int ax, ay;
- storeProc32 store;
- storeProc32 astore;
- const pixman_indexed_t * indexed = pict->indexed;
- const pixman_indexed_t * aindexed;
-
- if (!pict->common.alpha_map) {
- // XXX[AGP]: This should never happen!
- // fbStore(pict, x, y, width, buffer);
- abort();
- return;
- }
-
- store = ACCESS(pixman_storeProcForPicture32)(pict);
- astore = ACCESS(pixman_storeProcForPicture32)(pict->common.alpha_map);
- aindexed = pict->common.alpha_map->indexed;
-
- ax = x;
- ay = y;
-
- bits = pict->bits;
- stride = pict->rowstride;
-
- alpha_bits = pict->common.alpha_map->bits;
- astride = pict->common.alpha_map->rowstride;
-
- bits += y*stride;
- alpha_bits += (ay - pict->common.alpha_origin.y)*astride;
-
-
- store((pixman_image_t *)pict, bits, buffer, x, width, indexed);
- astore((pixman_image_t *)pict->common.alpha_map,
- alpha_bits, buffer, ax - pict->common.alpha_origin.x, width, aindexed);
-}
-
-void
-ACCESS(fbStoreExternalAlpha64)(bits_image_t * pict, int x, int y, int width,
- uint64_t *buffer)
-{
- uint32_t *bits, *alpha_bits;
- int32_t stride, astride;
- int ax, ay;
- storeProc64 store;
- storeProc64 astore;
- const pixman_indexed_t * indexed = pict->indexed;
- const pixman_indexed_t * aindexed;
-
- store = ACCESS(pixman_storeProcForPicture64)(pict);
- astore = ACCESS(pixman_storeProcForPicture64)(pict->common.alpha_map);
- aindexed = pict->common.alpha_map->indexed;
-
- ax = x;
- ay = y;
-
- bits = pict->bits;
- stride = pict->rowstride;
-
- alpha_bits = pict->common.alpha_map->bits;
- astride = pict->common.alpha_map->rowstride;
-
- bits += y*stride;
- alpha_bits += (ay - pict->common.alpha_origin.y)*astride;
-
-
- store((pixman_image_t *)pict, bits, buffer, x, width, indexed);
- astore((pixman_image_t *)pict->common.alpha_map,
- alpha_bits, buffer, ax - pict->common.alpha_origin.x, width, aindexed);
-}
commit d74ad7c0fe9bd50ae04b59806f6c2bb9e6289634
Author: Søren Sandmann Pedersen <sandmann at redhat.com>
Date: Thu May 21 10:45:51 2009 -0400
Add new store_scanline_{32,64} in bits_image_t
Also move fbStore and fbStore64 into pixman-bits-image.c
diff --git a/pixman/pixman-bits-image.c b/pixman/pixman-bits-image.c
index 2dcf34b..2178372 100644
--- a/pixman/pixman-bits-image.c
+++ b/pixman/pixman-bits-image.c
@@ -26,6 +26,7 @@
#define READ_ACCESS(f) ((image->common.read_func)? f##_accessors : f)
+#define WRITE_ACCESS(f) ((image->common.write_func)? f##_accessors : f)
static void
fbFetchSolid(bits_image_t * image,
@@ -83,6 +84,34 @@ fbFetch64(bits_image_t * image,
}
static void
+fbStore(bits_image_t * image, int x, int y, int width, uint32_t *buffer)
+{
+ uint32_t *bits;
+ int32_t stride;
+ storeProc32 store = WRITE_ACCESS(pixman_storeProcForPicture32)(image);
+ const pixman_indexed_t * indexed = image->indexed;
+
+ bits = image->bits;
+ stride = image->rowstride;
+ bits += y*stride;
+ store((pixman_image_t *)image, bits, buffer, x, width, indexed);
+}
+
+static void
+fbStore64 (bits_image_t * image, int x, int y, int width, uint64_t *buffer)
+{
+ uint32_t *bits;
+ int32_t stride;
+ storeProc64 store = WRITE_ACCESS(pixman_storeProcForPicture64)(image);
+ const pixman_indexed_t * indexed = image->indexed;
+
+ bits = image->bits;
+ stride = image->rowstride;
+ bits += y*stride;
+ store((pixman_image_t *)image, bits, buffer, x, width, indexed);
+}
+
+static void
bits_image_property_changed (pixman_image_t *image)
{
bits_image_t *bits = (bits_image_t *)image;
@@ -95,8 +124,8 @@ bits_image_property_changed (pixman_image_t *image)
(scanFetchProc)READ_ACCESS(fbFetchExternalAlpha);
}
else if ((bits->common.repeat != PIXMAN_REPEAT_NONE) &&
- bits->width == 1 &&
- bits->height == 1)
+ bits->width == 1 &&
+ bits->height == 1)
{
image->common.get_scanline_64 = (scanFetchProc)fbFetchSolid64;
image->common.get_scanline_32 = (scanFetchProc)fbFetchSolid;
@@ -116,8 +145,36 @@ bits_image_property_changed (pixman_image_t *image)
image->common.get_scanline_32 =
(scanFetchProc)READ_ACCESS(fbFetchTransformed);
}
+
+ if (bits->common.alpha_map)
+ {
+ bits->store_scanline_64 =
+ (scanStoreProc)WRITE_ACCESS(fbStoreExternalAlpha64);
+ bits->store_scanline_32 =
+ (scanStoreProc)WRITE_ACCESS(fbStoreExternalAlpha);
+ }
+ else
+ {
+ bits->store_scanline_64 = (scanStoreProc)fbStore64;
+ bits->store_scanline_32 = fbStore;
+ }
+}
+
+void
+_pixman_image_store_scanline_32 (bits_image_t *image, int x, int y, int width,
+ uint32_t *buffer)
+{
+ image->store_scanline_32 (image, x, y, width, buffer);
+}
+
+void
+_pixman_image_store_scanline_64 (bits_image_t *image, int x, int y, int width,
+ uint32_t *buffer)
+{
+ image->store_scanline_64 (image, x, y, width, buffer);
}
+
static uint32_t *
create_bits (pixman_format_code_t format,
int width,
diff --git a/pixman/pixman-compose.c b/pixman/pixman-compose.c
index 23bfe5d..c588138 100644
--- a/pixman/pixman-compose.c
+++ b/pixman/pixman-compose.c
@@ -82,8 +82,11 @@ pixman_composite_rect_general_internal (const FbComposeData *data,
else
fetchDest = _pixman_image_get_scanline_32;
- store = _pixman_image_get_storer (data->dest, wide);
-
+ if (wide)
+ store = _pixman_image_store_scanline_64;
+ else
+ store = _pixman_image_store_scanline_32;
+
// Skip the store step and composite directly into the
// destination if the output format of the compose func matches
// the destination format.
@@ -186,7 +189,7 @@ pixman_composite_rect_general_internal (const FbComposeData *data,
compose (dest_buffer, src_buffer, mask_buffer, data->width);
/* write back */
- store (data->dest, data->xDest, data->yDest + i, data->width,
+ store (&(data->dest->bits), data->xDest, data->yDest + i, data->width,
dest_buffer);
}
else
diff --git a/pixman/pixman-image.c b/pixman/pixman-image.c
index 9d62f4a..c8295f8 100644
--- a/pixman/pixman-image.c
+++ b/pixman/pixman-image.c
@@ -164,54 +164,6 @@ _pixman_image_get_fetcher (pixman_image_t *image,
#define WRITE_ACCESS(f) ((image->common.write_func)? f##_accessors : f)
static void
-fbStore(bits_image_t * image, int x, int y, int width, uint32_t *buffer)
-{
- uint32_t *bits;
- int32_t stride;
- storeProc32 store = WRITE_ACCESS(pixman_storeProcForPicture32)(image);
- const pixman_indexed_t * indexed = image->indexed;
-
- bits = image->bits;
- stride = image->rowstride;
- bits += y*stride;
- store((pixman_image_t *)image, bits, buffer, x, width, indexed);
-}
-
-static void
-fbStore64(bits_image_t * image, int x, int y, int width, uint64_t *buffer)
-{
- uint32_t *bits;
- int32_t stride;
- storeProc64 store = WRITE_ACCESS(pixman_storeProcForPicture64)(image);
- const pixman_indexed_t * indexed = image->indexed;
-
- bits = image->bits;
- stride = image->rowstride;
- bits += y*stride;
- store((pixman_image_t *)image, bits, buffer, x, width, indexed);
-}
-
-scanStoreProc
-_pixman_image_get_storer (pixman_image_t *image,
- int wide)
-{
- if (image->common.alpha_map)
- {
- if (wide)
- return (scanStoreProc)WRITE_ACCESS(fbStoreExternalAlpha64);
- else
- return (scanStoreProc)WRITE_ACCESS(fbStoreExternalAlpha);
- }
- else
- {
- if (wide)
- return (scanStoreProc)fbStore64;
- else
- return (scanStoreProc)fbStore;
- }
-}
-
-static void
image_property_changed (pixman_image_t *image)
{
diff --git a/pixman/pixman-private.h b/pixman/pixman-private.h
index 927a1c4..e1f4ba2 100644
--- a/pixman/pixman-private.h
+++ b/pixman/pixman-private.h
@@ -295,7 +295,7 @@ typedef enum
SOURCE_IMAGE_CLASS_VERTICAL,
} source_pict_class_t;
-typedef void (*scanStoreProc)(pixman_image_t *, int, int, int, uint32_t *);
+typedef void (*scanStoreProc)(bits_image_t *img, int x, int y, int width, uint32_t *buffer);
typedef void (*scanFetchProc)(pixman_image_t *, int, int, int, uint32_t *,
uint32_t *, uint32_t);
@@ -316,9 +316,15 @@ void
_pixman_image_get_scanline_64 (pixman_image_t *image, int x, int y, int width,
uint32_t *buffer, uint32_t *unused, uint32_t unused2);
-scanStoreProc
-_pixman_image_get_storer (pixman_image_t *image,
- int wide);
+void
+_pixman_image_store_scanline_32 (bits_image_t *image, int x, int y, int width,
+ uint32_t *buffer);
+/* Even thought the type of buffer is uint32_t *, the function actually expects
+ * a uint64_t *buffer.
+ */
+void
+_pixman_image_store_scanline_64 (bits_image_t *image, int x, int y, int width,
+ uint32_t *buffer);
pixman_image_t *
_pixman_image_allocate (void);
@@ -431,6 +437,9 @@ struct bits_image
uint32_t * bits;
uint32_t * free_me;
int rowstride; /* in number of uint32_t's */
+
+ scanStoreProc store_scanline_32;
+ scanStoreProc store_scanline_64;
};
union pixman_image
More information about the xorg-commit
mailing list