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

Unified Diff: third_party/WebKit/Source/core/style/SVGComputedStyle.cpp

Issue 2326633002: Adds filter support for offscreen canvas (Closed)
Patch Set: Working version of filters on offscreen canvas Created 4 years, 3 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: third_party/WebKit/Source/core/style/SVGComputedStyle.cpp
diff --git a/third_party/WebKit/Source/core/style/SVGComputedStyle.cpp b/third_party/WebKit/Source/core/style/SVGComputedStyle.cpp
index 1034cbcb90a6331a44cd31bdc9c9fbbc4787c701..67a057f7b163aedbebf5f1933ebb575579241fc9 100644
--- a/third_party/WebKit/Source/core/style/SVGComputedStyle.cpp
+++ b/third_party/WebKit/Source/core/style/SVGComputedStyle.cpp
@@ -33,7 +33,13 @@ static const int kPaintOrderBitwidth = 2;
SVGComputedStyle::SVGComputedStyle()
{
- static SVGComputedStyle* initialStyle = new SVGComputedStyle(CreateInitial);
+ DEFINE_THREAD_SAFE_STATIC_LOCAL(ThreadSpecific<SVGComputedStyle*>, style,
esprehn 2016/09/12 20:53:12 ditto
+ new ThreadSpecific<SVGComputedStyle*>);
+ if (!*style) {
+ *style = new SVGComputedStyle(CreateInitial);
+ }
+
+ SVGComputedStyle* initialStyle = *style;
fill = initialStyle->fill;
stroke = initialStyle->stroke;
@@ -124,8 +130,12 @@ void SVGComputedStyle::copyNonInheritedFromCached(const SVGComputedStyle* other)
PassRefPtr<SVGDashArray> SVGComputedStyle::initialStrokeDashArray()
{
- DEFINE_STATIC_REF(SVGDashArray, initialDashArray, SVGDashArray::create());
- return initialDashArray;
+ DEFINE_THREAD_SAFE_STATIC_LOCAL(ThreadSpecific<SVGDashArray*>, initialDashArray,
+ new ThreadSpecific<SVGDashArray*>());
+ if (!*initialDashArray) {
+ *initialDashArray = SVGDashArray::create().leakRef();
+ }
+ return *initialDashArray;
}
StyleDifference SVGComputedStyle::diff(const SVGComputedStyle* other) const

Powered by Google App Engine
This is Rietveld 408576698