summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSøren Sandmann Pedersen <sandmann@redhat.com>2009-09-12 05:26:50 -0400
committerSøren Sandmann Pedersen <ssp@redhat.com>2010-01-28 11:52:55 -0500
commitff6eaac50eaa8778ba15fd0f796e94cc751dea0a (patch)
tree6f7c9de0fd661274b8f283ab2fbf8b8c8e393c65
parent171dc4875644f72d65ff2e31533edacc781069ec (diff)
Move calls to source_is_fastpathable() into get_source_format()
-rw-r--r--pixman/pixman-utils.c65
1 files changed, 33 insertions, 32 deletions
diff --git a/pixman/pixman-utils.c b/pixman/pixman-utils.c
index 4a9e6160..cc3e6bae 100644
--- a/pixman/pixman-utils.c
+++ b/pixman/pixman-utils.c
@@ -527,40 +527,48 @@ get_source_format_code (pixman_image_t *image, pixman_format_code_t *code)
if (!image)
{
*code = PIXMAN_null;
+
+ return TRUE;
}
- else if (image->common.component_alpha)
+ else
{
- if (image->type == BITS)
+ if (!source_is_fastpathable (image))
+ return FALSE;
+
+ if (image->common.component_alpha)
{
- /* These are the *only* component_alpha formats
- * we support for fast paths
- */
- if (image->bits.format == PIXMAN_a8r8g8b8)
- *code = PIXMAN_a8r8g8b8_ca;
- else if (image->bits.format == PIXMAN_a8b8g8r8)
- *code = PIXMAN_a8b8g8r8_ca;
+ if (image->type == BITS)
+ {
+ /* These are the *only* component_alpha formats
+ * we support for fast paths
+ */
+ if (image->bits.format == PIXMAN_a8r8g8b8)
+ *code = PIXMAN_a8r8g8b8_ca;
+ else if (image->bits.format == PIXMAN_a8b8g8r8)
+ *code = PIXMAN_a8b8g8r8_ca;
+ else
+ return FALSE;
+ }
else
+ {
return FALSE;
+ }
+ }
+ else if (_pixman_image_is_solid (image))
+ {
+ *code = PIXMAN_solid;
+ }
+ else if (image->common.type == BITS)
+ {
+ *code = image->bits.format;
}
else
{
return FALSE;
}
+
+ return TRUE;
}
- else if (_pixman_image_is_solid (image))
- {
- *code = PIXMAN_solid;
- }
- else if (image->common.type == BITS)
- {
- *code = image->bits.format;
- }
- else
- {
- return FALSE;
- }
-
- return TRUE;
}
static force_inline pixman_bool_t
@@ -622,23 +630,16 @@ _pixman_run_fast_path (const pixman_fast_path_t *paths,
int32_t width,
int32_t height)
{
- pixman_composite_func_t func = NULL;
pixman_bool_t src_repeat = src->common.repeat == PIXMAN_REPEAT_NORMAL;
pixman_bool_t mask_repeat = mask && mask->common.repeat == PIXMAN_REPEAT_NORMAL;
- pixman_bool_t result;
pixman_format_code_t src_format, mask_format, dest_format;
+ pixman_composite_func_t func = NULL;
const pixman_fast_path_t *info;
-
- /* Source */
- if (!source_is_fastpathable (src))
- return FALSE;
+ pixman_bool_t result;
if (!get_source_format_code (src, &src_format))
return FALSE;
- if (mask && !source_is_fastpathable (mask))
- return FALSE;
-
if (!get_source_format_code (mask, &mask_format))
return FALSE;