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

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

Issue 1194733002: Adding the 'filter' context attribute to 2D canvas (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: applied corrections Created 5 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/CanvasRenderingContext2DState.h
diff --git a/Source/core/html/canvas/CanvasRenderingContext2DState.h b/Source/core/html/canvas/CanvasRenderingContext2DState.h
index d9bde289ccbe58535d52117a7e97ada8504ae474..a2c53bed23b922108b1f5edfa20916de8f9e782d 100644
--- a/Source/core/html/canvas/CanvasRenderingContext2DState.h
+++ b/Source/core/html/canvas/CanvasRenderingContext2DState.h
@@ -14,6 +14,8 @@
namespace blink {
class CanvasStyle;
+class CSSValue;
+class Element;
class CanvasRenderingContext2DState final : public NoBaseWillBeGarbageCollectedFinalized<CanvasRenderingContext2DState>, public CSSFontSelectorClient {
WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(CanvasRenderingContext2DState);
@@ -78,6 +80,12 @@ public:
void setUnparsedFont(const String& font) { m_unparsedFont = font; }
const String& unparsedFont() const { return m_unparsedFont; }
+ void setFilter(PassRefPtrWillBeRawPtr<CSSValue>);
+ void setUnparsedFilter(const String& filterString) { m_unparsedFilter = filterString; }
+ const String& unparsedFilter() const { return m_unparsedFilter; }
+ SkImageFilter* getFilter(Element*, const Font&) const;
+ bool hasFilter() const { return m_filterValue; }
+
void setStrokeStyle(PassRefPtrWillBeRawPtr<CanvasStyle>);
CanvasStyle* strokeStyle() const { return m_strokeStyle.get(); }
@@ -191,6 +199,10 @@ private:
String m_unparsedFont;
Font m_font;
+ String m_unparsedFilter;
+ RefPtrWillBeRawPtr<CSSValue> m_filterValue;
+ mutable RefPtr<SkImageFilter> m_resolvedFilter;
+
// Text state.
TextAlign m_textAlign;
TextBaseline m_textBaseline;
« no previous file with comments | « Source/core/html/canvas/CanvasRenderingContext2D.idl ('k') | Source/core/html/canvas/CanvasRenderingContext2DState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698