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

Handle subpixel viewboxes for SVG skins #594

Open
wants to merge 20 commits into
base: develop
Choose a base branch
from

Commits on Feb 21, 2024

  1. Configuration menu
    Copy the full SHA
    2727fbe View commit details
    Browse the repository at this point in the history
  2. refactor: give skins a "native" & "quad" size and center

    Skins' "native size" is the size that their bounds are supposed to be.
    Their "quad size" is the size the quadrilateral is really rendered at.
    adroitwhiz committed Feb 21, 2024
    Configuration menu
    Copy the full SHA
    a00bd79 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    826b3bd View commit details
    Browse the repository at this point in the history
  4. refactor: remove createMIP zero-size checks

    _setSubpixelViewbox ensures nonzero image dimensions at all rendered
    scales.
    adroitwhiz committed Feb 21, 2024
    Configuration menu
    Copy the full SHA
    8d024ce View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    9d3f7b7 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    6c04d8c View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    e044419 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    05c8f8a View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    5992f5c View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    b3a840f View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    3b4251b View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    d475570 View commit details
    Browse the repository at this point in the history
  13. refactor: make _calculateRotationCenter private

    ...and just return nativeRotationCenter in getSkinRotationCenter to do
    so.
    adroitwhiz committed Feb 21, 2024
    Configuration menu
    Copy the full SHA
    d0962a6 View commit details
    Browse the repository at this point in the history
  14. refactor: reflow text bubble lines non-lazily

    This was a case of premature optimization that needs to go for the next
    commit's optimization to work.
    adroitwhiz committed Feb 21, 2024
    Configuration menu
    Copy the full SHA
    d94dc1a View commit details
    Browse the repository at this point in the history
  15. perf: replace skin size getters with properties

    This is an optimization from PR scratchfoundation#470 that was taken out because of other
    unrelated changes in that PR which kept breaking things. We can put it
    back in now, and it's especially useful here to avoid going through a
    nested getter when accessing quadSize.
    adroitwhiz committed Feb 21, 2024
    Configuration menu
    Copy the full SHA
    8d427ae View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    3f3995f View commit details
    Browse the repository at this point in the history
  17. perf: optimize "logical bounds" shader calculation

    Now we only mess around with "logical bounds" in the shader if effects
    which distort the sprite are enabled. This also avoids passing the extra
    v_logicalCoord varying.
    adroitwhiz committed Feb 21, 2024
    Configuration menu
    Copy the full SHA
    9a30de3 View commit details
    Browse the repository at this point in the history
  18. refactor: move effect transform + bounds check out of getLocalPosition

    This results in a tad bit of duplicated code, but considering that we
    have 4 different code paths (colorAtNearest, colorAtLinear,
    isTouchingNearest, and isTouchingLinear) for sampling a silhouette,
    that's to be expected.
    
    This more closely matches the GPU pipeline, in which color and position
    calculations are more intertwined. This replaces the hacky fix in scratchfoundation#424
    with a solution that matches the GPU: instead of not transforming points
    outside the skin bounds, just return transparency/false early.
    adroitwhiz committed Feb 21, 2024
    Configuration menu
    Copy the full SHA
    9a9ebb2 View commit details
    Browse the repository at this point in the history
  19. perf: use _skin instead of getter in "touching" methods

    This provides a slight but noticeable performance improvement, and gains
    back some of what was lost in the previous commit.
    adroitwhiz committed Feb 21, 2024
    Configuration menu
    Copy the full SHA
    f3a6c47 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    e88fb6b View commit details
    Browse the repository at this point in the history