Pmovil / CN1WindowsPort

Windows RT port to Codename One
MIT License
6 stars 3 forks source link

Master #7

Closed PiotrZub closed 9 years ago

PiotrZub commented 9 years ago

Image bug fix, acceleration (x20), alpha premultiply drawing. Now my app main canvas start working and draw speed is like on iOS :)

FabricioCabeca commented 9 years ago

Great ! I did optimize array copy under System.arraycopy but forgot to use array copy at some places in the implementation.

About Block copy, isn't it safer to use System.Array.Copy ? Performance should be almost the same

PiotrZub commented 9 years ago

We couldn't use Array Copy because of different type of elements (byte/integer). I think in this case there is no risk of using Block copy because every thing is quit simply and enclosed in one function.

FabricioCabeca commented 9 years ago

You're right, Array Copy needs same type and I don't think Block Copy should be a problem here either.

btw, your patch fixed some graphics issues but introduced others too, translucent image borders are not ok, I will see if I can fix it. Also we will soon push some file access fixes that improved things a lot here too ;)

PiotrZub commented 9 years ago

In translucent fix I assume that all CN1 image colour channels is not premultiplied, I think it should be true, but maybe later to fix premultiply bug you change images to get prober translucent?

FabioConceicao commented 9 years ago

Just noticed that both cn1 and win2d uses straight alpha as default (win2d converts to premultiplied internally, so there shouldn't be a need to convert it outside). We also noticed that removing the premultiply fixed the translucent border bug, so we are removing this one. The rest seems ok to keep and fixed an annoying bug we had with masks here ;)

FabioConceicao commented 9 years ago

And just noticed mutable images should be premultiplied, pushing new commit to consider both cases.