Skip to content

Commit

Permalink
Remove tracking of content-supplied colors in canvas
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=264786
rdar://118367460

Reviewed by Chris Dumez.

Updating m_suppliedColors shows up on profiles, and this is unused, so remove it.

* Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp:
(WebCore::CanvasRenderingContext2DBase::setFillStyle):
* Source/WebCore/html/canvas/CanvasRenderingContext2DBase.h:
(WebCore::CanvasRenderingContext2DBase::suppliedColors const): Deleted.

Canonical link: https://commits.webkit.org/270686@main
  • Loading branch information
smfr committed Nov 14, 2023
1 parent e7f7e51 commit 7a1c0ae
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
9 changes: 1 addition & 8 deletions Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -520,16 +520,9 @@ void CanvasRenderingContext2DBase::setFillStyle(CanvasStyle style)
GraphicsContext* c = drawingContext();
if (!c)
return;

state.fillStyle.applyFillColor(*c);
state.unparsedFillColor = String();

if (!style.srgbaColor())
return;
if (auto color = style.srgbaColor()->tryGetAsSRGBABytes()) {
auto colorValue { PackedColor::RGBA { *color }.value };
if (m_suppliedColors.isValidValue(colorValue))
m_suppliedColors.add(colorValue);
}
}

void CanvasRenderingContext2DBase::setLineWidth(double width)
Expand Down
3 changes: 0 additions & 3 deletions Source/WebCore/html/canvas/CanvasRenderingContext2DBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,6 @@ class CanvasRenderingContext2DBase : public CanvasRenderingContext, public Canva
using Direction = CanvasDirection;
void setDirection(Direction);

const HashSet<uint32_t>& suppliedColors() const { return m_suppliedColors; }

class FontProxy final : public FontSelectorClient {
public:
FontProxy() = default;
Expand Down Expand Up @@ -455,7 +453,6 @@ class CanvasRenderingContext2DBase : public CanvasRenderingContext, public Canva
FloatRect m_dirtyRect;
unsigned m_unrealizedSaveCount { 0 };
bool m_usesCSSCompatibilityParseMode;
HashSet<uint32_t> m_suppliedColors;
mutable std::optional<CachedImageData> m_cachedImageData;
CanvasRenderingContext2DSettings m_settings;
};
Expand Down

0 comments on commit 7a1c0ae

Please sign in to comment.