Closed Bug 1296301 Opened 8 years ago Closed 8 years ago

Source operator not optimized in DrawTargetSkia when mask bounds larger than clip

Categories

(Core :: Graphics, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla51
Tracking Status
firefox51 --- fixed

People

(Reporter: lsalzman, Assigned: lsalzman)

References

Details

(Whiteboard: [gfx-noted])

Attachments

(1 file)

With respect to the mask bounds optimization at: https://dxr.mozilla.org/mozilla-central/source/gfx/2d/DrawTargetSkia.cpp#441

This never gets triggered because the clip bounds are slightly inflated by Skia as done here: https://dxr.mozilla.org/mozilla-central/source/gfx/skia/skia/src/core/SkCanvas.cpp#1809

This causes us to always push a layer for unbounded operators, even when we shouldn't need one.

The simplest fix is just to use getClipDeviceBounds instead so we can skip this inflation.
Attachment #8782463 - Flags: review?(jmuizelaar)
Comment on attachment 8782463 [details] [diff] [review]
use getClipDeviceBounds instead of getClipBounds in DrawTargetSkia

Review of attachment 8782463 [details] [diff] [review]:
-----------------------------------------------------------------

::: gfx/2d/DrawTargetSkia.cpp
@@ +398,5 @@
>  static inline Rect
>  GetClipBounds(SkCanvas *aCanvas)
>  {
> +  // Use getClipDeviceBounds instead of getClipBounds to avoid
> +  // inflation of the bounds rect.

// Use a manually transformed getClipDeviceBounds instead of
// getClipBounds because getClipBounds inflates the the bounds
// by a pixel in each direction to compensate for antialiasing.
Attachment #8782463 - Flags: review?(jmuizelaar) → review+
Great find and patch.
Pushed by lsalzman@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/91667ea2a01e
use getClipDeviceBounds instead of getClipBounds in DrawTargetSkia. r=jrmuizel
https://hg.mozilla.org/mozilla-central/rev/91667ea2a01e
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla51
Blocks: 1297031
Blocks: 1294337
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: