Open Bug 867103 Opened 11 years ago Updated 10 months ago

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

Categories

(Core :: Graphics: Layers, defect)

defect

Tracking

()

People

(Reporter: jwatt, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

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.
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?
Blocks: 867599
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: