Active layers should not snap to being pixel aligned with their container layer when compositing

NEW
Unassigned

Status

()

6 years ago
5 years ago

People

(Reporter: jwatt, Unassigned)

Tracking

(Blocks: 1 bug)

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

6 years ago
Created attachment 743556 [details]
testcase (clicking toggles between a translation of 0.49/0.5)

Even now that bug 861805 (stop layers from snapping transforms for SVG content) has been fixed, it appears that when we composite active layers we composite them snapped to be pixel aligned with the layer they're being composited into.

This testcase toggles the transform between a translation of 0.49 and 0.5 when clicked. Clicking shifts the box left/right by a full pixel, until the active layer times out (a half second or so after clicking) and it becomes an inactive layer. Only once the layer becomes inactive does the box paint correctly at the 0.49/0.5 offset with antialiasing/resampling rather than snapped. Note that there's also a white rect in the transformed <g> to make sure the layer is much larger than the box (a stroked rect), so this is not due to fringe effects at the edges of the layer.

In the active layer cases I get the following for the 0.49 translation:

OGLContainerLayer (0x110844c00) [clip=(x=0, y=28, w=610, h=382)]
                                [transform=[ 1 0; 0 1; 0.49 28; ]]
                                [visible=< (x=0, y=0, w=59, h=59); >]
  OGLThebesLayer (0x110845400) [visible=< (x=0, y=0, w=59, h=59); >]
                               [isFixedPosition]
                               [valid=< (x=0, y=0, w=59, h=59); >]

And the following for the 0.5 translation (only the 0.5 vs 0.49 is different):

OGLContainerLayer (0x110845400) [clip=(x=0, y=28, w=610, h=382)]
                                [transform=[ 1 0; 0 1; 0.5 28; ]]
                                [visible=< (x=0, y=0, w=59, h=59); >]
  OGLThebesLayer (0x110842800) [visible=< (x=0, y=0, w=59, h=59); >]
                               [isFixedPosition]
                               [valid=< (x=0, y=0, w=59, h=59); >]

If I set layers.acceleration.disabled to true and restart, I get the same buggy behavior and:

  BasicContainerLayer (0x11101fc00) [clip=(x=0, y=28, w=610, h=382)]
                                    [transform=[ 1 0; 0 1; 0.49 28; ]]
                                    [visible=< (x=0, y=0, w=59, h=59); >]
    BasicThebesLayer (0x113ece400) [visible=< (x=0, y=0, w=59, h=59); >]
                                   [isFixedPosition]
                                   [valid=< (x=0, y=0, w=64, h=59); >]

vs.

  BasicContainerLayer (0x11101fc00) [clip=(x=0, y=28, w=610, h=382)]
                                    [transform=[ 1 0; 0 1; 0.5 28; ]]
                                    [visible=< (x=0, y=0, w=59, h=59); >]
    BasicThebesLayer (0x113ece400) [visible=< (x=0, y=0, w=59, h=59); >]
                                   [isFixedPosition]
                                   [valid=< (x=0, y=0, w=64, h=59); >]

(In this case the valid= line has a slightly larger w= value on the BasicThebesLayer than there was on the OGLThebesLayer, but that doesn't seem to change the behavior.)

So it looks like the layers are being created with the correct transforms (not snapped) and correct visible regions. So I'm not sure quite why they would snap when compositing.
(Reporter)

Comment 1

6 years ago
Oops, forgot to change the summary when cloning.
Summary: Layer edges sometimes "clipping" 1px off content after switching SVG to use active layers → Active layers should not snap to being pixel aligned with their container layer when compositing
Layer compositing typically doesn't do antialiasing. Texture coordinates get clamped to the layer boundary. Could that be the problem?
(Reporter)

Updated

6 years ago
Blocks: 867599
You need to log in before you can comment on or make changes to this bug.