[webkit-changes] [WebKit/WebKit] 2f426d: Don't flush ImageBufferIOSurfaceBackend on creation.

mattwoodrow noreply at github.com
Mon Aug 14 16:16:04 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 2f426da28a3bc3d40eae3d98b687b686d714055f
      https://github.com/WebKit/WebKit/commit/2f426da28a3bc3d40eae3d98b687b686d714055f
  Author: Matt Woodrow <mattwoodrow at apple.com>
  Date:   2023-08-14 (Mon, 14 Aug 2023)

  Changed paths:
    M Source/WebCore/platform/graphics/cg/ImageBufferIOSurfaceBackend.cpp
    M Source/WebCore/platform/graphics/cg/ImageBufferIOSurfaceBackend.h
    M Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferProxy.h
    M Source/WebKit/WebProcess/GPU/graphics/cocoa/ImageBufferShareableMappedIOSurfaceBackend.cpp

  Log Message:
  -----------
  Don't flush ImageBufferIOSurfaceBackend on creation.
https://bugs.webkit.org/show_bug.cgi?id=259998
<rdar://113657395>

Reviewed by Kimmo Kinnunen.

ImageBufferIOSurfaceBackend currently clears the newly allocated IOSurface and then synchronously flushes during construction.
Rather than flushing immediately, we should be able to defer this flush until a consumer attempts to read the contents of the surface.

This adds a m_needsFirstFlush variable to track the omitted initial flush, and ensures we include the flush when the pixels are accessed.

It also set RemoteImageBufferProxy's m_needsFlush to true, so that remote consumers that use the ImageBufferBackendHandle to access the buffer's
pixel also know they need to explicitly flush.

This could potentially be a performance regression for remote consumers that attempt to allocate a surface and then use it for compositing as a blank surface,
since it adds the need to wait on the flush.

It should be a performance progression in the majority of cases though, since we usually draw to the surface (and require a flush for that), and will coalesce the
flushes.

* Source/WebCore/platform/graphics/cg/ImageBufferIOSurfaceBackend.cpp:
(WebCore::ImageBufferIOSurfaceBackend::create):
(WebCore::ImageBufferIOSurfaceBackend::flushContextDraws):
* Source/WebCore/platform/graphics/cg/ImageBufferIOSurfaceBackend.h:
* Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferProxy.h:
* Source/WebKit/WebProcess/GPU/graphics/cocoa/ImageBufferShareableMappedIOSurfaceBackend.cpp:
(WebKit::ImageBufferShareableMappedIOSurfaceBackend::create):

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




More information about the webkit-changes mailing list