Bug 119523 - Improper Calculation of In-band Cue Colors
Summary: Improper Calculation of In-band Cue Colors
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Brent Fulgham
Depends on:
Reported: 2013-08-06 10:14 PDT by Brent Fulgham
Modified: 2013-08-06 11:38 PDT (History)
0 users

See Also:

Patch (1.42 KB, patch)
2013-08-06 10:16 PDT, Brent Fulgham
eric.carlson: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brent Fulgham 2013-08-06 10:14:12 PDT
The logic used to convert the attributed strings from In-band caption content was improperly converting from floating point values to byte values.

We are getting a directive to draw 100% opaque black background in TextTrackCueGenericBoxElement::applyCSSProperties.  This is coming from the cue's background color property.

It looks like the code in InbandTextTrackPrivateAVF.cpp (makeRGBA32FromARGBCFArray) is improperly converting from floating point values to bytes.

I see a 50% opacity value coming into the function, which is multiplied by 255 when being passed to the makeRGBA32FromFloats function.  That function calls 'colorFloatToRGBAByte', which performs a bounded multiplication by 255.

This means we have (0.5 * 255) * 255 -> 125 * (255) -> the max of 255.

If I take away the outer (redundant) multiplication by 255, I get correct behavior.
Comment 1 Brent Fulgham 2013-08-06 10:14:36 PDT
Comment 2 Brent Fulgham 2013-08-06 10:16:29 PDT
Created attachment 208198 [details]
Comment 3 Brent Fulgham 2013-08-06 11:38:57 PDT
Committed r153758: <http://trac.webkit.org/changeset/153758>