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

Unified Diff: Source/modules/canvas2d/CanvasRenderingContext2D.cpp

Issue 1299323005: blink: Add backdrop-filter support (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: removed some todos Created 5 years, 4 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/modules/canvas2d/CanvasRenderingContext2D.cpp
diff --git a/Source/modules/canvas2d/CanvasRenderingContext2D.cpp b/Source/modules/canvas2d/CanvasRenderingContext2D.cpp
index 4e3e06d2f42195553adec4d946b0c6b8eb677e55..df3a881ba7f81f8a6804b825b0acf515fff440e0 100644
--- a/Source/modules/canvas2d/CanvasRenderingContext2D.cpp
+++ b/Source/modules/canvas2d/CanvasRenderingContext2D.cpp
@@ -663,6 +663,25 @@ void CanvasRenderingContext2D::setFilter(const String& filterString)
modifiableState().setFilter(filterValue.release());
}
+String CanvasRenderingContext2D::backdropFilter() const
+{
+ return state().unparsedBackdropFilter();
+}
+
+void CanvasRenderingContext2D::setBackdropFilter(const String& backdropFilterString)
+{
+ if (backdropFilterString == state().unparsedBackdropFilter())
+ return;
+
+ RefPtrWillBeRawPtr<CSSValue> backdropFilterValue = CSSParser::parseSingleValue(CSSPropertyBackdropFilter, backdropFilterString, CSSParserContext(HTMLStandardMode, 0));
+
+ if (!backdropFilterValue || backdropFilterValue->isInitialValue() || backdropFilterValue->isInheritedValue())
+ return;
+
+ modifiableState().setUnparsedBackdropFilter(backdropFilterString);
+ modifiableState().setBackdropFilter(backdropFilterValue.release());
+}
+
PassRefPtrWillBeRawPtr<SVGMatrixTearOff> CanvasRenderingContext2D::currentTransform() const
{
return SVGMatrixTearOff::create(state().transform());

Powered by Google App Engine
This is Rietveld 408576698