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

  Changed paths:
    M Source/WebCore/html/CanvasBase.cpp
    M Source/WebCore/html/CanvasBase.h
    M Source/WebCore/html/HTMLCanvasElement.idl
    M Source/WebCore/html/OffscreenCanvas.idl
    M Source/WebCore/html/canvas/CanvasRenderingContext.cpp
    M Source/WebCore/html/canvas/CanvasRenderingContext.h
    M Source/WebCore/html/canvas/CanvasRenderingContext2D.idl
    M Source/WebCore/html/canvas/GPUCanvasContext.idl
    M Source/WebCore/html/canvas/ImageBitmapRenderingContext.idl
    M Source/WebCore/html/canvas/OffscreenCanvasRenderingContext2D.idl
    M Source/WebCore/html/canvas/WebGL2RenderingContext.idl
    M Source/WebCore/html/canvas/WebGLRenderingContext.idl
    M Source/WebCore/inspector/InspectorCanvas.cpp
    M Source/WebCore/inspector/agents/InspectorCanvasAgent.cpp

  Log Message:
  -----------
  Move memory cost reporting to canvas rendering contexts
https://bugs.webkit.org/show_bug.cgi?id=306608
rdar://169256162

Reviewed by Simon Fraser.

Before, the canvas element or offscreen canvas object would report the
memory cost The rendering context holds the resources and the cost is
per rendering context type.

This simplifies moving the ImageBuffer to CanvasRenderingContext2DBase.
The current memory cost is bound to the image buffer size, and this is
wildly inaccurate for WebGL and WebGPU. This will be fixed later.

* Source/WebCore/html/CanvasBase.cpp:
(WebCore::CanvasBase::setImageBuffer const):
(WebCore::CanvasBase::memoryCost const): Deleted.
(WebCore::CanvasBase::externalMemoryCost const): Deleted.
* Source/WebCore/html/CanvasBase.h:
* Source/WebCore/html/HTMLCanvasElement.idl:
* Source/WebCore/html/OffscreenCanvas.idl:
* Source/WebCore/html/canvas/CanvasRenderingContext.cpp:
(WebCore::CanvasRenderingContext::updateMemoryCostOnAllocation):
(WebCore::CanvasRenderingContext::memoryCost const):
(WebCore::CanvasRenderingContext::externalMemoryCost const):
* Source/WebCore/html/canvas/CanvasRenderingContext.h:
* Source/WebCore/html/canvas/CanvasRenderingContext2D.idl:
* Source/WebCore/html/canvas/GPUCanvasContext.idl:
* Source/WebCore/html/canvas/ImageBitmapRenderingContext.idl:
* Source/WebCore/html/canvas/OffscreenCanvasRenderingContext2D.idl:
* Source/WebCore/html/canvas/WebGL2RenderingContext.idl:
* Source/WebCore/html/canvas/WebGLRenderingContext.idl:
* Source/WebCore/inspector/InspectorCanvas.cpp:
(WebCore::InspectorCanvas::buildObjectForCanvas):
* Source/WebCore/inspector/agents/InspectorCanvasAgent.cpp:
(WebCore::InspectorCanvasAgent::didChangeCanvasMemory):

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



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

Reply via email to