Closed Bug 1564655 Opened 5 years ago Closed 5 years ago

blob: Make the recording use absolute coordinates

Categories

(Core :: Graphics: WebRender, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla70
Tracking Status
firefox70 --- fixed

People

(Reporter: jrmuizel, Assigned: jrmuizel)

References

Details

Attachments

(1 file)

Currently items are painted with a context that has a transform of -TopLeft(). This means that if TopLeft() changes the commands will be in the wrong place because the -TopLeft() offset is baked into the recording.

I don't think we've ever needed to support painting without this transformed baked in so there were some infrastructure changes that needed to be made to make this possible. Most of the problems come from the use of gfxContext::GetClipExtents which expose the bounds of the underlying surface. The biggest of these was fixed by the CreateClippedDrawTarget rewrite. The rest should be handled by ensuring that the DrawTarget has bounds that are at least as big as the union of the individual item bounds. i.e. GetClipExtents should never intersect with bounds of the item.

Blocks: blob-recoord

Currently items are painted with a context that has a transform of
-mLayerBounds.TopLeft(). This means that if TopLeft() changes the commands
will be in the wrong place because the -TopLeft() offset is baked into the
recording.

I don't think we've ever needed to support painting without this transformed
baked in so there were some infrastructure changes that needed to be made to
make this possible. Most of the problems come from the use of
gfxContext::GetClipExtents which expose the bounds of the underlying surface.
The biggest of these was fixed by the CreateClippedDrawTarget rewrite. The rest
should be handled by ensuring that the DrawTarget has bounds that are at least
as big as the union of the individual item bounds. i.e. GetClipExtents should
never intersect with bounds of the item.

This change has a couple of parts:

  1. Store mLayerBounds.TopLeft() in the recording so that it will be subtracted
    during replay

  2. Use mLayerBounds as the Rect of the RecordingDrawTarget

  3. Don't include mLayerBounds.TopLeft() in the transform during recording.

  4. Adjust the dirty rect by recordingOrigin before we use it as a clip so that
    it stays in the right place.

  5. In PaintContainerItem the bounds parameter of PushLayer is in device space
    so we need to account for the shift in the location of device space in the
    DrawTargetRecording.

Priority: -- → P3
Pushed by jmuizelaar@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/5fde2c3df608
blob: Make the recording use absolute coordinates. r=nical
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
Assignee: nobody → jmuizelaar
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: