Skip to content

Commit

Permalink
[Skia] fast/canvas/canvas-webkitLineDash-invalid.html is crashing
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=270633

Reviewed by Carlos Garcia Campos.

The assert in setLineDash() is problematic because setting
canvas.webkitLineDash with an odd-sized vector will pass
it down unchecked (contrary to using canvas.setLineDash(), which
will double the size in that case). Skia can handle an odd-sized
vector just fine, so there's no need for this assert.

This fixes the crashing fast/canvas/canvas-webkitLineDash-invalid.html
test, caused by the assert.

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

Canonical link: https://commits.webkit.org/275787@main
  • Loading branch information
csaavedra committed Mar 7, 2024
1 parent 755898f commit 338528b
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
Expand Up @@ -671,8 +671,6 @@ void GraphicsContextSkia::setLineCap(LineCap lineCap)

void GraphicsContextSkia::setLineDash(const DashArray& dashArray, float dashOffset)
{
ASSERT(!(dashArray.size() % 2));

if (dashArray.isEmpty()) {
m_skiaState.m_stroke.dash = nullptr;
return;
Expand Down

0 comments on commit 338528b

Please sign in to comment.