[webkit-changes] [WebKit/WebKit] 89b7e1: Dynamic Content Scaling is needlessly enabled for ...

Tim Horton noreply at github.com
Mon Feb 10 13:27:36 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 89b7e1f4bfb2a61da2b79fc4d06de621187d1e67
      https://github.com/WebKit/WebKit/commit/89b7e1f4bfb2a61da2b79fc4d06de621187d1e67
  Author: Tim Horton <thorton at apple.com>
  Date:   2025-02-10 (Mon, 10 Feb 2025)

  Changed paths:
    M Source/WebCore/platform/graphics/GraphicsLayerClient.h
    M Source/WebCore/platform/graphics/RenderingMode.cpp
    M Source/WebCore/platform/graphics/RenderingMode.h
    M Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h
    M Source/WebCore/platform/graphics/ca/PlatformCALayerClient.h
    M Source/WebCore/platform/graphics/cocoa/DynamicContentScalingDisplayList.h
    M Source/WebCore/platform/graphics/cocoa/IOSurface.h
    M Source/WebCore/platform/graphics/cocoa/IOSurface.mm
    M Source/WebCore/rendering/RenderLayer.cpp
    M Source/WebCore/rendering/RenderLayer.h
    M Source/WebCore/rendering/RenderLayerBacking.cpp
    M Source/WebCore/rendering/RenderLayerBacking.h
    M Source/WebKit/CMakeLists.txt
    M Source/WebKit/DerivedSources-input.xcfilelist
    M Source/WebKit/DerivedSources.make
    M Source/WebKit/GPUProcess/graphics/RemoteImageBufferSet.cpp
    M Source/WebKit/GPUProcess/graphics/RemoteImageBufferSet.h
    M Source/WebKit/GPUProcess/graphics/RemoteImageBufferSet.messages.in
    M Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.cpp
    M Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.h
    M Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.mm
    M Source/WebKit/Shared/RemoteLayerTree/RemoteLayerWithInProcessRenderingBackingStore.mm
    M Source/WebKit/Shared/RemoteLayerTree/RemoteLayerWithRemoteRenderingBackingStore.mm
    M Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in
    A Source/WebKit/Shared/graphics/RemoteImageBufferSetConfiguration.h
    A Source/WebKit/Shared/graphics/RemoteImageBufferSetConfiguration.serialization.in
    M Source/WebKit/WebKit.xcodeproj/project.pbxproj
    M Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferSetProxy.cpp
    M Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferSetProxy.h
    M Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h
    M Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.mm
    M Source/WebKit/WebProcess/WebProcess.cpp

  Log Message:
  -----------
  Dynamic Content Scaling is needlessly enabled for some canvas elements
https://bugs.webkit.org/show_bug.cgi?id=287372
rdar://144489486

Reviewed by Wenson Hsieh.

Dynamic Content Scaling doesn't work for canvas right now, because we don't
record and replay canvas commands. Because of this, we disable it for layers
that back canvases, to avoid pointless overhead.

However, to identify canvas layers, we were using isBitmapOnly(), which does not
include e.g. canvases that have backgrounds.

Instead, centralize the Dynamic Content Scaling policy in its own method, which
applies to all canvases regardless of decorations, *and* bitmap-only layers.

Also, the way that Dynamic Content Scaling enablement was plumbed to GPUP-hosted
layer backing was very duplicative (instead of conferring with includeDisplayList,
we would check isBitmapOnly() again!). Repair this so we can have the logic
in only one place. This also obviates the need for RenderingPurpose::BitmapOnlyLayerBacking,
which was a bit of a conflation of two separate dimensions.

