Allow reftests to test whether an element is part of an opaque layer, and whether two elements share the same layer

RESOLVED FIXED in Firefox 39

Status

()

Core
Layout
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: mstange, Assigned: mstange)

Tracking

Trunk
mozilla39
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(firefox39 fixed)

Details

MozReview Requests

()

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

3 years ago
I'd like to make changes to the way we split and merge layers in the face of different animated geometry roots that interleave the display items in z-order, and to the way we decide to pull up opaque background colors when there are differing animated geometry roots.
However, at the moment I can't really test the things I'd like to guarantee. There are three objectives to optimize for:
 - Splitting layers has the goal of avoiding invalidations during animations (e.g. scrolling), regardless of whether those animations are async or driven from the main thread.
 - Merging layers has the goal of reducing memory consumption and overdraw.
 - Pulling opaque background colors into layers has the goal of making layers opaque, which makes them more efficient to draw and means they don't need component alpha.

At the moment, only the first goal is testable by reftests. For example, nothing will fail if we start putting every display item into its own layer (except for fuzzable differences in blending, maybe).
(Assignee)

Comment 1

3 years ago
Created attachment 8576188 [details]
MozReview Request: bz://1142211/mstange

/r/5203 - Bug 1142211 - Add layerization testing mechanisms to reftest. r=roc

Pull down this commit:

hg pull review -r 6e8413934bdcd7680566b2cfedf6606022e352c4
Attachment #8576188 - Flags: review?(roc)
(Assignee)

Comment 2

3 years ago
This patch adds support to the reftest framework for testing the other two goals: You can set class="reftest-opaque-layer" on elements that should be part of an opaque PaintedLayer, and you can set reftest-assigned-layer="page-background" on two elements that should end up in the same PaintedLayer.
The patch also adds support for testing whether elements are assigned to different PaintedLayers, if those elements have different reftest-assigned-layer values, but only because it's a natural extension of the same-layer test method. I don't think we should make much use of that capability - the point of splitting stuff into different layers is to avoid invalidation, so we should be using class="reftest-no-paint" to test for those invalidations instead.
Comment on attachment 8576188 [details]
MozReview Request: bz://1142211/mstange

https://reviewboard.mozilla.org/r/5201/#review4237

Great stuff!

::: layout/base/FrameLayerBuilder.cpp
(Diff revision 1)
> +/* static */ Layer*
> +FrameLayerBuilder::GetDebugSingleOldLayerForFrame(nsIFrame* aFrame)
> +{
> +  nsTArray<DisplayItemData*> *array =
> +    reinterpret_cast<nsTArray<DisplayItemData*>*>(aFrame->Properties().Get(LayerManagerDataProperty()));
> +
> +  if (!array) {
> +    return nullptr;
> +  }
> +
> +  Layer* layer = nullptr;
> +  for (DisplayItemData *data : *array) {
> +    if (layer && layer != data->mLayer) {
> +      // More than one layer assigned, bail.
> +      return nullptr;
> +    }
> +    layer = data->mLayer;
> +  }
> +  return layer;
> +}
> +

Great stuff!

::: layout/base/FrameLayerBuilder.cpp
(Diff revision 1)
> +  nsTArray<DisplayItemData*> *array =

nsTArray<DisplayItemData\*>\* array

::: layout/base/FrameLayerBuilder.cpp
(Diff revision 1)
> +  for (DisplayItemData *data : *array) {

DisplayItemData\* data : \*array
Attachment #8576188 - Flags: review?(roc)
https://hg.mozilla.org/mozilla-central/rev/9b17a03fe1b5
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
status-firefox39: --- → fixed
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla39
(Assignee)

Comment 8

3 years ago
Comment on attachment 8576188 [details]
MozReview Request: bz://1142211/mstange
Attachment #8576188 - Attachment is obsolete: true
Attachment #8619733 - Flags: review+
(Assignee)

Comment 9

3 years ago
Created attachment 8619733 [details]
MozReview Request: Bug 1142211 - Add layerization testing mechanisms to reftest. r=roc
You need to log in before you can comment on or make changes to this bug.