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

Unified Diff: third_party/WebKit/Source/core/layout/svg/SVGResourcesCache.h

Issue 2846513002: More targeted resource-switching mechanism for SVG selection painting (Closed)
Patch Set: Use rALAP instead of first rAF Created 3 years, 8 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/layout/svg/SVGResourcesCache.h
diff --git a/third_party/WebKit/Source/core/layout/svg/SVGResourcesCache.h b/third_party/WebKit/Source/core/layout/svg/SVGResourcesCache.h
index 254c1359484696d8c716ac1973e30f587e1b0d25..66ed2e85b9e71be90ac94bcdc8dfc6a4d0b2b8d1 100644
--- a/third_party/WebKit/Source/core/layout/svg/SVGResourcesCache.h
+++ b/third_party/WebKit/Source/core/layout/svg/SVGResourcesCache.h
@@ -62,6 +62,24 @@ class SVGResourcesCache {
StyleDifference,
const ComputedStyle& new_style);
+ class TemporaryStyleScope {
+ WTF_MAKE_NONCOPYABLE(TemporaryStyleScope);
+ STACK_ALLOCATED();
+
+ public:
+ TemporaryStyleScope(LayoutObject&,
+ const ComputedStyle& original_style,
+ const ComputedStyle& temporary_style);
+ ~TemporaryStyleScope() { SwitchTo(original_style_); }
+
+ private:
+ void SwitchTo(const ComputedStyle&);
+
+ LayoutObject& layout_object_;
+ const ComputedStyle& original_style_;
+ const bool styles_are_equal_;
+ };
+
private:
void AddResourcesFromLayoutObject(LayoutObject*, const ComputedStyle&);
void RemoveResourcesFromLayoutObject(LayoutObject*);

Powered by Google App Engine
This is Rietveld 408576698