Skip to content

Commit

Permalink
[Skia] Implement GraphicsContextSkia::fillRect() for gradient
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=270845

Reviewed by Carlos Garcia Campos.

* Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp:
(WebCore::GraphicsContextSkia::createBaseFillPaint const):
(WebCore::GraphicsContextSkia::createFillPaint const):
(WebCore::GraphicsContextSkia::fillRect):
* Source/WebCore/platform/graphics/skia/GraphicsContextSkia.h:

Canonical link: https://commits.webkit.org/276339@main
  • Loading branch information
Scony authored and carlosgcampos committed Mar 19, 2024
1 parent 4a8cfe4 commit d47ca88
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -508,9 +508,15 @@ void GraphicsContextSkia::fillRect(const FloatRect& boundaries, const Color& fil
canvas().drawRect(boundaries, paint);
}

void GraphicsContextSkia::fillRect(const FloatRect&, Gradient&, const AffineTransform&)
void GraphicsContextSkia::fillRect(const FloatRect& boundaries, Gradient& gradient, const AffineTransform& gradientSpaceTransform)
{
notImplemented();
if (!makeGLContextCurrentIfNeeded())
return;

SkPaint paint = createFillPaint();
paint.setShader(gradient.shader(alpha(), gradientSpaceTransform));
paint.setImageFilter(createDropShadowFilterIfNeeded(ShadowStyle::Outset));
canvas().drawRect(boundaries, paint);
}

void GraphicsContextSkia::resetClip()
Expand Down

0 comments on commit d47ca88

Please sign in to comment.