Skip to content

Fix rendering of web Rect with large corner radius - #13649

Merged
ianthomas23 merged 1 commit into
branch-3.4from
ianthomas23/13648_webgl_rect_large_corner
Jan 17, 2024
Merged

Fix rendering of web Rect with large corner radius#13649
ianthomas23 merged 1 commit into
branch-3.4from
ianthomas23/13648_webgl_rect_large_corner

Conversation

@ianthomas23

Copy link
Copy Markdown
Member

This fixes the rendering of WebGL Rect glyphs with large corner radii. Here is the Glyph_models__should_support_Rect_with_large_rounded_corners_that_need_scaling.png baseline test image before and after:

before

after

There isn't a simple Python reproducer until #13637 is fixed.

Code changes are all in the shaders. Previously we were only considering the distance to the nearest Rect corner so we only looked at the local x,y quadrant. This isn't sufficient and we have to look at all 4 corners to support large radii. This changes the logic of the fragment shader, necessarily making it more complicated. I have also moved the calculation to limit the corner radii to the vertex shader so that it only needs to be calculated 4 times (one per rect vertex) rather than once per pixel rendered, and written it in a more condensed and faster form.

@codecov

codecov Bot commented Jan 17, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (59751d9) 92.56% compared to head (2633d11) 92.56%.

Additional details and impacted files
@@             Coverage Diff             @@
##           branch-3.4   #13649   +/-   ##
===========================================
  Coverage       92.56%   92.56%           
===========================================
  Files             323      323           
  Lines           20509    20509           
===========================================
  Hits            18985    18985           
  Misses           1524     1524           

@mattpap mattpap added this to the 3.4 milestone Jan 17, 2024
@github-actions

Copy link
Copy Markdown

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Oct 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] WebGL Rect with large corner radius rendered incorrectly

2 participants