Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 7e933b396ea0bcf7b27da2bc5ba958ea8e9e812f
      
https://github.com/WebKit/WebKit/commit/7e933b396ea0bcf7b27da2bc5ba958ea8e9e812f
  Author: Simon Fraser <simon.fra...@apple.com>
  Date:   2025-08-05 (Tue, 05 Aug 2025)

  Changed paths:
    M Source/WebCore/platform/graphics/cg/ImageBufferIOSurfaceBackend.cpp

  Log Message:
  -----------
  Edge corruption after IOSurface purging with lossless compression enabled
https://bugs.webkit.org/show_bug.cgi?id=296912
rdar://157372917

Reviewed by Tim Horton.

When an IOSurface comes back Empty from setVolatile(false), it means
that it was purged, and we have to paint the entire surface again.
`RemoteImageBufferSet::ensureBufferForDisplay()` attempts to do this
in the `SwapBuffersDisplayRequirement::NeedsFullDisplay` clause, but
expanding the logicalSize isn't sufficient, and can leave untouched pixels
at the edges for some combinations of surface size and scale.

This problem exists without IOSurface compression enabled, but the edge pixels
just remain clear in that case. Compression reveals uninitialized pixels.

Fix by adding a call to CGContextClearRect() using the physical size,
just as we do for new surface allocations.

The assertion checks that our physical rect isn't going to be messed
with by a non-identity CTM.

* Source/WebCore/platform/graphics/cg/ImageBufferIOSurfaceBackend.cpp:
(WebCore::ImageBufferIOSurfaceBackend::setNonVolatile):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to