Skip to content

Commit

Permalink
Cleanup NamedImageGeneratedImage
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=264874

Reviewed by Simon Fraser.

As far as I can tell 176071@main forgot to enable drawPattern() for iOS
platforms. Furthermore, USE(NEW_THEME) || PLATFORM(IOS_FAMILY) is
essentially all platforms and all platforms support Theme, so again, as
far as I can tell, there's no need for these conditionals.

* Source/WebCore/platform/graphics/NamedImageGeneratedImage.cpp:
(WebCore::NamedImageGeneratedImage::draw):
(WebCore::NamedImageGeneratedImage::drawPattern):

Canonical link: https://commits.webkit.org/270770@main
  • Loading branch information
annevk committed Nov 15, 2023
1 parent 04402fa commit 75ca104
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions Source/WebCore/platform/graphics/NamedImageGeneratedImage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ NamedImageGeneratedImage::NamedImageGeneratedImage(String name, const FloatSize&

ImageDrawResult NamedImageGeneratedImage::draw(GraphicsContext& context, const FloatRect& dstRect, const FloatRect& srcRect, ImagePaintingOptions options)
{
#if USE(NEW_THEME) || PLATFORM(IOS_FAMILY)
GraphicsContextStateSaver stateSaver(context);
context.setCompositeOperation(options.compositeOperator(), options.blendMode());
context.clip(dstRect);
Expand All @@ -53,18 +52,10 @@ ImageDrawResult NamedImageGeneratedImage::draw(GraphicsContext& context, const F

Theme::singleton().drawNamedImage(m_name, context, dstRect.size());
return ImageDrawResult::DidDraw;
#else
UNUSED_PARAM(context);
UNUSED_PARAM(dstRect);
UNUSED_PARAM(srcRect);
UNUSED_PARAM(options);
return ImageDrawResult::DidNothing;
#endif
}

void NamedImageGeneratedImage::drawPattern(GraphicsContext& context, const FloatRect& dstRect, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, const FloatSize& spacing, ImagePaintingOptions options)
{
#if USE(NEW_THEME)
auto imageBuffer = context.createAlignedImageBuffer(size());
if (!imageBuffer)
return;
Expand All @@ -74,15 +65,6 @@ void NamedImageGeneratedImage::drawPattern(GraphicsContext& context, const Float

// Tile the image buffer into the context.
context.drawPattern(*imageBuffer, dstRect, srcRect, patternTransform, phase, spacing, options);
#else
UNUSED_PARAM(context);
UNUSED_PARAM(dstRect);
UNUSED_PARAM(srcRect);
UNUSED_PARAM(patternTransform);
UNUSED_PARAM(phase);
UNUSED_PARAM(spacing);
UNUSED_PARAM(options);
#endif
}

void NamedImageGeneratedImage::dump(TextStream& ts) const
Expand Down

0 comments on commit 75ca104

Please sign in to comment.