Skip to content

Commit

Permalink
Cherry-pick 5129c74. rdar://problem/110139703
Browse files Browse the repository at this point in the history
    LocalSampleBufferDisplayLayer crops frames with a rotation of 90 degrees
    https://bugs.webkit.org/show_bug.cgi?id=257747
    rdar://110139703

    Reviewed by Eric Carlson.

    We broke the computation of bounds and position in case of rotations in 0e0d797.
    We update the code to be back to the previous version.

    * Source/WebCore/platform/graphics/avfoundation/objc/LocalSampleBufferDisplayLayer.mm:
    (WebCore::LocalSampleBufferDisplayLayer::updateRootLayerBoundsAndPosition):

    Canonical link: https://commits.webkit.org/264930@main

Canonical link: https://commits.webkit.org/264854.2@safari-7616.1.17-branch
  • Loading branch information
youennf authored and rjepstein committed Jun 7, 2023
1 parent 8651a56 commit 4307e2e
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,9 @@ static void runWithoutAnimations(const WTF::Function<void()>& function)
auto layerBounds = bounds;
if (rotation == VideoFrame::Rotation::Right || rotation == VideoFrame::Rotation::Left)
std::swap(layerBounds.size.width, layerBounds.size.height);
CGPoint position { bounds.size.width / 2, bounds.size.height / 2 };
m_sampleBufferDisplayLayer.get().position = position;
m_sampleBufferDisplayLayer.get().bounds = bounds;
CGPoint layerPosition { layerBounds.size.width / 2, layerBounds.size.height / 2 };
m_sampleBufferDisplayLayer.get().position = layerPosition;
m_sampleBufferDisplayLayer.get().bounds = layerBounds;

m_processingQueue->dispatch([this, weakThis = WTFMove(weakThis), newLayer = m_sampleBufferDisplayLayer, oldLayer = WTFMove(oldLayer), shouldUpdateRootLayer, bounds, rotation]() mutable {
assertIsCurrent(workQueue());
Expand Down

0 comments on commit 4307e2e

Please sign in to comment.