summaryrefslogtreecommitdiffstats
path: root/WebCore/html/canvas/CanvasStyle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/html/canvas/CanvasStyle.cpp')
-rw-r--r--WebCore/html/canvas/CanvasStyle.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/WebCore/html/canvas/CanvasStyle.cpp b/WebCore/html/canvas/CanvasStyle.cpp
index 1ae5236..52b31c8 100644
--- a/WebCore/html/canvas/CanvasStyle.cpp
+++ b/WebCore/html/canvas/CanvasStyle.cpp
@@ -144,6 +144,26 @@ bool CanvasStyle::isEquivalentColor(const CanvasStyle& other) const
return false;
}
+bool CanvasStyle::isEquivalentColor(float r, float g, float b, float a) const
+{
+ if (m_type != RGBA)
+ return false;
+
+ return m_rgba == makeRGBA32FromFloats(r, g, b, a);
+}
+
+bool CanvasStyle::isEquivalentColor(float c, float m, float y, float k, float a) const
+{
+ if (m_type != CMYKA)
+ return false;
+
+ return c == m_cmyka.c
+ && m == m_cmyka.m
+ && y == m_cmyka.y
+ && k == m_cmyka.k
+ && a == m_cmyka.a;
+}
+
void CanvasStyle::applyStrokeColor(GraphicsContext* context)
{
if (!context)