SwiftyDraw
SwiftyDraw copied to clipboard
FPS Drop
Hello! I faced FPS drop on the draw() method, if a lot of lines will be in the drawing bounds. Any ideas about it?
Hi @multybuq
I have already seen the issue you're talking about. I'm currently not sure how to resolve the issue.
I believe it occurs because we're redrawing all lines in draw(_:)
.
Maybe we can introduce a property to Line
that determines whether this line needs to be drawn again...
I'll let you know about updates.
@LinusGeffarth, thanks for fast reply.
BTW, I tried this possibility, this way it will wipe out all the lines inside the overdrawing rect. Overdrawing view's bound is taking even more resources.
The possible solution I see, is to render all the lines to an image at the touchesEnded() function and place it below the view. But this will break erase function.
The other possible solution I see, is to render all the lines to an image and render part of this image equal to rect parameter of draw() function. I didn't achieve this yet, I will update you, if succeeded.
Hmmm I'm sure we'll find a way. I appreciate your support & efforts!
Are those FPS drops only on the iOS Simulator or on a real iPad as well?
Real device. I haven't tested on the Simulator actually @lucashoeft
Hey there friends - I am using SwiftyDraw (really cool) in an iOS app and am seeing this issue still - was there ever a solution to this issue? On my app, if there are complex lines, I can draw others, but it takes forever before I can actually start to draw.
EDIT: The version I am using is older / severely modified from what I think the original is - I am not sure this is still an issue.
Pete