Bug 132481

Summary: [iOS] deviceScaleFactor is being double-applied when rendering captions in full screen mode
Product: WebKit Reporter: Brent Fulgham <bfulgham>
Component: MediaAssignee: Brent Fulgham <bfulgham>
Status: RESOLVED FIXED    
Severity: Critical CC: calvaris, commit-queue, eric.carlson, esprehn+autocc, glenn, gyuyoung.kim, jer.noble, philipj, sergio
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: iPhone / iPad   
OS: All   
Bug Depends on: 132498    
Bug Blocks:    
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Description Brent Fulgham 2014-05-02 12:32:58 PDT
When captions are played in full screen mode, they are about half the size we would expect. It looks like we are configuring the text track representation's graphics context to scale by the device scale factor, but later we apply that device scale factor again when generating the final image we pass to the full screen compositing step.
Comment 1 Brent Fulgham 2014-05-02 12:33:16 PDT
<rdar://problem/16507482>
Comment 2 Brent Fulgham 2014-05-02 12:38:22 PDT
Created attachment 230685 [details]
Patch
Comment 3 Jer Noble 2014-05-02 13:43:44 PDT
Comment on attachment 230685 [details]
Patch

r=me
Comment 4 Brent Fulgham 2014-05-02 14:39:55 PDT
Committed r168192: <http://trac.webkit.org/changeset/168192>
Comment 5 WebKit Commit Bot 2014-05-02 15:54:44 PDT
Re-opened since this is blocked by bug 132498
Comment 6 Brent Fulgham 2014-05-02 18:11:41 PDT
Created attachment 230726 [details]
Patch
Comment 7 Jer Noble 2014-05-02 18:28:33 PDT
Comment on attachment 230726 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=230726&action=review

> Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:1605
> +    if (representationLayer == m_textTrackRepresentationLayer) {
> +        if (m_videoFullscreenLayer && m_textTrackRepresentationLayer) {
> +            // Keep our text track layer in sync with the video layer at all times
> +            CGRect textFrame = m_videoLayer ? [m_videoLayer videoRect] : CGRectMake(0, 0, m_videoFullscreenFrame.width(), m_videoFullscreenFrame.height());
> +            [m_textTrackRepresentationLayer setFrame:textFrame];
> +        }

This is good, but it will miss when the video changes sizes during a single cue display. (I.e., changing rotation while a cue is up will not cause a re-layout.)

Brent and I discussed over IRC and alternate possibility for fixing this.
Comment 8 Brent Fulgham 2014-05-02 21:23:16 PDT
Created attachment 230738 [details]
Patch
Comment 9 Jer Noble 2014-05-02 21:36:34 PDT
Comment on attachment 230738 [details]
Patch

Nice! r=me
Comment 10 WebKit Commit Bot 2014-05-04 14:01:52 PDT
Comment on attachment 230738 [details]
Patch

Clearing flags on attachment: 230738

Committed r168245: <http://trac.webkit.org/changeset/168245>
Comment 11 WebKit Commit Bot 2014-05-04 14:02:00 PDT
All reviewed patches have been landed.  Closing bug.