[Pixman] [PATCH 5/8] perfstat: Gather performance data from pixman_image_composite()

Taekyun Kim podain77 at gmail.com
Mon Sep 19 07:08:23 PDT 2011


From: Taekyun Kim <tkq.kim at samsung.com>

---
 pixman/pixman.c |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/pixman/pixman.c b/pixman/pixman.c
index 75b80c0..ed3abaf 100644
--- a/pixman/pixman.c
+++ b/pixman/pixman.c
@@ -771,6 +771,7 @@ pixman_image_composite32 (pixman_op_t      op,
 	pixman_composite_info_t info;
 	const pixman_box32_t *pbox;
 	int n;
+	double t0, t1;
 
 	info.op = op;
 	info.src_image = src;
@@ -790,7 +791,24 @@ pixman_image_composite32 (pixman_op_t      op,
 	    info.width = pbox->x2 - pbox->x1;
 	    info.height = pbox->y2 - pbox->y1;
 
-	    func (imp, &info);
+	    if (perfstat_is_enabled ())
+	    {
+		t0 = perfstat_get_time ();
+
+		func (imp, &info);
+
+		t1 = perfstat_get_time ();
+		perfstat_add_composite (imp->type, op,
+					src_format, src_flags,
+					mask_format, mask_flags,
+					dest_format, dest_flags,
+					info.width, info.height,
+					t1 - t0);
+	    }
+	    else
+	    {
+		func (imp, &info);
+	    }
 
 	    pbox++;
 	}
-- 
1.7.1



More information about the Pixman mailing list