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 upSupport snapping on clip masks, and fast path rectangle + clip out mode. #2618
Conversation
|
This supersedes #2608 (it includes that commit). This PR achieves two things:
This allows primitives that only contain clip rects to avoid generating Try run: Of the relevant reftest differences: R4 - 1 new PASS r? @mrobinson or @kvark |
|
Reviewed 13 of 13 files at r1. webrender/res/clip_shared.glsl, line 85 at r1 (raw file):
I don't understand this part. When we snap, we want the final VS results to be snapped. But this code uses the pre-snapped device pos webrender/src/prim_store.rs, line 1576 at r1 (raw file):
why are we segmenting a small but rect-only primitive? Comments from Reviewable |
|
Review status: all files reviewed at latest revision, 2 unresolved discussions. webrender/res/clip_shared.glsl, line 85 at r1 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
Because in the clip shaders, the vertices are the flat coordinates of the corners of the 2d bounding rect of the clip task. So I don't see how / why we'd be able to apply snapping here? What this PR does is keep the original vertex positions the same as the task rect, but adjust the interpolants for the local position at each corner vertex such that the snapping is accounted for. At least, that's the intent :) Does that sound reasonable? webrender/src/prim_store.rs, line 1576 at r1 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
Because rect only primitives can be efficiently segmented into CPU regions and thus completely avoid any clip-mask at all. For example, I intend to draw simple borders as a rectangle with a clip + clip-out rectangle (got a local patch nearly ready for this). This means that for the most common border types we don't invoke the border shader at all, and don't allocate / render any clip masks in the case of no rounded corners. Comments from Reviewable |
|
|
|
Rebased. |
|
Reviewed 4 of 4 files at r2. Comments from Reviewable |
|
Thank you! |
|
|
Support snapping on clip masks, and fast path rectangle + clip out mode. <!-- 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/2618) <!-- Reviewable:end -->
|
|
glennw commentedApr 5, 2018
•
edited by larsbergstrom
This change is