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 upPort normal (css) style borders to be interned primitives. #3342
Conversation
|
r? anyone Try run looks good (sans seemingly unrelated intermittents): |
|
Added a follow up commit that also ports image borders to be interned. New pending try: |
|
Some of these changes are quite messy, with duplicated code in places. This could definitely do with a tidy / clean up pass once all the primitive types are ported and we remove the BrushPrimitive type. |
|
|
|
Squashed and rebased on the picture caching commit. Try run looks good, I think. There are a couple of crash test failures (with known intermittents), and a border failure in R1 on OSX. The border failure seems to be text related, I think it's probably due to one of the other recent commits in master? |
|
webrender/src/border.rs, line 107 at r1 (raw file):
if it matches webrender/src/display_list_flattener.rs, line 1792 at r1 (raw file):
we might as well just keep a webrender/src/prim_store.rs, line 351 at r1 (raw file):
Now that I'm looking at it, why does primitive key kind have a list of glyph instances? Esp since PrimitiveContainer has that list as well webrender/src/prim_store.rs, line 372 at r1 (raw file):
any reason this isn't some webrender/src/prim_store.rs, line 475 at r1 (raw file):
does this need to be a box? webrender/src/prim_store.rs, line 850 at r1 (raw file):
I don't know if this is required here, but I'm happy to see more stuff being serialized. Just gives us a better chance of looking at the captures later down the road ;) webrender/src/prim_store.rs, line 1718 at r1 (raw file):
if we put those fields into a (generic) structure, we can re-use it in webrender/src/prim_store.rs, line 2114 at r1 (raw file):
let's keep a good tradition of documenting things :) webrender/src/prim_store.rs, line 2945 at r1 (raw file):
redundant webrender/src/prim_store.rs, line 2973 at r1 (raw file):
looks like we could have a similar scheme here as we do for GPU cache - some sort of accessor temporary that allows writing directly to the storage, instead of collecting into a webrender/src/prim_store.rs, line 2978 at r1 (raw file):
nothing to do here? webrender/src/storage.rs, line 81 at r1 (raw file):
we need to add an webrender_api/src/units.rs, line 227 at r1 (raw file):
I noticed that there is a few places where we are manually converting some XxxSideoffsets between Au and what not. |
This is mostly a straightforward conversion of borders to make use of primitive interning. It also adds support during batching and clip task creation for interned primitives that make use of segments. This is needed for porting the rest of the primitives, and should make the conversion of the other primitive types simple.
webrender/src/border.rs, line 107 at r1 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
After some discussions with Matt and Dan regarding the cost we're seeing in profiles of the Au <-> f32 rounding conversions, we're planning to switch to hashing floats. This should be fine since Gecko already quantizes the native data in Au first anyway. Once we do that, this struct distinction will disappear. webrender/src/display_list_flattener.rs, line 1792 at r1 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
I figured I'd leave the existing brush code as similar as possible - the segmenting on those remaining primitives is minimal. Later this week, all of those primitives will be switched to using the prim storage. webrender/src/prim_store.rs, line 351 at r1 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
Because we want to uniquely identify a text run so we need to has the contents. This is also what the glyph instances in the primitive template are derived from. webrender/src/prim_store.rs, line 372 at r1 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
Only because it's a direct port from the existing primitive code :) webrender/src/prim_store.rs, line 475 at r1 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
Yep - the size of this structure is very sensitive on some of the talos tests. We're investigating some other options, such as keeping these in separate interners per-prim-type, so I consider Box<> here a temporary solution. webrender/src/prim_store.rs, line 850 at r1 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
Yup, it's required - border segments are now calculated only once when a new border is interned during scene building, rather than once each new scene in the frame builder. webrender/src/prim_store.rs, line 1718 at r1 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
Yep, that makes sense - I'll add it to my notes for cleaning this stuff up. webrender/src/prim_store.rs, line 2114 at r1 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
Done webrender/src/prim_store.rs, line 2945 at r1 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
Indeed, fixed! webrender/src/prim_store.rs, line 2973 at r1 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
That's a good idea, seems like it'd be useful in multiple places. webrender/src/prim_store.rs, line 2978 at r1 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
No, these primitives only update in their template, the instances don't need to do anything. webrender/src/storage.rs, line 81 at r1 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
I agree, this sounds good. webrender_api/src/units.rs, line 227 at r1 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
Yep, although probably not necessary if we go with the float hashing mentioned above. |
|
@kvark Thanks for the review! I think I answered / addressed all the comments. Going to merge now as you mentioned there's no blockers, and I want to avoid rebasing it too often. Please just comment here if there's further follow ups based on those review comments. @bors-servo r=kvark |
|
|
Port normal (css) style borders to be interned primitives. This is mostly a straightforward conversion of normal borders to make use of primitive interning. It also adds support during batching and clip task creation for interned primitives that make use of segments. This is needed for porting the rest of the primitives, and should make the conversion of the other primitive types simple. <!-- 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/3342) <!-- Reviewable:end -->
|
|
…a9bd159ab398 (WR PR #3342). r=kats servo/webrender#3342 Differential Revision: https://phabricator.services.mozilla.com/D13023 --HG-- extra : moz-landing-system : lando
…a9bd159ab398 (WR PR #3342). r=kats servo/webrender#3342 Differential Revision: https://phabricator.services.mozilla.com/D13023 UltraBlame original commit: be07c850ed1562add8526b5c1e06463cbd758b68
…a9bd159ab398 (WR PR #3342). r=kats servo/webrender#3342 Differential Revision: https://phabricator.services.mozilla.com/D13023 UltraBlame original commit: be07c850ed1562add8526b5c1e06463cbd758b68
…a9bd159ab398 (WR PR #3342). r=kats servo/webrender#3342 Differential Revision: https://phabricator.services.mozilla.com/D13023 UltraBlame original commit: be07c850ed1562add8526b5c1e06463cbd758b68
gw3583 commentedNov 23, 2018
•
edited by larsbergstrom
This is mostly a straightforward conversion of normal borders
to make use of primitive interning.
It also adds support during batching and clip task creation for
interned primitives that make use of segments. This is needed
for porting the rest of the primitives, and should make the
conversion of the other primitive types simple.
This change is