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 upIntroduce the DirtyRect type #3277
Conversation
|
Try push: https://treeherder.mozilla.org/#/jobs?repo=try&revision=e3bde69a576c86d71a88e80c8c77b4a295562642 I added some fixes to get wrench to build after the try push but the gecko visible parts are in there. |
|
SGTM, but I wrote most of the second commit so I'm not sure if my vote counts (signed off on the first one in the other PR) |
|
|
d220f8d
to
db20dce
|
|
|
|
|
|
c6aa2c4
to
09802fc
Use euclid 0.19.3+ exported from webrender_api. Extracted this from #3277 to make the diff less scary. Use euclid 0.19.3 and rather than manage the same dependency in both webrender and webrender_api, just publicly reexport in webrender_api. <!-- 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/3326) <!-- Reviewable:end -->
|
|
|
I'm not entirely convinced about the separate API entry points for the blobs, but I trust your judgement here:)
webrender_api/src/api.rs, line 362 at r1 (raw file):
do we need to provide the descriptor here (as opposed to use the old one)? webrender_api/src/image.rs, line 248 at r1 (raw file):
why do we still have this variant if blobs are supposed to be separate types with their own entry points for data sources? webrender_api/src/image.rs, line 387 at r1 (raw file):
can we avoid the webrender_api/src/image.rs, line 402 at r1 (raw file):
would this be cleaner with another enum variant? webrender_api/src/image.rs, line 419 at r1 (raw file):
do we need to support space transition here as well? (e.g. "U -> V") webrender_api/src/units.rs, line 128 at r1 (raw file):
is the space different because of the supposed "infinite" semantics of the blobs? |
webrender_api/src/api.rs, line 362 at r1 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
Probably not. I want to further change the blob specific APIs in followup patches, I'll look into removing this. I agree it would look cleaner at the API level. webrender_api/src/image.rs, line 248 at r1 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
Yeah we should add a different enum to store in webrender_api/src/image.rs, line 387 at r1 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
Sounds good to me. webrender_api/src/image.rs, line 402 at r1 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
We need to support this representation of empty dirty rects anyway (it'll come up after intersections etc), so I think it's simpler to keep it like that than have either two representations for empty rects or the need to canonicalize after each modification that could lead to an empty rect. webrender_api/src/image.rs, line 419 at r1 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
I like the idea, I'll have a look. webrender_api/src/units.rs, line 128 at r1 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
Yeah-ish. The dirty rect for blobs is expressed in the same space as the blob's drawing commands which until now sort of matched a sort of translated device space (in part due to how we fit the blob API in the general image API), but I would like to make sure we always consider device space as local to a single rectangle of pixels (an image or a tile), rather than use it for sparse things like tiled blobs. Separating the two here will hopefully help us avoid trying to mix the blob's layout dirty rect with the other dirty rects in the resource cache which are local to their texture cache entries. |
|
New try push with the latest changes https://treeherder.mozilla.org/#/jobs?repo=try&revision=7cb783f2236407d35ca7d4b1e23f33c542c775ef |
webrender_api/src/image.rs, line 402 at r1 (raw file): Previously, nical (Nicolas Silva) wrote…
I think when intersections are happening, we don't get the empty rect directly anyway. There is code that does a webrender_api/src/image.rs, line 419 at r1 (raw file): Previously, nical (Nicolas Silva) wrote…
figured it's not worth it for now? |
|
There are R5 failures in the try. |
These are fuzzable and appeared after I rebased the webrender parts so I suspect they come from another commit that doesn't have the corresponding gecko change in the push. There is also an unexpected pas that I can't take credit for. |
|
|
Before this PR each tile stores its own dirty rect relative to the entire image. This is somewhat confusing because this field is used to track partial uploads correctly and uploads reason about dirty rects relative to the tiles so it has to do some conversions. Storing relative to the tile is also truer to the "device space" the rects are tagged with. Last but not least the image-relative coordinates will make even less sense for tiled blob images as we start trating them as virtually infinite planes.
Previously dirty rects were set up in a subtle way where early in the pipeline None is used to mean "no information" and therefore "all clean", but then later on is used to mean "all dirty" on the assumption that if a texture is still being handled, some dirty information must have been sent. None is therefore used by the internals as a way to signal things like missing cache entries without actually bothering to look up the dimensions of the image (note that "clean" can always be expressed without knowing dimensions, as it is always the same empty rect). I change the system to just consistently use a custom enum that has AllDirty and SomeDirty(empty_rect) to represent these two states. As a result the code seems much easier to understand.
Blobs will need some extra APIs that don't apply to regular images. This change will make it easier to add these extra functionalities without messing with the rest of the code. The new BlobImageKey type also adds a tiny bit of type safety to prevent some mixing blob and non blob data on the same image which is invalid.
…ce cache.
|
@bors-servo r=kvark |
|
|
Introduce the DirtyRect type This is Alexis' [DirtyRect patch](https://phabricator.services.mozilla.com/D9559) completed and rebased on top of #3272. It turns `Option<Rect>` into an explicit type which is a lot easier to understand as `None` previously meant different things in different areas of the code. <!-- 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/3277) <!-- Reviewable:end -->
|
|
…9a33e6acd35d (WR PR #3277). r=kats servo/webrender#3277 Differential Revision: https://phabricator.services.mozilla.com/D12809 --HG-- extra : moz-landing-system : lando
…9a33e6acd35d (WR PR #3277). r=kats servo/webrender#3277 Differential Revision: https://phabricator.services.mozilla.com/D12809
Fix panic when updating a non-tiled "multi" image cache entry. In #3277 I introduced the expectation that if a cached image entry is `ImageResult::Multi(..)` then it must be tiled and we can `unwrap` an optional tiling related variable. It turns out (from [bug 1509643](https://bugzilla.mozilla.org/show_bug.cgi?id=1509643)) that this assumption doesn't always hold true. This change restores the previous behavior and also invalidates the entire entry if it is tiled but we don't have information about the tile size. I don't know for sure whether this case can happen in practice but I'd rather be conservative about it since invalidation bugs tend to be hard to track down. <!-- 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/3354) <!-- Reviewable:end -->
…9a33e6acd35d (WR PR #3277). r=kats servo/webrender#3277 Differential Revision: https://phabricator.services.mozilla.com/D12809 UltraBlame original commit: 6d9d2397f1153e5e9062f342015f28ca3576bfee
…9a33e6acd35d (WR PR #3277). r=kats servo/webrender#3277 Differential Revision: https://phabricator.services.mozilla.com/D12809 UltraBlame original commit: 6d9d2397f1153e5e9062f342015f28ca3576bfee
…9a33e6acd35d (WR PR #3277). r=kats servo/webrender#3277 Differential Revision: https://phabricator.services.mozilla.com/D12809 UltraBlame original commit: 6d9d2397f1153e5e9062f342015f28ca3576bfee
nical commentedNov 6, 2018
•
edited by larsbergstrom
This is Alexis' DirtyRect patch completed and rebased on top of #3272.
It turns
Option<Rect>into an explicit type which is a lot easier to understand asNonepreviously meant different things in different areas of the code.This change is