[webkit-changes] [WebKit/WebKit] f64219: CanvasBase constructs the backing store as Display...

Kimmo Kinnunen noreply at github.com
Thu Sep 7 23:45:53 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: f64219027be91844d857f05ae6ef8b6a4a85ad23
      https://github.com/WebKit/WebKit/commit/f64219027be91844d857f05ae6ef8b6a4a85ad23
  Author: Kimmo Kinnunen <kkinnunen at apple.com>
  Date:   2023-09-07 (Thu, 07 Sep 2023)

  Changed paths:
    M Source/WebCore/html/CanvasBase.cpp
    M Source/WebCore/html/CanvasBase.h
    M Source/WebCore/html/HTMLCanvasElement.cpp
    M Source/WebCore/html/HTMLCanvasElement.h
    M Source/WebCore/html/OffscreenCanvas.cpp
    M Source/WebCore/testing/Internals.cpp

  Log Message:
  -----------
  CanvasBase constructs the backing store as DisplayList::ImageBuffer in some cases
https://bugs.webkit.org/show_bug.cgi?id=261276
rdar://problem/115116912

Reviewed by Matt Woodrow.

Using DisplayList::ImageBuffer for Context2D backing stores is problematic:
- DisplayListDrawingEnabled setting is about render layer backing
  stores being display listed, not the contents of the context
  rendering.

- Internals::setElementUsesDisplayListDrawing() would set the display
  listing of HTMLCanvasElement, but it didn't have the mechanism to
  observe the list. In general case, it is also impossible (see
  getImageData/putImageData below).

- Context2D cannot support display lists, as putImageData is not
  supported and getImageData would need to flatten the list. This
  Makes the code quite buggy.

- CanvasRenderingContex2DBase already has a setting to record display
  lists for CustomPaintCanvas. Passing this setting to
  CanvasBase::allocateImageBuffer() was confusing and wrong, as
  CustomPaintCanvas does ad hoc overrides so that the buffer is never
  used.

Remove the ability to create tahe CanvasBase::m_buffer (context2d
backing store) as a DisplayList::ImageBuffer.

* Source/WebCore/html/CanvasBase.cpp:
(WebCore::CanvasBase::allocateImageBuffer const):
* Source/WebCore/html/CanvasBase.h:
* Source/WebCore/html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::createImageBuffer const):
(WebCore::HTMLCanvasElement::setUsesDisplayListDrawing): Deleted.
* Source/WebCore/html/HTMLCanvasElement.h:
* Source/WebCore/html/OffscreenCanvas.cpp:
(WebCore::OffscreenCanvas::transferToImageBitmap):
(WebCore::OffscreenCanvas::createImageBuffer const):
* Source/WebCore/testing/Internals.cpp:
(WebCore::Internals::setElementUsesDisplayListDrawing):

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




More information about the webkit-changes mailing list