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

Optimize drawing: Merge layers to reduce memory usage #215

Closed
herzbube opened this issue Jun 20, 2014 · 2 comments

Comments

Projects
None yet
1 participant
@herzbube
Copy link
Owner

commented Jun 20, 2014

With tiling implemented, the main consumer of memory are the large number of layers. One way to help is to merge two or more layers into a single layer.

Two layers that can almost certainly be merged are the grid line layer and the star point layer. These draw static board features that never change unless the user starts a new game with a different board size.

@herzbube herzbube added this to the 1.1.0 milestone Jun 20, 2014

@herzbube herzbube self-assigned this Jun 20, 2014

@herzbube

This comment has been minimized.

Copy link
Owner Author

commented Jun 21, 2014

The two cross-hair layers cannot be merged with each other because

  • The cross-hair lines must be drawn below the regular stones
  • The cross-hair stone must be drawn above the regular stones

Instead, an attempt should be made to

  • Merge the cross-hair lines layer with the grid layer. This might be difficult because the grid layer also draws star points.
  • Merge the cross-hair stone layer with the regular stone layer. This should be fairly straightforward since the regular stone layer already draws stones only. The only new thing then is to take the new color into account.

Before committing this, a performance measurement should be made using the Core Animation instrument.

@herzbube

This comment has been minimized.

Copy link
Owner Author

commented Jul 11, 2014

Merging cross-hair lines layer with the grid layer currently is too much work. Closing the issue for the moment.

@herzbube herzbube closed this Jul 11, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.