Closed Bug 1318156 Opened 3 years ago Closed 3 years ago

Build more separate layers when we force active layers

Categories

(Core :: Layout, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla53
Tracking Status
firefox53 --- fixed

People

(Reporter: mattwoodrow, Assigned: mattwoodrow)

Details

Attachments

(4 files)

No description provided.
Comment on attachment 8811519 [details] [diff] [review]
Convert background colors into layers if we're forcing active layers

Review of attachment 8811519 [details] [diff] [review]:
-----------------------------------------------------------------

::: layout/base/nsDisplayList.cpp
@@ +3581,5 @@
> +
> +  int32_t appUnitsPerDevPixel = mFrame->PresContext()->AppUnitsPerDevPixel();
> +  layer->SetBounds(mBackgroundRect.ToNearestPixels(appUnitsPerDevPixel));
> +  layer->SetBaseTransform(gfx::Matrix4x4::Translation(aContainerParameters.mOffset.x,
> +                                                      aContainerParameters.mOffset.y, 0));

Same question about mXScale/mYScale as in the other bug

::: layout/generic/nsCanvasFrame.cpp
@@ +272,5 @@
> +  RefPtr<ColorLayer> layer = static_cast<ColorLayer*>
> +    (aManager->GetLayerBuilder()->GetLeafLayerFor(aBuilder, this));
> +  if (!layer) {
> +    layer = aManager->CreateColorLayer();
> +    if (!layer)

braces please

@@ +285,5 @@
> +  int32_t appUnitsPerDevPixel = mFrame->PresContext()->AppUnitsPerDevPixel();
> +
> +  layer->SetBounds(bgClipRect.ToNearestPixels(appUnitsPerDevPixel));
> +  layer->SetBaseTransform(gfx::Matrix4x4::Translation(aContainerParameters.mOffset.x,
> +                                                      aContainerParameters.mOffset.y, 0));

mXScale / mYScale here too, if needed
Attachment #8811519 - Flags: review?(mstange) → review+
Comment on attachment 8811520 [details] [diff] [review]
Convert images into layers if we're forcing active layers

Review of attachment 8811520 [details] [diff] [review]:
-----------------------------------------------------------------

mozreview would have made reviewing this patch much easier.
Attachment #8811520 - Flags: review?(mstange) → review+
Comment on attachment 8811521 [details] [diff] [review]
Add an option to minimize empty area in PaintedLayers

Review of attachment 8811521 [details] [diff] [review]:
-----------------------------------------------------------------

This can result in splitting a layer into overlapping layers if the old code would have merged them into one layer, but it's worth a try.
(Example: three rectangles with these [x, xmost] coordinates: [3, 5], [0, 2], [1, 4])

Bug 1169502 might have better results, it's currently blocked by bug 1262969.
Attachment #8811521 - Flags: review?(mstange) → review+
Comment on attachment 8811522 [details] [diff] [review]
Don't build nsDisplayTableFrame if it won't paint anything

Review of attachment 8811522 [details] [diff] [review]:
-----------------------------------------------------------------

ok
Attachment #8811522 - Flags: review?(mstange) → review+
(In reply to Markus Stange [:mstange] from comment #7)
> Comment on attachment 8811521 [details] [diff] [review]
> Add an option to minimize empty area in PaintedLayers
> 
> Review of attachment 8811521 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> This can result in splitting a layer into overlapping layers if the old code
> would have merged them into one layer, but it's worth a try.
> (Example: three rectangles with these [x, xmost] coordinates: [3, 5], [0,
> 2], [1, 4])
> 
> Bug 1169502 might have better results, it's currently blocked by bug 1262969.

Yeah, this was more just an experimental pref so we can play with the different behaviours and see how they affect various pages.

We probably want something smarter for the final revision, but I figured this was simple enough that we could land it for now.
Pushed by mwoodrow@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/c92c581e9de3
Convert background colors into layers if we're forcing active layers. r=mstange
https://hg.mozilla.org/integration/mozilla-inbound/rev/426dd5fc9e8a
Add an option to minimize empty area in PaintedLayers. r=mstange
https://hg.mozilla.org/integration/mozilla-inbound/rev/d62a25f54253
Convert images into layers if we're forcing active layers. r=mstange
https://hg.mozilla.org/integration/mozilla-inbound/rev/227cafa30abc
Don't build nsDisplayTableFrame if it won't paint anything. r=mstange
You need to log in before you can comment on or make changes to this bug.