Move pixman_version() to pixman.c
authorSøren Sandmann Pedersen <sandmann@redhat.com>
Mon, 22 Jun 2009 02:05:49 +0000 (22:05 -0400)
committerSøren Sandmann Pedersen <sandmann@redhat.com>
Mon, 22 Jun 2009 02:36:15 +0000 (22:36 -0400)
pixman/pixman-private.h
pixman/pixman-utils.c
pixman/pixman.c

index ac4ef0d..85cb7ee 100644 (file)
@@ -52,6 +52,39 @@ void          *pixman_malloc_abc (unsigned int a, unsigned int b, unsigned int c
 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)                                           \
@@ -539,52 +572,9 @@ pixman_bool_t pixman_region32_copy_from_region16 (pixman_region32_t *dst,
 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;
 
@@ -638,22 +628,6 @@ typedef pixman_bool_t (* pixman_fill_func_t) (pixman_implementation_t *imp,
                                              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);
 
@@ -789,23 +763,58 @@ pixman_implementation_t *
 _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 */
index 7975d01..c313376 100644 (file)
@@ -63,7 +63,9 @@ miClipPictureReg (pixman_region32_t * pRegion,
        }
     }
     else if (!pixman_region32_not_empty (pClip))
+    {
        return FALSE;
+    }
     else
     {
        if (dx || dy)
@@ -277,32 +279,6 @@ pixman_malloc_abc (unsigned int a,
        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.
index 6f08583..263cb89 100644 (file)
@@ -318,3 +318,29 @@ pixman_image_fill_rectangles (pixman_op_t              op,
 
     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;
+}
+