| Index: Source/core/html/canvas/CanvasRenderingContext2D.cpp
|
| diff --git a/Source/core/html/canvas/CanvasRenderingContext2D.cpp b/Source/core/html/canvas/CanvasRenderingContext2D.cpp
|
| index f06b7c6a5c8343a301221eb517d696ba5e7d3e84..9d449e73b5e2abe5a14eb40d7ffe0382c4d335ee 100644
|
| --- a/Source/core/html/canvas/CanvasRenderingContext2D.cpp
|
| +++ b/Source/core/html/canvas/CanvasRenderingContext2D.cpp
|
| @@ -258,6 +258,7 @@ CanvasRenderingContext2D::State::State()
|
| , m_textBaseline(AlphabeticTextBaseline)
|
| , m_unparsedFont(defaultFont)
|
| , m_realizedFont(false)
|
| + , m_hasClip(false)
|
| {
|
| }
|
|
|
| @@ -287,6 +288,7 @@ CanvasRenderingContext2D::State::State(const State& other)
|
| , m_unparsedFont(other.m_unparsedFont)
|
| , m_font(other.m_font)
|
| , m_realizedFont(other.m_realizedFont)
|
| + , m_hasClip(other.m_hasClip)
|
| {
|
| if (m_realizedFont)
|
| static_cast<CSSFontSelector*>(m_font.fontSelector())->registerForInvalidationCallbacks(this);
|
| @@ -325,6 +327,7 @@ CanvasRenderingContext2D::State& CanvasRenderingContext2D::State::operator=(cons
|
| m_unparsedFont = other.m_unparsedFont;
|
| m_font = other.m_font;
|
| m_realizedFont = other.m_realizedFont;
|
| + m_hasClip = other.m_hasClip;
|
|
|
| if (m_realizedFont)
|
| static_cast<CSSFontSelector*>(m_font.fontSelector())->registerForInvalidationCallbacks(this);
|
| @@ -1096,6 +1099,7 @@ void CanvasRenderingContext2D::clipInternal(const Path& path, const String& wind
|
|
|
| realizeSaves();
|
| c->canvasClip(path, parseWinding(windingRuleString));
|
| + modifiableState().m_hasClip = true;
|
| }
|
|
|
| void CanvasRenderingContext2D::clip(const String& windingRuleString)
|
| @@ -2385,7 +2389,7 @@ void CanvasRenderingContext2D::addHitRegion(const Dictionary& options, Exception
|
| Path specifiedPath = m_path;
|
| specifiedPath.transform(state().m_transform);
|
|
|
| - if (context->isClipMode()) {
|
| + if (hasClip()) {
|
| // FIXME: The hit regions should take clipping region into account.
|
| // However, we have no way to get the region from canvas state stack by now.
|
| // See http://crbug.com/387057
|
|
|