mono / xwt

A cross-platform UI toolkit for creating desktop applications with .NET and Mono
MIT License
1.36k stars 241 forks source link

[Cocoa] Xwt.Drawing.BitmapImage.setPixel runs slow #509

Open milesflavel opened 9 years ago

milesflavel commented 9 years ago

Hi,

I've noticed while developing a cross-platform program that the Xwt.Drawing.BitmapImage.setPixel method runs considerably slower under the Cocoa toolkit. I'm developing this on a recent Macbook Pro and did a comparison of my code under both the Cocoa and Gtk toolkits.

Cocoa (seconds): 00:00:00.0000320 00:00:00.0000270 00:00:00.0000400 00:00:00.0000300

Gtk (seconds): 00:00:00 00:00:00.0000010 00:00:00 00:00:00.0000010

As you can see, the Gtk backend runs this function so fast that it barely even registers a time. Luckily I will still be able to continue development but I'd love to take full advantage of each platform.

Therzok commented 9 years ago

One difference may be that the Mac handler tries all representations, while the Gtk one only sets it to the first frame.