Skip to content

Commit

Permalink
[Cocoa] Extra transform left on video layer when UI-side compositing …
Browse files Browse the repository at this point in the history
…is disabled

https://bugs.webkit.org/show_bug.cgi?id=256027
rdar://108109357

Reviewed by Eric Carlson.

In -resolveBounds, we bail out early if the WKVideoLayerRemote has the correct bounds and has
a identity affineTransform. But in -layoutSublayers we apply the transform directly to the
videoLayer, rather than the WKVideoLayerRemote itself, so this check will always succeed.

Leaving the transformation in place _should_ have no perceivable side effects. However power
testing has revealed that in some circumstances, this layer change may result in excess power
use when displaying video in fullscreen mode.

* Source/WebKit/WebProcess/GPU/media/cocoa/VideoLayerRemoteCocoa.mm:
(-[WKVideoLayerRemote resolveBounds]):

Canonical link: https://commits.webkit.org/263456@main
  • Loading branch information
jernoble committed Apr 27, 2023
1 parent 44b5f74 commit 8a95a46
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -187,7 +187,7 @@ - (void)resolveBounds
}

auto* videoSublayer = [sublayers objectAtIndex:0];
if (!CGRectIsEmpty(self.videoLayerFrame) && CGRectEqualToRect(self.videoLayerFrame, videoSublayer.bounds) && CGAffineTransformIsIdentity(self.affineTransform))
if (!CGRectIsEmpty(self.videoLayerFrame) && CGRectEqualToRect(self.videoLayerFrame, videoSublayer.bounds) && CGAffineTransformIsIdentity(videoSublayer.affineTransform))
return;

[CATransaction begin];
Expand Down

0 comments on commit 8a95a46

Please sign in to comment.