* Source/WebCore/platform/graphics/RenderingMode.cpp:
(WebCore::operator<<):
* Source/WebCore/platform/graphics/RenderingMode.h:
* Source/WebCore/platform/graphics/cocoa/IOSurface.h:
* Source/WebCore/platform/graphics/cocoa/IOSurface.mm:
(WebCore::surfaceNameToNSString):
(WebCore::IOSurface::nameForRenderingPurpose):
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:
* Source/WebKit/WebProcess/WebProcess.cpp:
(WebKit::WebProcess::shouldUseRemoteRenderingFor):
Get rid of BitmapOnlyLayerBacking.

* Source/WebCore/platform/graphics/GraphicsLayerClient.h:
(WebCore::GraphicsLayerClient::layerAllowsDynamicContentScaling const):
(WebCore::GraphicsLayerClient::layerContainsBitmapOnly const): Deleted.
* Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h:
* Source/WebCore/platform/graphics/ca/PlatformCALayerClient.h:
(WebCore::PlatformCALayerClient::platformCALayerAllowsDynamicContentScaling const):
(WebCore::PlatformCALayerClient::platformCALayerContainsBitmapOnly const): Deleted.
* Source/WebCore/rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects const):
* Source/WebCore/rendering/RenderLayer.h:
* Source/WebCore/rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::layerAllowsDynamicContentScaling const):
* Source/WebCore/rendering/RenderLayerBacking.h:
* Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h:
* Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.mm:
(WebKit::PlatformCALayerRemote::allowsDynamicContentScaling const):
(WebKit::PlatformCALayerRemote::shouldIncludeDisplayListInBackingStore const):
(WebKit::PlatformCALayerRemote::containsBitmapOnly const): Deleted.
Replace "contains bitmap only" layer-level plumbing with "allows dynamic content scaling" one.
Let RenderLayer maintain the single implementation of the policy.

* Source/WebCore/platform/graphics/cocoa/DynamicContentScalingDisplayList.h:
Hoist IncludeDynamicContentScalingDisplayList down here to fix some circular header
dependencies in WebKit.

* Source/WebKit/DerivedSources-input.xcfilelist:
* Source/WebKit/DerivedSources.make:
* Source/WebKit/GPUProcess/graphics/RemoteImageBufferSet.cpp:
(WebKit::RemoteImageBufferSet::updateConfiguration):
(WebKit::RemoteImageBufferSet::ensureBufferForDisplay):
(WebKit::RemoteImageBufferSet::prepareBufferForDisplay):
* Source/WebKit/GPUProcess/graphics/RemoteImageBufferSet.h:
(WebKit::RemoteImageBufferSet::isOpaque const):
* Source/WebKit/GPUProcess/graphics/RemoteImageBufferSet.messages.in:
* Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.cpp:
(WebKit::isSmallLayerBacking):
(WebKit::RemoteRenderingBackend::allocateImageBuffer):
* Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.h:
* Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
(WebKit::RemoteLayerBackingStore::supportsPartialRepaint const):
* Source/WebKit/Shared/RemoteLayerTree/RemoteLayerWithInProcessRenderingBackingStore.mm:
(WebKit::RemoteLayerWithInProcessRenderingBackingStore::allocateBuffer):
* Source/WebKit/Shared/RemoteLayerTree/RemoteLayerWithRemoteRenderingBackingStore.mm:
(WebKit::RemoteLayerWithRemoteRenderingBackingStore::ensureBackingStore):
* Source/WebKit/Shared/graphics/RemoteImageBufferSetConfiguration.h: Added.
* Source/WebKit/Shared/graphics/RemoteImageBufferSetConfiguration.serialization.in: Added.
* Source/WebKit/WebKit.xcodeproj/project.pbxproj:
* Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferSetProxy.cpp:
(WebKit::RemoteImageBufferSetProxy::didPrepareForDisplay):
(WebKit::RemoteImageBufferSetProxy::setConfiguration):
(WebKit::RemoteImageBufferSetProxy::willPrepareForDisplay):
* Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferSetProxy.h:
Encapsulate RemoteImageBufferSet configuration in a struct, so we can
easily have an optional bit for whether Dynamic Content Scaling is enabled or not.

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



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list