Bug 147189 - Fix fullscreen and PiP video animation and sizing regressions.
Summary: Fix fullscreen and PiP video animation and sizing regressions.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: 528+ (Nightly build)
Hardware: iPhone / iPad Unspecified
: P2 Normal
Assignee: Jeremy Jones
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-07-22 05:49 PDT by Jeremy Jones
Modified: 2015-07-23 03:13 PDT (History)
5 users (show)

See Also:


Attachments
Patch (6.32 KB, patch)
2015-07-22 05:59 PDT, Jeremy Jones
no flags Details | Formatted Diff | Diff
Patch (7.69 KB, patch)
2015-07-22 13:36 PDT, Jeremy Jones
jeremyj-wk: commit-queue+
Details | Formatted Diff | Diff
Patch for landing. (7.66 KB, patch)
2015-07-22 13:39 PDT, Jeremy Jones
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jeremy Jones 2015-07-22 05:49:58 PDT
Fix fullscreen and PiP video animation and sizing regressions.
Comment 1 Jeremy Jones 2015-07-22 05:52:54 PDT
rdar://problem/21930899
Comment 2 Jeremy Jones 2015-07-22 05:59:41 PDT
Created attachment 257261 [details]
Patch
Comment 3 Jer Noble 2015-07-22 10:05:13 PDT
Comment on attachment 257261 [details]
Patch

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

> Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm:467
> -    RefPtr<WebVideoFullscreenControllerContext> strongThis(this);
> -    RetainPtr<CALayer> videoFullscreenLayer = [m_videoFullscreenView layer];
> -
> -    mach_port_name_t fencePort = [[videoFullscreenLayer context] createFencePort];
> -    
> -    WebThreadRun([strongThis, this, frame, fencePort, videoFullscreenLayer] {
> -        [CATransaction begin];
> -        [CATransaction setAnimationDuration:0];
> -        if (m_model)
> -            m_model->setVideoLayerFrame(frame);
> -        [[videoFullscreenLayer context] setFencePort:fencePort];
> -        mach_port_deallocate(mach_task_self(), fencePort);
> -        [CATransaction commit];
> -    });
> +    if (m_model)
> +        m_model->setVideoLayerFrame(frame);

Is there anything we do inside setVideoLayerFrame() which assumes it's being run on the web thread?

> Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm:532
> +        FloatRect videoLayerFrame = FloatRect(0, 0, videoElementClientRect.width(), videoElementClientRect.height());

You can just do: 

FloatRect videoLayerFrame = FloatRect(FloatPoint(), videoElementClientRect.size());  

Or use constructor syntax rather than assignment. FloatSize is constructible from an IntSize (but not vice-versa).
Comment 4 Jeremy Jones 2015-07-22 12:03:50 PDT
(In reply to comment #3)
> Comment on attachment 257261 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=257261&action=review
> 
> > Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm:467
> > -    RefPtr<WebVideoFullscreenControllerContext> strongThis(this);
> > -    RetainPtr<CALayer> videoFullscreenLayer = [m_videoFullscreenView layer];
> > -
> > -    mach_port_name_t fencePort = [[videoFullscreenLayer context] createFencePort];
> > -    
> > -    WebThreadRun([strongThis, this, frame, fencePort, videoFullscreenLayer] {
> > -        [CATransaction begin];
> > -        [CATransaction setAnimationDuration:0];
> > -        if (m_model)
> > -            m_model->setVideoLayerFrame(frame);
> > -        [[videoFullscreenLayer context] setFencePort:fencePort];
> > -        mach_port_deallocate(mach_task_self(), fencePort);
> > -        [CATransaction commit];
> > -    });
> > +    if (m_model)
> > +        m_model->setVideoLayerFrame(frame);
> 
> Is there anything we do inside setVideoLayerFrame() which assumes it's being
> run on the web thread?

Maybe. Just to be base I'll move the operations that need to be sync'd into the web thread instead of into the UIThread.

> 
> > Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm:532
> > +        FloatRect videoLayerFrame = FloatRect(0, 0, videoElementClientRect.width(), videoElementClientRect.height());
> 
> You can just do: 
> 
> FloatRect videoLayerFrame = FloatRect(FloatPoint(),
> videoElementClientRect.size());  
> 
> Or use constructor syntax rather than assignment. FloatSize is constructible
> from an IntSize (but not vice-versa).

I thought there had to be something more succinct.
Comment 5 Jeremy Jones 2015-07-22 13:36:25 PDT
Created attachment 257290 [details]
Patch
Comment 6 Jeremy Jones 2015-07-22 13:39:16 PDT
Created attachment 257293 [details]
Patch for landing.
Comment 7 WebKit Commit Bot 2015-07-22 14:32:59 PDT
Comment on attachment 257293 [details]
Patch for landing.

Clearing flags on attachment: 257293

Committed r187183: <http://trac.webkit.org/changeset/187183>
Comment 8 WebKit Commit Bot 2015-07-22 14:33:02 PDT
All reviewed patches have been landed.  Closing bug.
Comment 9 Tim Horton 2015-07-23 03:13:08 PDT
Build fix: http://trac.webkit.org/changeset/187225