[webkit-changes] [WebKit/WebKit] de645b: REGRESSION (264004 at main): Images MotionMark subtes...

Kimmo Kinnunen noreply at github.com
Mon Jul 3 04:51:29 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: de645b364760aec6f0f19234d97392020340d1bf
      https://github.com/WebKit/WebKit/commit/de645b364760aec6f0f19234d97392020340d1bf
  Author: Kimmo Kinnunen <kkinnunen at apple.com>
  Date:   2023-07-03 (Mon, 03 Jul 2023)

  Changed paths:
    M Source/WebCore/platform/graphics/cg/ImageBufferIOSurfaceBackend.cpp
    M Source/WebCore/platform/graphics/cocoa/IOSurface.h
    M Source/WebCore/platform/graphics/cocoa/IOSurface.mm
    M Source/WebKit/WebProcess/GPU/graphics/cocoa/ImageBufferShareableMappedIOSurfaceBitmapBackend.cpp
    M Source/WebKit/WebProcess/GPU/graphics/cocoa/ImageBufferShareableMappedIOSurfaceBitmapBackend.h

  Log Message:
  -----------
  REGRESSION (264004 at main): Images MotionMark subtest shows incorrect rendering on Intel
https://bugs.webkit.org/show_bug.cgi?id=258560
rdar://111197581

Reviewed by Simon Fraser.

ImageBufferShareableMappedIOSurfaceBitmapBackend would lock the
IOSurface and draw to it as a bitmap.

The code was written with the expectation was that after layer backing
store flush, ImageBuffer::releaseGraphicsContext() was called and this
would release the GraphicsContext, the underlying CGContext and the
IOSurface lock. This was a misunderstanding, releaseGraphicsContext() is
never called. This would cause MotionMark Images test to render
incorrectly on Intel-based Macs, since the IOSurface unlock is needed to
copy the main memory IOSurface cache back to the real IOSurface memory.

After each layer backing store update, the corresponding layer
ImageBuffers are flushed. Use the flush as the cue to unlock the
IOSurface that ImageBufferShareableMappedIOSurfaceBitmapBackend draws
to, before external access via the UI process starts.

Related but not strictly needed, make sure IOSurface locking errors are
handled gracefully. This bug is not about IOSurface locking errors, but
they were ignored before, and as such the behavior was part of the
investigation of this bug.

* Source/WebCore/platform/graphics/cg/ImageBufferIOSurfaceBackend.cpp:
(WebCore::ImageBufferIOSurfaceBackend::getPixelBuffer):
(WebCore::ImageBufferIOSurfaceBackend::putPixelBuffer):
* Source/WebCore/platform/graphics/cocoa/IOSurface.h:
(WebCore::IOSurface::lock):
* Source/WebCore/platform/graphics/cocoa/IOSurface.mm:
(WebCore::IOSurface::createBitmapPlatformContext):
* Source/WebKit/WebProcess/GPU/graphics/cocoa/ImageBufferShareableMappedIOSurfaceBitmapBackend.cpp:
(WebKit::ImageBufferShareableMappedIOSurfaceBitmapBackend::~ImageBufferShareableMappedIOSurfaceBitmapBackend):
(WebKit::ImageBufferShareableMappedIOSurfaceBitmapBackend::context):
(WebKit::ImageBufferShareableMappedIOSurfaceBitmapBackend::flushContext):
* Source/WebKit/WebProcess/GPU/graphics/cocoa/ImageBufferShareableMappedIOSurfaceBitmapBackend.h:

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




More information about the webkit-changes mailing list