[Skia] Remove Moz2D requirement for SK_SUPPORT_LEGACY_LAYERRASTERIZER_API

RESOLVED FIXED in mozilla33

Status

()

defect
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: gw280, Assigned: wlitwinczyk)

Tracking

unspecified
mozilla33
x86_64
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 2 obsolete attachments)

Skia are deprecating some of their layer rasterizer APIs, and to ease the transition the old ones are still available behind an ifdef SK_SUPPORT_LEGACY_LAYERRASTERIZER_API

We should remove our usage of these old APIs and switch to the new ones.

Ideal as an intern bug.
Assignee: nobody → wlitwinczyk
Posted patch Removed usage of legacy api (obsolete) — Splinter Review
Attachment #8427386 - Flags: review?(gwright)
Comment on attachment 8427386 [details] [diff] [review]
Removed usage of legacy api

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

This looks fine. I was mostly concerned about the refcnt of the SkLayerRasterizer object but this looks correct.
Attachment #8427386 - Flags: review?(gwright) → review+
That being said, I'd rather we used an SkAutoTUnref<SkLayerRasterizer> instead of calling SkSafeUnref() on the returned object.
Posted patch skia_bug_1004374 (obsolete) — Splinter Review
Changed SkSafeUnref -> SkAutoTUnref
Attachment #8427386 - Attachment is obsolete: true
Attachment #8443644 - Flags: review?(gwright)
Comment on attachment 8443644 [details] [diff] [review]
skia_bug_1004374

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

Looks good to me, with minor nit (basically to match the way we use SkAutoTUnref in the rest of DrawTargetSkia, such as in Init()).

::: gfx/2d/DrawTargetSkia.cpp
@@ +537,5 @@
>    SetPaintPattern(maskPaint, aMask, tmpBitmap);
>    
> +  SkLayerRasterizer::Builder builder;
> +  builder.addLayer(maskPaint);
> +  SkAutoTUnref<SkRasterizer> raster(paint.mPaint.setRasterizer(builder.detachRasterizer()));

I would really rather have:

SkAutoTUnref<SkRasterizer> raster(builder.detachRasterizer());
paint.mPaint.setRasterizer(raster.get());
Attachment #8443644 - Flags: review?(gwright) → review+
r=gw280 carried forward
Attachment #8443644 - Attachment is obsolete: true
Attachment #8443654 - Flags: review+
https://hg.mozilla.org/mozilla-central/rev/b4991c65b2a4
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla33
You need to log in before you can comment on or make changes to this bug.