Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FPS Drop #11

Open
multybuq opened this issue Nov 6, 2018 · 6 comments
Open

FPS Drop #11

multybuq opened this issue Nov 6, 2018 · 6 comments

Comments

@multybuq
Copy link

multybuq commented Nov 6, 2018

Hello! I faced FPS drop on the draw() method, if a lot of lines will be in the drawing bounds. Any ideas about it?

@LinusGeffarth
Copy link
Collaborator

LinusGeffarth commented Nov 6, 2018

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.

@multybuq
Copy link
Author

multybuq commented Nov 6, 2018

@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.

@LinusGeffarth
Copy link
Collaborator

Hmmm I'm sure we'll find a way.
I appreciate your support & efforts!

@lucashoeft
Copy link

Are those FPS drops only on the iOS Simulator or on a real iPad as well?

@LinusGeffarth
Copy link
Collaborator

Real device. I haven't tested on the Simulator actually @lucashoeft

@dulanyconsulting
Copy link

dulanyconsulting commented Nov 15, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants