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

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

Issue 300223009: Implement basic parts of hit regions on canvas2d. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: add clip tests 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
Index: Source/core/html/canvas/CanvasRenderingContext2D.h
diff --git a/Source/core/html/canvas/CanvasRenderingContext2D.h b/Source/core/html/canvas/CanvasRenderingContext2D.h
index 65d883d220c9cbe7adb08e0d0ab6247d479bccee..dac937e6b776ba8c61207d1749527bd24f78392b 100644
--- a/Source/core/html/canvas/CanvasRenderingContext2D.h
+++ b/Source/core/html/canvas/CanvasRenderingContext2D.h
@@ -31,6 +31,7 @@
#include "core/html/canvas/Canvas2DContextAttributes.h"
#include "core/html/canvas/CanvasPathMethods.h"
#include "core/html/canvas/CanvasRenderingContext.h"
+#include "core/html/canvas/HitRegion.h"
#include "core/svg/SVGMatrixTearOff.h"
#include "platform/fonts/Font.h"
#include "platform/graphics/Color.h"
@@ -227,6 +228,13 @@ public:
void drawFocusIfNeeded(Element*);
void drawFocusIfNeeded(Path2D*, Element*);
+ void addHitRegion(ExceptionState&);
+ void addHitRegion(const Dictionary&, ExceptionState&);
+ void removeHitRegion(const String& id);
+ void clearHitRegions();
+ HitRegion* hitRegionAtPoint(const LayoutPoint&);
+ unsigned hitRegionsCount() const;
+
void loseContext();
void restoreContext();
@@ -333,6 +341,8 @@ private:
bool focusRingCallIsValid(const Path&, Element*);
void drawFocusRing(const Path&);
+ void addHitRegionInternal(const HitRegionOptions&, ExceptionState&);
+
void validateStateStack();
virtual bool is2d() const OVERRIDE { return true; }
@@ -344,6 +354,7 @@ private:
virtual blink::WebLayer* platformLayer() const OVERRIDE;
WillBeHeapVector<OwnPtrWillBeMember<State> > m_stateStack;
+ OwnPtrWillBeMember<HitRegionManager> m_hitRegionManager;
bool m_usesCSSCompatibilityParseMode;
bool m_hasAlpha;
bool m_isContextLost;

Powered by Google App Engine
This is Rietveld 408576698