Closed
Bug 1420674
Opened 7 years ago
Closed 7 years ago
Support tiling in Advanced Layers
Categories
(Core :: Graphics: Layers, enhancement)
Tracking
()
RESOLVED
FIXED
mozilla59
Tracking | Status | |
---|---|---|
firefox59 | --- | fixed |
People
(Reporter: dvander, Assigned: dvander)
Details
Attachments
(5 files)
6.32 KB,
patch
|
rhunt
:
review+
|
Details | Diff | Splinter Review |
3.50 KB,
patch
|
rhunt
:
review+
|
Details | Diff | Splinter Review |
2.13 KB,
patch
|
mattwoodrow
:
review+
|
Details | Diff | Splinter Review |
3.29 KB,
patch
|
mattwoodrow
:
review+
|
Details | Diff | Splinter Review |
9.49 KB,
patch
|
mattwoodrow
:
review+
|
Details | Diff | Splinter Review |
Advanced Layers doesn't support TiledContentHosts. This will eventually block enabling Skia (or D2D) tiling on Windows, so I'd like to get it out of the way.
Assignee | ||
Comment 1•7 years ago
|
||
PaintedLayers can either receive their textures through a ContentHostTexture or a TiledContentHost. Currently, AL assumes it will be a ContentHostTexture, so the first step is removing this assumption. TiledContentHosts can now be assigned to a PaintedLayerMLGPU, though nothing will render. Both host types have the concept of an "origin offset," though it is computed differently in the tiling case. I split that out into a separate member variable so RenderPassMLGPU doesn't have to start doing lots of casts.
Attachment #8931912 -
Flags: review?(rhunt)
Assignee | ||
Comment 2•7 years ago
|
||
Currently, AL expects one texture per layer. TiledContentHost breaks this assumption by giving each PaintedLayer a grid of textures. We already handle a similar case for ImageLayers - but tiling for those is extremely rare. AL takes a dumb approach and create a temporary one-off layer for each tile, and throws them away at the end of the frame. We don't want to do this with tiled PaintedLayers since they are much more common when tiling is enabled. The simplest approach to making this work is to simply run the same PaintedLayer through the batching algorithm, over and over once for each tile. Each time we'll change its internal state, and restore the original state after having processed all tiles. That will trick the batching process into treating each iteration as a new item. The caveat is that, when batching, we can't assume the same layer will always have the same texture. ComponentAlphaPass makes this assumption, which means if we add the same layer twice, we'll include the second one in the same batch. If the texture changed, we'll draw the wrong texture. This patch fixes ComponentAlphaPass by extracting everything out of the layer that it cares about (like opacity, sampling mode, texture pointer), and using those properties as a batching key instead. If the texture changes, we'll have to start a new batch.
Attachment #8931913 -
Flags: review?(rhunt)
Assignee | ||
Comment 3•7 years ago
|
||
Somehow I missed this during the TextureSourceProvider refactoring. TiledContentHost assumes we have a Compositor, which is not true for AL.
Attachment #8931914 -
Flags: review?(matt.woodrow)
Assignee | ||
Comment 4•7 years ago
|
||
This overrides LayerMLGPU::AssignToView, and moves ContentHost-specific stuff down. AssignToView can now peek to see if there is a TiledContentHost, and handle it accordingly. The code for that is in the next patch.
Attachment #8931916 -
Flags: review?(matt.woodrow)
Assignee | ||
Comment 5•7 years ago
|
||
This adds support for the high-res tile buffer. As noted in comment #2, each tile will overwrite the state in PaintedLayerMLGPU. After all tiles are processed, the original state is restored. This patch makes no attempt to improve batching. What we really want here is dynamic indexing which looks specific to Direct3D 12. It might be worthwhile to create a new shader for tiles, but I don't think that's worth investigating yet. Low-res tiling is slightly more complicated since the old compositor lowers their opacity and draws a background color. Probably we'll have to create a one-off ColorLayer to handle that (or create a new shader for low-res tiles). Anyway - that'll come in a separate patch, perhaps a separate bug since it's not super important.
Attachment #8931921 -
Flags: review?(matt.woodrow)
Updated•7 years ago
|
Attachment #8931914 -
Flags: review?(matt.woodrow) → review+
Updated•7 years ago
|
Attachment #8931916 -
Flags: review?(matt.woodrow) → review+
Comment 6•7 years ago
|
||
Comment on attachment 8931921 [details] [diff] [review] part 5, high res tiling support Review of attachment 8931921 [details] [diff] [review]: ----------------------------------------------------------------- ::: gfx/layers/mlgpu/PaintedLayerMLGPU.cpp @@ +103,5 @@ > RenderViewMLGPU* aView, > Maybe<Polygon>&& aGeometry) > { > if (TiledContentHost* tiles = mHost->AsTiledContentHost()) { > + // Note: we do not support the low-res buffer yet. Maybe throw in an assertion just in case someone tries to enable the low-res buffer and wants to know why it's not drawing? @@ +194,5 @@ > + mComputedOpacity = tile.GetFadeInOpacity(baseOpacity); > + mDestOrigin = offset; > + > + Maybe<Polygon> geometry = aGeometry; > + LayerMLGPU::AssignToView(aBuilder, aView, Move(geometry)); This is a bit confusing how we make repeated calls to the same function (with the same parameters) and it works. Maybe add a comment about how it uses the visible region internally, and modifying that before the call is sufficient.
Attachment #8931921 -
Flags: review?(matt.woodrow) → review+
Updated•7 years ago
|
Attachment #8931912 -
Flags: review?(rhunt) → review+
Updated•7 years ago
|
Attachment #8931913 -
Flags: review?(rhunt) → review+
Pushed by danderson@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/eeb25dc98529 Don't hardcode ContentHostTexture in PaintedLayerMLGPU. (bug 1420674 part 1, r=rhunt) https://hg.mozilla.org/integration/mozilla-inbound/rev/5af1da25ee57 Fix ComponentAlphaPass for painted layers with multiple textures. (bug 1420674 part 2, r=rhunt). https://hg.mozilla.org/integration/mozilla-inbound/rev/7f416f3bbacd Use TextureSourceProvider instead of Compositor in TiledContentHost. (bug 1420674 part 3, r=mattwoodrow) https://hg.mozilla.org/integration/mozilla-inbound/rev/22e1aa958dd2 Override PaintedLayerMLGPU::AssignToView in preparation for supporting TiledContentHost. (bug 1420674 part 4, r=mattwoodrow) https://hg.mozilla.org/integration/mozilla-inbound/rev/89e84473d524 Add high-res tiling support to Advanced Layers. (bug 1420674 part 5, r=mattwoodrow)
Comment 8•7 years ago
|
||
Backed out for Build Bustage. Backout https://hg.mozilla.org/integration/mozilla-inbound/rev/8a22c63fdb9c994b426b6a33d59bae472c14afd8 Push with failures: https://treeherder.mozilla.org/#/jobs?repo=mozilla-inbound&revision=89e84473d52444d735b552850f1143f455e48fb1 Failure log: https://treeherder.mozilla.org/logviewer.html#?job_id=148348101&repo=mozilla-inbound&lineNumber=14490
Flags: needinfo?(dvander)
Pushed by danderson@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/cf996ac2fb8f Don't hardcode ContentHostTexture in PaintedLayerMLGPU. (bug 1420674 part 1, r=rhunt) https://hg.mozilla.org/integration/mozilla-inbound/rev/a6e766e2a280 Fix ComponentAlphaPass for painted layers with multiple textures. (bug 1420674 part 2, r=rhunt). https://hg.mozilla.org/integration/mozilla-inbound/rev/5e33db544617 Use TextureSourceProvider instead of Compositor in TiledContentHost. (bug 1420674 part 3, r=mattwoodrow) https://hg.mozilla.org/integration/mozilla-inbound/rev/dddda7de674b Override PaintedLayerMLGPU::AssignToView in preparation for supporting TiledContentHost. (bug 1420674 part 4, r=mattwoodrow) https://hg.mozilla.org/integration/mozilla-inbound/rev/c20dea44664e Add high-res tiling support to Advanced Layers. (bug 1420674 part 5, r=mattwoodrow)
Comment 10•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/cf996ac2fb8f https://hg.mozilla.org/mozilla-central/rev/a6e766e2a280 https://hg.mozilla.org/mozilla-central/rev/5e33db544617 https://hg.mozilla.org/mozilla-central/rev/dddda7de674b https://hg.mozilla.org/mozilla-central/rev/c20dea44664e
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
status-firefox59:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla59
Assignee | ||
Updated•7 years ago
|
Flags: needinfo?(dvander)
You need to log in
before you can comment on or make changes to this bug.
Description
•