Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(319)

Unified Diff: Source/core/html/canvas/CanvasRenderingContext2D.cpp

Issue 352793006: context.addHitRegion() is not working when using transform operation. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: state stack Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/html/canvas/CanvasRenderingContext2D.h ('k') | Source/platform/graphics/GraphicsContext.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « Source/core/html/canvas/CanvasRenderingContext2D.h ('k') | Source/platform/graphics/GraphicsContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698