[Mono-bugs] [Bug 74635][Wis] Changed - DrawImage slow on some images

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sat, 16 Apr 2005 13:51:59 -0400 (EDT)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by bmaurer@users.sf.net.

http://bugzilla.ximian.com/show_bug.cgi?id=74635

--- shadow/74635	2005-04-16 10:45:27.000000000 -0400
+++ shadow/74635.tmp.24148	2005-04-16 13:51:59.000000000 -0400
@@ -11,13 +11,13 @@
 AssignedTo: mono-bugs@ximian.com                            
 ReportedBy: vguzev@yandex.ru               
 QAContact: mono-bugs@ximian.com
 TargetMilestone: ---
 URL: 
 Cc: 
-Summary: DrawImage works too slow!
+Summary: DrawImage slow on some images
 
 Description of Problem:
 DrawImage works 15 times slower in Mono than in MS.Net even if we use 
 faster Linux machines...
 
 Steps to reproduce the problem:
@@ -107,6 +107,55 @@
 
 ------- Additional Comments From vguzev@yandex.ru  2005-04-16 10:45 -------
 Note: This falling of productivity is observed only from the second 
 file. The first file in the list is always drawn even faster than on 
 MS.Net...
 
+
+------- Additional Comments From bmaurer@users.sf.net  2005-04-16 13:51 -------
+So I tried this version:
+
+using System;
+using System.Drawing;
+
+class X {
+	static void Main ()
+	{
+		Bitmap outer_image = new Bitmap (19540, 51);
+		Graphics graphics = Graphics.FromImage (outer_image);
+		
+		for (int j = 0; j < 100; j ++) {
+			for (int i = 0; i < 3; i++) {
+				Bitmap inner_image = new Bitmap ("imagePart" + (i * 17));
+				
+				int t0 = Environment.TickCount;
+				
+				graphics.DrawImage (inner_image, 0, i * 17);
+				
+				Console.WriteLine (Environment.TickCount - t0);
+			}
+		}
+	}
+}
+
+And got:
+
+$ mono foo.exe
+35
+149
+152
+38
+148
+147
+38
+149
+149
+37
+155
+149
+...
+
+It looks like the first file is always drawn much faster. So, this
+feels like it is a cairo problem (or in something that cairo depends on)
+
+Can somebody write a C version of this just using cairo so that we can
+upstream?