Closed eveliotc closed 10 years ago
Hey
Yes I know the linear gradient thing was going to be an issue at some point. I didn't think of LRU caching, nice one.
Thanks for your comments I'll work on that asap.
@eveliotc regarding the LRU cache,
LruCache
for a View itself. I guess it should be external and shared between the different views.Actually I have a better idea. I can reproduce this effect with a single shader
@RomainPiel yeah they are immutable; as I remember you can't translate/zoom the canvas as they are anchored to the window but they do have a local Matrix
you could try modifying it (resize and translate)
Pretty sure someone will go crazy and use it in an AdapterView
then complain about jank
Yep I just got it working with a single linear gradient and playing with the local matrix. I'm cleaning it up and will submit an update later on.
:+1:
fixed in version 1.1.0
Just my ¢2
new
in your draw methods, you'd get a bunch of jank as they are called often specially on animation, and currently there are three of them atLinearGradientFactory#resize
method, given that Shaders are immutable, would you consider using a LRU cache?onAnimationEnd
consider usingpostInvalidateOnAnimation
instead ofpostInvalidate