pixman_bool_t pixman_multiply_overflows_int (unsigned int a, unsigned int b);
pixman_bool_t pixman_addition_overflows_int (unsigned int a, unsigned int b);
+/* Compositing utilities */
+pixman_bool_t
+_pixman_run_fast_path (const pixman_fast_path_t *paths,
+ pixman_implementation_t *imp,
+ pixman_op_t op,
+ pixman_image_t *src,
+ pixman_image_t *mask,
+ pixman_image_t *dest,
+ int32_t src_x,
+ int32_t src_y,
+ int32_t mask_x,
+ int32_t mask_y,
+ int32_t dest_x,
+ int32_t dest_y,
+ int32_t width,
+ int32_t height);
+
+void
+_pixman_walk_composite_region (pixman_implementation_t *imp,
+ pixman_op_t op,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ int16_t xSrc,
+ int16_t ySrc,
+ int16_t xMask,
+ int16_t yMask,
+ int16_t xDst,
+ int16_t yDst,
+ uint16_t width,
+ uint16_t height,
+ pixman_composite_func_t compositeRect);
+
#if DEBUG
#define return_if_fail(expr) \
pixman_bool_t pixman_region16_copy_from_region32 (pixman_region16_t *dst,
pixman_region32_t *src);
-#ifdef PIXMAN_TIMERS
-
-/* Timing */
-static inline uint64_t
-oil_profile_stamp_rdtsc (void)
-{
- uint64_t ts;
- __asm__ __volatile__("rdtsc\n" : "=A" (ts));
- return ts;
-}
-#define OIL_STAMP oil_profile_stamp_rdtsc
-
-typedef struct pixman_timer_t pixman_timer_t;
-
-struct pixman_timer_t
-{
- int initialized;
- const char *name;
- uint64_t n_times;
- uint64_t total;
- pixman_timer_t *next;
-};
-
-extern int timer_defined;
-void pixman_timer_register (pixman_timer_t *timer);
-
-#define TIMER_BEGIN(tname) \
- { \
- static pixman_timer_t timer##tname; \
- uint64_t begin##tname; \
- \
- if (!timer##tname.initialized) \
- { \
- timer##tname.initialized = 1; \
- timer##tname.name = #tname; \
- pixman_timer_register (&timer##tname); \
- } \
- \
- timer##tname.n_times++; \
- begin##tname = OIL_STAMP();
-
-#define TIMER_END(tname) \
- timer##tname.total += OIL_STAMP() - begin##tname; \
- }
-
-#endif /* PIXMAN_TIMERS */
+/*
+ * Implementations
+ */
typedef struct pixman_implementation_t pixman_implementation_t;
int height,
uint32_t xor);
-void
-_pixman_walk_composite_region (pixman_implementation_t *imp,
- pixman_op_t op,
- pixman_image_t * pSrc,
- pixman_image_t * pMask,
- pixman_image_t * pDst,
- int16_t xSrc,
- int16_t ySrc,
- int16_t xMask,
- int16_t yMask,
- int16_t xDst,
- int16_t yDst,
- uint16_t width,
- uint16_t height,
- pixman_composite_func_t compositeRect);
-
void _pixman_setup_combiner_functions_32 (pixman_implementation_t *imp);
void _pixman_setup_combiner_functions_64 (pixman_implementation_t *imp);
_pixman_implementation_create_vmx (void);
#endif
-pixman_bool_t
-_pixman_run_fast_path (const pixman_fast_path_t *paths,
- pixman_implementation_t *imp,
- pixman_op_t op,
- pixman_image_t *src,
- pixman_image_t *mask,
- pixman_image_t *dest,
- int32_t src_x,
- int32_t src_y,
- int32_t mask_x,
- int32_t mask_y,
- int32_t dest_x,
- int32_t dest_y,
- int32_t width,
- int32_t height);
-
pixman_implementation_t *
_pixman_choose_implementation (void);
+
+
+#ifdef PIXMAN_TIMERS
+/*
+ * Timers
+ */
+
+static inline uint64_t
+oil_profile_stamp_rdtsc (void)
+{
+ uint64_t ts;
+ __asm__ __volatile__("rdtsc\n" : "=A" (ts));
+ return ts;
+}
+#define OIL_STAMP oil_profile_stamp_rdtsc
+
+typedef struct pixman_timer_t pixman_timer_t;
+
+struct pixman_timer_t
+{
+ int initialized;
+ const char *name;
+ uint64_t n_times;
+ uint64_t total;
+ pixman_timer_t *next;
+};
+
+extern int timer_defined;
+void pixman_timer_register (pixman_timer_t *timer);
+
+#define TIMER_BEGIN(tname) \
+ { \
+ static pixman_timer_t timer##tname; \
+ uint64_t begin##tname; \
+ \
+ if (!timer##tname.initialized) \
+ { \
+ timer##tname.initialized = 1; \
+ timer##tname.name = #tname; \
+ pixman_timer_register (&timer##tname); \
+ } \
+ \
+ timer##tname.n_times++; \
+ begin##tname = OIL_STAMP();
+
+#define TIMER_END(tname) \
+ timer##tname.total += OIL_STAMP() - begin##tname; \
+ }
+
+#endif /* PIXMAN_TIMERS */
+
#endif /* PIXMAN_PRIVATE_H */
}
}
else if (!pixman_region32_not_empty (pClip))
+ {
return FALSE;
+ }
else
{
if (dx || dy)
return malloc (a * b * c);
}
-
-/**
- * pixman_version:
- *
- * Returns the version of the pixman library encoded in a single
- * integer as per %PIXMAN_VERSION_ENCODE. The encoding ensures that
- * later versions compare greater than earlier versions.
- *
- * A run-time comparison to check that pixman's version is greater than
- * or equal to version X.Y.Z could be performed as follows:
- *
- * <informalexample><programlisting>
- * if (pixman_version() >= PIXMAN_VERSION_ENCODE(X,Y,Z)) {...}
- * </programlisting></informalexample>
- *
- * See also pixman_version_string() as well as the compile-time
- * equivalents %PIXMAN_VERSION and %PIXMAN_VERSION_STRING.
- *
- * Return value: the encoded version.
- **/
-PIXMAN_EXPORT int
-pixman_version (void)
-{
- return PIXMAN_VERSION;
-}
-
/*
* Helper routine to expand a color component from 0 < n <= 8 bits to 16 bits by
* replication.
return TRUE;
}
+
+/**
+ * pixman_version:
+ *
+ * Returns the version of the pixman library encoded in a single
+ * integer as per %PIXMAN_VERSION_ENCODE. The encoding ensures that
+ * later versions compare greater than earlier versions.
+ *
+ * A run-time comparison to check that pixman's version is greater than
+ * or equal to version X.Y.Z could be performed as follows:
+ *
+ * <informalexample><programlisting>
+ * if (pixman_version() >= PIXMAN_VERSION_ENCODE(X,Y,Z)) {...}
+ * </programlisting></informalexample>
+ *
+ * See also pixman_version_string() as well as the compile-time
+ * equivalents %PIXMAN_VERSION and %PIXMAN_VERSION_STRING.
+ *
+ * Return value: the encoded version.
+ **/
+PIXMAN_EXPORT int
+pixman_version (void)
+{
+ return PIXMAN_VERSION;
+}
+