Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upDon't panic when rendering huge border corners #2916
Merged
Conversation
|
With this, gecko can survive the crashtest from bug 1474885. Fixes #2884. |
webrender/src/border.rs
Outdated
| // No point in pushing more clips as it will blow up the maximum amount of | ||
| // segments per primitive later down the road. | ||
| // See #2915 for a better fix. | ||
| let max_clip_count = self.max_clip_count.min(512); |
This comment has been minimized.
This comment has been minimized.
kvark
Jul 19, 2018
Member
nit: should be computed from constants, e.g. MAX_VERTEX_TEXTURE_WIDTH divided by the blocks per segment
webrender/src/border.rs
Outdated
| // the value must be chosen so that the corners will not use an | ||
| // unreasonable amount of memory but should allow crips corners in the | ||
| // common cases. | ||
| LayoutToDeviceScale::new(2048.0 / r) |
This comment has been minimized.
This comment has been minimized.
|
@bors-servo r+ |
|
|
bors-servo
added a commit
that referenced
this pull request
Jul 30, 2018
Don't panic when rendering huge border corners This is a simple workaround for huge border corners which currently try to allocate very large surfaces to render the mask. The basic idea is to render them at a lower resolution (the maximum resolution being 2048x2048 device pixels per corner) and let the brush stretch them. As a result huge corners (with a radius bigger than 2048 device pixels) can render blurry, however we don't crash anymore and the code is very simple. I toyed with rendering only the visible portion of the corner without down scaling, but it required adding a lot of code for a use case that I think isn't worth the maintenance cost in my opinion. The patch also sets a limit on the number of dots/dashes so that we don't hit the maximum number of segments per primitive. This isn't great but fixing it properly isn't our highest priority. I filed #2915. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/webrender/2916) <!-- Reviewable:end -->
|
|
This was referenced Aug 8, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
nical commentedJul 19, 2018
•
edited
This is a simple workaround for huge border corners which currently try to allocate very large surfaces to render the mask.
The basic idea is to render them at a lower resolution (the maximum resolution being 2048x2048 device pixels per corner) and let the brush stretch them. As a result huge corners (with a radius bigger than 2048 device pixels) can render blurry, however we don't crash anymore and the code is very simple.
I toyed with rendering only the visible portion of the corner without down scaling, but it required adding a lot of code for a use case that I think isn't worth the maintenance cost in my opinion.
The patch also sets a limit on the number of dots/dashes so that we don't hit the maximum number of segments per primitive. This isn't great but fixing it properly isn't our highest priority. I filed #2915.
This change is