Closed PiotrZub closed 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
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.
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 ;)
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?
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 ;)
And just noticed mutable images should be premultiplied, pushing new commit to consider both cases.
Image bug fix, acceleration (x20), alpha premultiply drawing. Now my app main canvas start working and draw speed is like on iOS :)