[webkit-changes] [WebKit/WebKit] cd61c8: [Skia] Implement dashed lines support

Georges Basile Stavracas Neto noreply at github.com
Thu Feb 15 13:15:51 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: cd61c8608c6c65738c722254a49f2a6a0e8ae39c
      https://github.com/WebKit/WebKit/commit/cd61c8608c6c65738c722254a49f2a6a0e8ae39c
  Author: Georges Basile Stavracas Neto <feaneron at igalia.com>
  Date:   2024-02-15 (Thu, 15 Feb 2024)

  Changed paths:
    M Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
    M Source/WebCore/platform/graphics/skia/GraphicsContextSkia.h

  Log Message:
  -----------
  [Skia] Implement dashed lines support
https://bugs.webkit.org/show_bug.cgi?id=269471

Reviewed by Adrian Perez de Castro and Don Olmstead.

Store the dash data (the array, and the offset) into an auxiliary struct
field. If populated, use that to create a SkDashPathEffect, and apply
the effect to the SkPaint used for stroke.

The constructor of SkDashPathEffect has the exact same semantics that
of the array and offset passed to GraphicsContextSkia::setLineDash(),
which makes it extra easy since no conversion needs to happen.

* Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp:
(WebCore::GraphicsContextSkia::createStrokePaint const):
(WebCore::GraphicsContextSkia::setLineDash):
* Source/WebCore/platform/graphics/skia/GraphicsContextSkia.h:

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




More information about the webkit-changes mailing list