Changeset 183431 in webkit


Ignore:
Timestamp:
Apr 27, 2015 3:24:07 PM (9 years ago)
Author:
jer.noble@apple.com
Message:

[iOS] Video not centered in element on retina devices
https://bugs.webkit.org/show_bug.cgi?id=144274

Reviewed by Simon Fraser.

In r173702, a transform was added to the video layer (and a matching, inverse transform
in the UIProcess), but this transform affects the position property of the video layer
used to position the video content within the element bounds when their aspect ratios
do not match.

To work around this problem, pre-apply the transform during -setPosition:.

  • platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:

(-[WebVideoContainerLayer setPosition:]):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r183428 r183431  
     12015-04-27  Jer Noble  <jer.noble@apple.com>
     2
     3        [iOS] Video not centered in element on retina devices
     4        https://bugs.webkit.org/show_bug.cgi?id=144274
     5
     6        Reviewed by Simon Fraser.
     7
     8        In r173702, a transform was added to the video layer (and a matching, inverse transform
     9        in the UIProcess), but this transform affects the position property of the video layer
     10        used to position the video content within the element bounds when their aspect ratios
     11        do not match.
     12
     13        To work around this problem, pre-apply the transform during -setPosition:.
     14
     15        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
     16        (-[WebVideoContainerLayer setPosition:]):
     17
    1182015-04-27  Jer Noble  <jer.noble@apple.com>
    219
  • trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm

    r183096 r183431  
    116116        layer.frame = bounds;
    117117}
     118
     119- (void)setPosition:(CGPoint)position
     120{
     121    if (!CATransform3DIsIdentity(self.transform)) {
     122        // Pre-apply the transform added in the WebProcess to fix <rdar://problem/18316542> to the position.
     123        position = CGPointApplyAffineTransform(position, CATransform3DGetAffineTransform(self.transform));
     124    }
     125    [super setPosition:position];
     126}
    118127@end
    119128
Note: See TracChangeset for help on using the changeset viewer.