Bug 192774 - Flicker when exiting element fullscreen.
Summary: Flicker when exiting element fullscreen.
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: WebKit Nightly Build
Hardware: Mac Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-12-17 13:35 PST by Jeremy Jones
Modified: 2019-06-16 20:58 PDT (History)
4 users (show)

See Also:


Attachments
Patch (6.63 KB, patch)
2018-12-17 13:40 PST, Jeremy Jones
no flags Details | Formatted Diff | Diff
Patch (6.91 KB, patch)
2018-12-20 11:11 PST, Jeremy Jones
jer.noble: review+
Details | Formatted Diff | Diff
Patch for landing. (7.63 KB, patch)
2018-12-20 15:16 PST, 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 2018-12-17 13:35:33 PST
Flicker when exiting element fullscreen.
Comment 1 Jeremy Jones 2018-12-17 13:36:57 PST
rdar://problem/33088878
Comment 2 Jeremy Jones 2018-12-17 13:40:47 PST
Created attachment 357472 [details]
Patch
Comment 3 Simon Fraser (smfr) 2018-12-17 14:43:25 PST
Comment on attachment 357472 [details]
Patch

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

> Source/WebKit/UIProcess/mac/WKFullScreenWindowController.mm:471
> +    webViewContents = createImageWithCopiedData(webViewContents.get());

Why is this necessary?

> Source/WebKit/UIProcess/mac/WKFullScreenWindowController.mm:479
> +    [CATransaction commit];
> +    [CATransaction flush];
> +
> +    [CATransaction begin];
> +    [CATransaction setDisableActions:YES];

Do we need to start a second transaction?

> Source/WebKit/UIProcess/mac/WKFullScreenWindowController.mm:526
> +    [_exitPlaceholder removeFromSuperview];
> +    [[_exitPlaceholder layer] setContents:nil];

I think it would be cleaner to just make a new _exitPlaceholder each time.
Comment 4 Jeremy Jones 2018-12-20 10:27:10 PST
Comment on attachment 357472 [details]
Patch

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

>> Source/WebKit/UIProcess/mac/WKFullScreenWindowController.mm:471
>> +    webViewContents = createImageWithCopiedData(webViewContents.get());
> 
> Why is this necessary?

Copied explanatory comment from the other place this function is used.

>> Source/WebKit/UIProcess/mac/WKFullScreenWindowController.mm:479
>> +    [CATransaction setDisableActions:YES];
> 
> Do we need to start a second transaction?

I believe so, since we only want to setDisableActions for this group of changes.

>> Source/WebKit/UIProcess/mac/WKFullScreenWindowController.mm:526
>> +    [[_exitPlaceholder layer] setContents:nil];
> 
> I think it would be cleaner to just make a new _exitPlaceholder each time.

Done.
Comment 5 Jeremy Jones 2018-12-20 11:11:26 PST
Created attachment 357835 [details]
Patch
Comment 6 Simon Fraser (smfr) 2018-12-20 11:40:58 PST
Comment on attachment 357835 [details]
Patch

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

> Source/WebKit/UIProcess/mac/WKFullScreenWindowController.mm:143
> -
> +    

Whitespace.

> Source/WebKit/UIProcess/mac/WKFullScreenWindowController.mm:464
> +    RetainPtr<CGImageRef> webViewContents = adoptCF(CGWindowListCreateImage(NSRectToCGRect(exitPlaceholderScreenRect), kCGWindowListOptionIncludingWindow, [[_webView window] windowNumber], kCGWindowImageDefault));

Why not CGSHWCaptureWindowList() like the takeWindowSnapshot() code?

> Source/WebKit/UIProcess/mac/WKFullScreenWindowController.mm:468
> +    // Using the returned CGImage directly would result in calls to the WindowServer every time
> +    // the image was painted. Instead, copy the image data into our own process to eliminate that
> +    // future overhead.

Is this really true?
Comment 7 Jeremy Jones 2018-12-20 15:10:04 PST
(In reply to Simon Fraser (smfr) from comment #6)
> Comment on attachment 357835 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=357835&action=review
> 
> > Source/WebKit/UIProcess/mac/WKFullScreenWindowController.mm:143
> > -
> > +    
> 
> Whitespace.
> 
> > Source/WebKit/UIProcess/mac/WKFullScreenWindowController.mm:464
> > +    RetainPtr<CGImageRef> webViewContents = adoptCF(CGWindowListCreateImage(NSRectToCGRect(exitPlaceholderScreenRect), kCGWindowListOptionIncludingWindow, [[_webView window] windowNumber], kCGWindowImageDefault));
> 
> Why not CGSHWCaptureWindowList() like the takeWindowSnapshot() code?

I've switched to this method.

> 
> > Source/WebKit/UIProcess/mac/WKFullScreenWindowController.mm:468
> > +    // Using the returned CGImage directly would result in calls to the WindowServer every time
> > +    // the image was painted. Instead, copy the image data into our own process to eliminate that
> > +    // future overhead.
> 
> Is this really true?

No longer relevant since switching to CGSHWCaptureWindowList()
Comment 8 Jeremy Jones 2018-12-20 15:16:19 PST
Created attachment 357877 [details]
Patch for landing.
Comment 9 WebKit Commit Bot 2018-12-20 16:27:58 PST
Comment on attachment 357877 [details]
Patch for landing.

Clearing flags on attachment: 357877

Committed r239475: <https://trac.webkit.org/changeset/239475>