Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: e484381cb624c92f80282211597a047bd6fb9020
      
https://github.com/WebKit/WebKit/commit/e484381cb624c92f80282211597a047bd6fb9020
  Author: Kimmo Kinnunen <[email protected]>
  Date:   2026-02-26 (Thu, 26 Feb 2026)

  Changed paths:
    M Source/WebCore/platform/graphics/NativeImage.cpp
    M Source/WebCore/platform/graphics/NativeImage.h
    M Source/WebCore/platform/graphics/ShareableBitmap.cpp
    M Source/WebCore/platform/graphics/ShareableBitmap.h
    M Source/WebCore/platform/graphics/cg/NativeImageCG.cpp
    M Source/WebCore/platform/graphics/cg/ShareableBitmapCG.mm
    M Source/WebKit/WebProcess/GPU/ShapeDetection/RemoteBarcodeDetectorProxy.cpp
    M Source/WebKit/WebProcess/GPU/ShapeDetection/RemoteFaceDetectorProxy.cpp
    M Source/WebKit/WebProcess/GPU/ShapeDetection/RemoteTextDetectorProxy.cpp
    M Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextProxy.cpp
    M Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextProxy.h
    M Source/WebKit/WebProcess/GPU/graphics/RemoteResourceCacheProxy.cpp
    M Source/WebKit/WebProcess/GPU/graphics/RemoteResourceCacheProxy.h

  Log Message:
  -----------
  RemoteGraphicsContextProxy::recordResourceUse should use const NativeImage
https://bugs.webkit.org/show_bug.cgi?id=308725
rdar://171248851

Reviewed by Anne van Kesteren.

NativeImage is externally immutable, so drawing NativeImage to
GPUP context should not have externally observable effects.
Mark
RemoteGraphicsContextProxy::recordResourceUse(const NativeImage&,...)
and propagate the const further as needed.

The NativeImage accessors
and update functions mutate mutable variables and the the state
behaves as if immutable. Later commits will make the mutable variables
thread-safe.

* Source/WebCore/platform/graphics/NativeImage.cpp:
(WebCore::NativeImage::replacePlatformImage const):
(WebCore::NativeImage::computeHeadroom const):
(WebCore::NativeImage::replacePlatformImage): Deleted.
(WebCore::NativeImage::computeHeadroom): Deleted.
* Source/WebCore/platform/graphics/NativeImage.h:
(WebCore::NativeImage::addObserver const):
(WebCore::NativeImage::addObserver): Deleted.
* Source/WebCore/platform/graphics/ShareableBitmap.cpp:
(WebCore::ShareableBitmap::createFromImageDraw):
* Source/WebCore/platform/graphics/ShareableBitmap.h:
* Source/WebCore/platform/graphics/cg/NativeImageCG.cpp:
(WebCore::NativeImage::computeHeadroom const):
(WebCore::NativeImage::computeHeadroom): Deleted.
* Source/WebCore/platform/graphics/cg/ShareableBitmapCG.mm:
(WebCore::ShareableBitmapConfiguration::ShareableBitmapConfiguration):
(WebCore::ShareableBitmap::createFromImagePixels):
* Source/WebKit/WebProcess/GPU/ShapeDetection/RemoteBarcodeDetectorProxy.cpp:
(WebKit::ShapeDetection::RemoteBarcodeDetectorProxy::detect):
* Source/WebKit/WebProcess/GPU/ShapeDetection/RemoteFaceDetectorProxy.cpp:
(WebKit::ShapeDetection::RemoteFaceDetectorProxy::detect):
* Source/WebKit/WebProcess/GPU/ShapeDetection/RemoteTextDetectorProxy.cpp:
(WebKit::ShapeDetection::RemoteTextDetectorProxy::detect):
* Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextProxy.cpp:
(WebKit::RemoteGraphicsContextProxy::recordResourceUse):
* Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextProxy.h:
* Source/WebKit/WebProcess/GPU/graphics/RemoteResourceCacheProxy.cpp:
(WebKit::createShareableBitmapForNativeImage):
(WebKit::RemoteResourceCacheProxy::recordNativeImageUse):
* Source/WebKit/WebProcess/GPU/graphics/RemoteResourceCacheProxy.h:

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



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

Reply via email to