Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: a8f55217363bef328ce1a3a61003ce7ce4d4e2e3
      
https://github.com/WebKit/WebKit/commit/a8f55217363bef328ce1a3a61003ce7ce4d4e2e3
  Author: Kimmo Kinnunen <kkinnu...@apple.com>
  Date:   2023-09-13 (Wed, 13 Sep 2023)

  Changed paths:
    M Source/WebCore/dom/Document.cpp
    M Source/WebCore/dom/Document.h
    M Source/WebCore/dom/ScriptExecutionContext.h
    M Source/WebCore/html/CanvasBase.cpp
    M Source/WebCore/html/CanvasBase.h
    M Source/WebCore/html/ImageBitmap.cpp
    M Source/WebCore/html/ImageBitmapBacking.cpp
    M Source/WebCore/html/OffscreenCanvas.cpp
    M Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp
    M Source/WebCore/platform/GraphicsClient.h
    M Source/WebCore/platform/graphics/ImageBuffer.cpp
    M Source/WebCore/platform/graphics/ImageBuffer.h
    M Source/WebCore/workers/WorkerGlobalScope.cpp
    M Source/WebCore/workers/WorkerGlobalScope.h

  Log Message:
  -----------
  Expose GraphicsClient through ScriptExecutionContext
https://bugs.webkit.org/show_bug.cgi?id=261272
rdar://115108907

Reviewed by Matt Woodrow.

Expose GraphicsClient through ScriptExecutionContext

All DOM objects that construct graphics objects must do so via a
factory that is able to create graphics objects (either local or
remote). This factory interface is GraphicsClient.

The objects obtain the instance via ScriptExecutionContext, either:
- Document (via Chrome)
- WorkerGlobalScope (via WorkerClient)

Add ScriptExecutionContext::graphicsClient() to avoid doing various
error-prone downcasting sequences.

Make SerializedImageBuffer::sinkIntoImageBuffer() a similar function
to ImageBuffer::create(), where the polymorphism is added with
the GraphicsClient* and in-process variant is invoked if
the instance is nullptr.

* Source/WebCore/dom/Document.cpp:
(WebCore::Document::graphicsClient):
* Source/WebCore/dom/Document.h:
* Source/WebCore/dom/ScriptExecutionContext.h:
(WebCore::ScriptExecutionContext::graphicsClient):
* Source/WebCore/html/CanvasBase.cpp:
(WebCore::CanvasBase::allocateImageBuffer const):
(WebCore::CanvasBase::graphicsClient const): Deleted.
* Source/WebCore/html/CanvasBase.h:
* Source/WebCore/html/ImageBitmap.cpp:
(WebCore::ImageBitmap::createImageBuffer):
* Source/WebCore/html/ImageBitmapBacking.cpp:
(WebCore::ImageBitmapBacking::connect):
* Source/WebCore/html/OffscreenCanvas.cpp:
(WebCore::DetachedOffscreenCanvas::takeImageBuffer):
(WebCore::OffscreenCanvas::pushBufferToPlaceholder):
* Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::create):
(WebCore::WebGLRenderingContextBase::maybeRestoreContext):
* Source/WebCore/platform/GraphicsClient.h:
* Source/WebCore/platform/graphics/ImageBuffer.cpp:
(WebCore::SerializedImageBuffer::sinkIntoImageBuffer):
* Source/WebCore/platform/graphics/ImageBuffer.h:
* Source/WebCore/workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::graphicsClient):
* Source/WebCore/workers/WorkerGlobalScope.h:

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


_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to