[webkit-changes] [WebKit/WebKit] 448843: ImageBitmapBacking is a redundant class

Kimmo Kinnunen noreply at github.com
Fri Jan 19 00:01:30 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 44884327f7156a080986bb7f9748e825347a3684
      https://github.com/WebKit/WebKit/commit/44884327f7156a080986bb7f9748e825347a3684
  Author: Kimmo Kinnunen <kkinnunen at apple.com>
  Date:   2024-01-19 (Fri, 19 Jan 2024)

  Changed paths:
    M Source/WebCore/Headers.cmake
    M Source/WebCore/Sources.txt
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    M Source/WebCore/bindings/js/SerializedScriptValue.cpp
    M Source/WebCore/bindings/js/SerializedScriptValue.h
    M Source/WebCore/html/ImageBitmap.cpp
    M Source/WebCore/html/ImageBitmap.h
    R Source/WebCore/html/ImageBitmapBacking.cpp
    R Source/WebCore/html/ImageBitmapBacking.h
    M Source/WebCore/html/OffscreenCanvas.cpp
    M Source/WebCore/platform/graphics/ImageBuffer.cpp
    M Source/WebCore/platform/graphics/ImageBuffer.h
    M Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in
    M Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferProxy.h

  Log Message:
  -----------
  ImageBitmapBacking is a redundant class
https://bugs.webkit.org/show_bug.cgi?id=267455
rdar://120906757

Reviewed by Matt Woodrow.

ImageBitmap would hold a ImageBitmapBacking. It is a bit error-prone,
as the purpose of the backing is not much more than just hold the
ImageBuffer. Backing might get nulled, as might the ImageBuffer itself.

Make it simpler and move the ImageBitmapBacking directly to ImageBitmap.
This also removes the redundant allocation of ImageBitmapBacking.

Make the Web Worker serialization work similarly to OffscreenCanvas:
when the ImageBitmap is "detached" for moving to a Worker, construct
a DetachedImageBitmap to move it.

* Source/WebCore/Headers.cmake:
* Source/WebCore/Sources.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::dumpImageBitmap):
(WebCore::CloneDeserializer::deserialize):
(WebCore::CloneDeserializer::CloneDeserializer):
(WebCore::CloneDeserializer::readTransferredImageBitmap):
(WebCore::CloneDeserializer::readImageBitmap):
(WebCore::SerializedScriptValue::SerializedScriptValue):
(WebCore::SerializedScriptValue::computeMemoryCost const):
(WebCore::SerializedScriptValue::create):
(WebCore::SerializedScriptValue::deserialize):
* Source/WebCore/bindings/js/SerializedScriptValue.h:
(WebCore::SerializedScriptValue::SerializedScriptValue):
* Source/WebCore/html/ImageBitmap.cpp:
(WebCore::DetachedImageBitmap::DetachedImageBitmap):
(WebCore::ImageBitmap::create):
(WebCore::ImageBitmap::detach):
(WebCore::ImageBitmap::createBlankImageBuffer):
(WebCore::ImageBitmap::createCompletionHandler):
(WebCore::ImageBitmap::createFromBuffer):
(WebCore::ImageBitmap::ImageBitmap):
(WebCore::ImageBitmap::takeImageBuffer):
(WebCore::ImageBitmap::width const):
(WebCore::ImageBitmap::height const):
(WebCore::ImageBitmap::updateMemoryCost):
(WebCore::ImageBitmap::~ImageBitmap): Deleted.
(WebCore::ImageBitmap::takeImageBitmapBacking): Deleted.
* Source/WebCore/html/ImageBitmap.h:
(WebCore::DetachedImageBitmap::memoryCost const):
* Source/WebCore/html/ImageBitmapBacking.cpp: Removed.
* Source/WebCore/html/ImageBitmapBacking.h: Removed.
* Source/WebCore/html/OffscreenCanvas.cpp:
(WebCore::OffscreenCanvas::transferToImageBitmap):
* Source/WebCore/platform/graphics/ImageBuffer.cpp:
* Source/WebCore/platform/graphics/ImageBuffer.h:
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:
* Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferProxy.h:

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




More information about the webkit-changes mailing list