Skip to content
Permalink
Browse files
Rendering artifacts when presenting fullscreen video
https://bugs.webkit.org/show_bug.cgi?id=247155
rdar://101352957

Reviewed by Tim Horton.

* Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
(-[WKFullScreenWindowController enterFullScreen:]):

Floor the values in the target size, as the window dimensions need to be integral values.

(-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
(-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):

Canonical link: https://commits.webkit.org/256251@main
  • Loading branch information
pxlcoder committed Nov 2, 2022
1 parent cd4a1c5 commit 7df587ca6a527c0e64cadc9d421de5298f65ea1c
Showing 1 changed file with 3 additions and 3 deletions.
@@ -577,7 +577,7 @@ - (void)enterFullScreen:(CGSize)videoDimensions
targetWidth = videoDimensions.width * preferredHeight / videoDimensions.height;
}

[_window setFrame:CGRectMake(0, 0, targetWidth, targetHeight)];
[_window setFrame:CGRectMake(0, 0, floorf(targetWidth), floorf(targetHeight))];
[_window setClipsToBounds:YES];
[_window _setContinuousCornerRadius:kFullScreenWindowCornerRadius];
[_window setNeedsLayout];
@@ -739,7 +739,7 @@ - (void)beganEnterFullScreenWithInitialFrame:(CGRect)initialFrame finalFrame:(CG
[_fullscreenViewController showBanner];

#if HAVE(UIKIT_WEBKIT_INTERNALS)
configureViewForEnteringFullscreen(_fullscreenViewController.get().view, kAnimationDuration, [_window frame].size);
configureViewControllerForEnteringFullscreen(_fullscreenViewController.get(), kAnimationDuration, [_window frame].size);
#endif

if (auto* videoFullscreenManager = self._videoFullscreenManager) {
@@ -874,7 +874,7 @@ - (void)beganExitFullScreenWithInitialFrame:(CGRect)initialFrame finalFrame:(CGR
[self _dismissFullscreenViewController];
};
#if HAVE(UIKIT_WEBKIT_INTERNALS)
configureViewForExitingFullscreen(_fullscreenViewController.get().view, kAnimationDuration, _originalWindowSize, WTFMove(completionHandler));
configureViewControllerForExitingFullscreen(_fullscreenViewController.get(), kAnimationDuration, _originalWindowSize, WTFMove(completionHandler));
#else
completionHandler();
#endif

0 comments on commit 7df587c

Please sign in to comment.