Closed Bug 1821727 Opened 1 year ago Closed 1 year ago

Refactor the NativeLayerCA clip geometry calculations

Categories

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

Unspecified
macOS
enhancement

Tracking

()

RESOLVED FIXED
112 Branch
Tracking Status
firefox112 --- fixed

People

(Reporter: bradwerth, Assigned: bradwerth)

Details

Attachments

(1 file)

Clip geometry is calculated the same way in two locations: ApplyChanges and DumpLayer. Refactor this code to its own function and call the new function from both locations.

Severity: -- → S4
Priority: -- → P3

This creates a new method that is used in ApplyChanges and DumpLayer to
calculate the clip rect geometry. Along the way, it eliminates some
redundant outputs:

  1. effectiveClip is just a holder of both the position and bounds of the
    clip, which are applied seperately by the caller, so the new function
    returns them seperately.
  2. clipToLayerOffset is just the unscaled negated value of the clip
    position, and the only place it is used can tolerate doing the math at the
    point of use.

It also reorganizes the logic in DumpLayer a bit to more cleanly separate
the parts that output the wrapping div from the parts that output the img.

Unfortunately, it also re-lints the files it touches, which were somehow
out of compliance with current linting rules, so the changes look much
more extensive than they are.

Pushed by bwerth@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ae7a9ef40963
Refactor NativeLayerCA clip rect geometry calcuations. r=mstange
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 112 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: