Closed Bug 1198996 Opened 9 years ago Closed 9 years ago

Layer::GetLocalOpacity() can return values outside of 0..1 range triggering Skia assertion in DrawTargetSkia

Categories

(Core :: Graphics: Layers, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla43
Tracking Status
firefox43 --- fixed

People

(Reporter: lsalzman, Assigned: lsalzman)

References

Details

Attachments

(1 file)

In SkColor.h:SkColorSetARBInline(U8CPU a, U8CPU r, U8CPU g, U8CPU b) we're triggering the following assertion:

SkASSERT(a <= 255 && r <= 255 && g <= 255 && b <= 255);

The a value is exceeding 255, because inside the SkPaint setup we're passing in an alpha value exceeding 1 before conversion, and this value is originating from Layer::GetEffectiveOpacity().

Note that since GetEffectiveOpacity() is multiplying the result of GetLocalOpacity() together, if these values are outside the 0..1 range the result can be even more generally bogus if any of the intermediate values is negative for some reason.
Attachment #8653145 - Flags: review?(bas) → review+
How can GetLocalOpacity() get outside the range 0..1? That should never happen.
https://hg.mozilla.org/mozilla-central/rev/c5f9c9319016
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla43
(In reply to Robert O'Callahan (:roc) (Mozilla Corporation) from comment #4)
> How can GetLocalOpacity() get outside the range 0..1? That should never
> happen.

It should never happen, except when it does... And then other stuff downwind blows up as a consequence.

I couldn't definitively track down the source, but it looks like there is some style animation of opacity that is sometimes, on the test machines, producing values slightly over the end of range.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: