Skip to content
Permalink
Browse files
Remove unused display list item apply functions
https://bugs.webkit.org/show_bug.cgi?id=241771

Reviewed by Wenson Hsieh.

* Source/WebCore/platform/graphics/displaylists/DisplayListItemBuffer.cpp:
(WebCore::DisplayList::ItemHandle::apply):
* Source/WebCore/platform/graphics/displaylists/DisplayListItems.cpp:
(WebCore::DisplayList::PaintFrameForMedia::PaintFrameForMedia):
(WebCore::DisplayList::DrawFilteredImageBuffer::apply const): Deleted.
(WebCore::DisplayList::PaintFrameForMedia::apply const): Deleted.
* Source/WebCore/platform/graphics/displaylists/DisplayListItems.h:

Canonical link: https://commits.webkit.org/251674@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@295669 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
heycam committed Jun 20, 2022
1 parent f4990df commit 4902b1ccb5b13c95f08393d2670cd8f1920ec181
Showing 3 changed files with 6 additions and 47 deletions.
@@ -101,7 +101,7 @@ void ItemHandle::apply(GraphicsContext& context)
get<ClipOut>().apply(context);
return;
case ItemType::ClipToImageBuffer:
get<ClipToImageBuffer>().apply(context);
ASSERT_NOT_REACHED();
return;
case ItemType::ClipOutToPath:
get<ClipOutToPath>().apply(context);
@@ -110,7 +110,7 @@ void ItemHandle::apply(GraphicsContext& context)
get<ClipPath>().apply(context);
return;
case ItemType::DrawFilteredImageBuffer:
get<DrawFilteredImageBuffer>().apply(context);
ASSERT_NOT_REACHED();
return;
case ItemType::DrawGlyphs:
ASSERT_NOT_REACHED();
@@ -119,16 +119,16 @@ void ItemHandle::apply(GraphicsContext& context)
ASSERT_NOT_REACHED();
return;
case ItemType::DrawImageBuffer:
get<DrawImageBuffer>().apply(context);
ASSERT_NOT_REACHED();
return;
case ItemType::DrawNativeImage:
get<DrawNativeImage>().apply(context);
ASSERT_NOT_REACHED();
return;
case ItemType::DrawSystemImage:
get<DrawSystemImage>().apply(context);
return;
case ItemType::DrawPattern:
get<DrawPattern>().apply(context);
ASSERT_NOT_REACHED();
return;
case ItemType::DrawRect:
get<DrawRect>().apply(context);
@@ -194,7 +194,7 @@ void ItemHandle::apply(GraphicsContext& context)
return;
#if ENABLE(VIDEO)
case ItemType::PaintFrameForMedia:
get<PaintFrameForMedia>().apply(context);
ASSERT_NOT_REACHED();
return;
#endif
case ItemType::StrokeRect:
@@ -140,11 +140,6 @@ void ClipOut::apply(GraphicsContext& context) const
context.clipOut(m_rect);
}

NO_RETURN_DUE_TO_ASSERT void ClipToImageBuffer::apply(GraphicsContext&) const
{
ASSERT_NOT_REACHED();
}

void ClipToImageBuffer::apply(GraphicsContext& context, WebCore::ImageBuffer& imageBuffer) const
{
context.clipToImageBuffer(imageBuffer, m_destinationRect);
@@ -167,11 +162,6 @@ DrawFilteredImageBuffer::DrawFilteredImageBuffer(std::optional<RenderingResource
{
}

NO_RETURN_DUE_TO_ASSERT void DrawFilteredImageBuffer::apply(GraphicsContext&) const
{
ASSERT_NOT_REACHED();
}

void DrawFilteredImageBuffer::apply(GraphicsContext& context, ImageBuffer* sourceImage, FilterResults& results)
{
context.drawFilteredImageBuffer(sourceImage, m_sourceImageRect, m_filter, results);
@@ -201,21 +191,11 @@ void DrawDecomposedGlyphs::apply(GraphicsContext& context, const Font& font, con
return context.drawDecomposedGlyphs(font, decomposedGlyphs);
}

NO_RETURN_DUE_TO_ASSERT void DrawImageBuffer::apply(GraphicsContext&) const
{
ASSERT_NOT_REACHED();
}

void DrawImageBuffer::apply(GraphicsContext& context, WebCore::ImageBuffer& imageBuffer) const
{
context.drawImageBuffer(imageBuffer, m_destinationRect, m_srcRect, m_options);
}

NO_RETURN_DUE_TO_ASSERT void DrawNativeImage::apply(GraphicsContext&) const
{
ASSERT_NOT_REACHED();
}

void DrawNativeImage::apply(GraphicsContext& context, NativeImage& image) const
{
context.drawNativeImage(image, m_imageSize, m_destinationRect, m_srcRect, m_options);
@@ -237,11 +217,6 @@ DrawPattern::DrawPattern(RenderingResourceIdentifier imageIdentifier, const Floa
{
}

NO_RETURN_DUE_TO_ASSERT void DrawPattern::apply(GraphicsContext&) const
{
ASSERT_NOT_REACHED();
}

void DrawPattern::apply(GraphicsContext& context, SourceImage& sourceImage) const
{
if (auto image = sourceImage.nativeImageIfExists()) {
@@ -435,13 +410,6 @@ PaintFrameForMedia::PaintFrameForMedia(MediaPlayer& player, const FloatRect& des
, m_destination(destination)
{
}

NO_RETURN_DUE_TO_ASSERT void PaintFrameForMedia::apply(GraphicsContext&) const
{
// Should be handled by the delegate.
ASSERT_NOT_REACHED();
}

#endif

std::optional<FloatRect> StrokeRect::localBounds(const GraphicsContext&) const
@@ -449,8 +449,6 @@ class ClipToImageBuffer {

WEBCORE_EXPORT void apply(GraphicsContext&, ImageBuffer&) const;

NO_RETURN_DUE_TO_ASSERT void apply(GraphicsContext&) const;

private:
RenderingResourceIdentifier m_imageBufferIdentifier;
FloatRect m_destinationRect;
@@ -565,7 +563,6 @@ class DrawFilteredImageBuffer {
std::optional<RenderingResourceIdentifier> sourceImageIdentifier() const { return m_sourceImageIdentifier; }
FloatRect sourceImageRect() const { return m_sourceImageRect; }

NO_RETURN_DUE_TO_ASSERT void apply(GraphicsContext&) const;
WEBCORE_EXPORT void apply(GraphicsContext&, ImageBuffer* sourceImage, FilterResults&);

std::optional<FloatRect> globalBounds() const { return std::nullopt; }
@@ -684,8 +681,6 @@ class DrawImageBuffer {

WEBCORE_EXPORT void apply(GraphicsContext&, ImageBuffer&) const;

NO_RETURN_DUE_TO_ASSERT void apply(GraphicsContext&) const;

std::optional<FloatRect> globalBounds() const { return std::nullopt; }
std::optional<FloatRect> localBounds(const GraphicsContext&) const { return m_destinationRect; }

@@ -717,7 +712,6 @@ class DrawNativeImage {
// FIXME: We might want to validate ImagePaintingOptions.
bool isValid() const { return m_imageIdentifier.isValid(); }

NO_RETURN_DUE_TO_ASSERT void apply(GraphicsContext&) const;
WEBCORE_EXPORT void apply(GraphicsContext&, NativeImage&) const;

std::optional<FloatRect> globalBounds() const { return std::nullopt; }
@@ -803,7 +797,6 @@ class DrawPattern {
// FIXME: We might want to validate ImagePaintingOptions.
bool isValid() const { return m_imageIdentifier.isValid(); }

NO_RETURN_DUE_TO_ASSERT void apply(GraphicsContext&) const;
WEBCORE_EXPORT void apply(GraphicsContext&, SourceImage&) const;

std::optional<FloatRect> globalBounds() const { return std::nullopt; }
@@ -1713,8 +1706,6 @@ class PaintFrameForMedia {

bool isValid() const { return m_identifier.isValid(); }

NO_RETURN_DUE_TO_ASSERT void apply(GraphicsContext&) const;

std::optional<FloatRect> localBounds(const GraphicsContext&) const { return std::nullopt; }
std::optional<FloatRect> globalBounds() const { return { m_destination }; }

0 comments on commit 4902b1c

Please sign in to comment.