Bug 175152 - Improve WebKitLegacy video fullscreen animation begin and end rects.
Summary: Improve WebKitLegacy video fullscreen animation begin and end rects.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: WebKit Nightly Build
Hardware: Mac Unspecified
: P2 Normal
Assignee: Jeremy Jones
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-08-03 13:24 PDT by Jeremy Jones
Modified: 2017-11-02 11:27 PDT (History)
4 users (show)

See Also:


Attachments
Patch (4.90 KB, patch)
2017-08-03 13:34 PDT, Jeremy Jones
no flags Details | Formatted Diff | Diff
Patch for landing. (5.01 KB, patch)
2017-08-03 15:56 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 2017-08-03 13:24:37 PDT
Improve WebKitLegacy video fullscreen animation begin and end rects.
Comment 1 Jeremy Jones 2017-08-03 13:29:12 PDT
rdar://problem/32840576
Comment 2 Jeremy Jones 2017-08-03 13:34:40 PDT
Created attachment 317146 [details]
Patch
Comment 3 Eric Carlson 2017-08-03 13:45:06 PDT
Comment on attachment 317146 [details]
Patch

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

> Source/WebCore/platform/mac/WebVideoFullscreenController.mm:236
> +static NSRect frameExpandedToRatioOfFrame(NSRect frameToExpand, NSRect frame)

Nit: NSRect&

> Source/WebCore/platform/mac/WebVideoFullscreenController.mm:284
>      NSRect frame = [self videoElementRect];
>      NSRect endFrame = [screen frame];
> -    constrainFrameToRatioOfFrame(&endFrame, &frame);
> +    frame = frameExpandedToRatioOfFrame(frame, endFrame);

Nit: this would be slightly cleaner as something like

NSRect frame = frameExpandedToRatioOfFrame([self videoElementRect], endFrame);
Comment 4 Jeremy Jones 2017-08-03 14:25:36 PDT
(In reply to Eric Carlson from comment #3)
> Comment on attachment 317146 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=317146&action=review
> 
> > Source/WebCore/platform/mac/WebVideoFullscreenController.mm:236
> > +static NSRect frameExpandedToRatioOfFrame(NSRect frameToExpand, NSRect frame)
> 
> Nit: NSRect&
> 

For small structs the cost of indirection might be higher than the cost of copying.

> > Source/WebCore/platform/mac/WebVideoFullscreenController.mm:284
> >      NSRect frame = [self videoElementRect];
> >      NSRect endFrame = [screen frame];
> > -    constrainFrameToRatioOfFrame(&endFrame, &frame);
> > +    frame = frameExpandedToRatioOfFrame(frame, endFrame);
> 
> Nit: this would be slightly cleaner as something like
> 
> NSRect frame = frameExpandedToRatioOfFrame([self videoElementRect],
> endFrame);

Done.
Comment 5 Jeremy Jones 2017-08-03 15:56:08 PDT
Created attachment 317174 [details]
Patch for landing.
Comment 6 WebKit Commit Bot 2017-08-03 18:58:36 PDT
Comment on attachment 317174 [details]
Patch for landing.

Clearing flags on attachment: 317174

Committed r220248: <http://trac.webkit.org/changeset/220248>