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

Side by Side 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, 7 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 2 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 static void ClientDestroyed(LayoutObject*); 55 static void ClientDestroyed(LayoutObject*);
56 56
57 // Called from all SVG layoutObjects layout() methods. 57 // Called from all SVG layoutObjects layout() methods.
58 static void ClientLayoutChanged(LayoutObject*); 58 static void ClientLayoutChanged(LayoutObject*);
59 59
60 // Called from all SVG layoutObjects styleDidChange() methods. 60 // Called from all SVG layoutObjects styleDidChange() methods.
61 static void ClientStyleChanged(LayoutObject*, 61 static void ClientStyleChanged(LayoutObject*,
62 StyleDifference, 62 StyleDifference,
63 const ComputedStyle& new_style); 63 const ComputedStyle& new_style);
64 64
65 class TemporaryStyleScope {
66 WTF_MAKE_NONCOPYABLE(TemporaryStyleScope);
67 STACK_ALLOCATED();
68
69 public:
70 TemporaryStyleScope(LayoutObject&,
71 const ComputedStyle& original_style,
72 const ComputedStyle& temporary_style);
73 ~TemporaryStyleScope() { SwitchTo(original_style_); }
74
75 private:
76 void SwitchTo(const ComputedStyle&);
77
78 LayoutObject& layout_object_;
79 const ComputedStyle& original_style_;
80 const bool styles_are_equal_;
81 };
82
65 private: 83 private:
66 void AddResourcesFromLayoutObject(LayoutObject*, const ComputedStyle&); 84 void AddResourcesFromLayoutObject(LayoutObject*, const ComputedStyle&);
67 void RemoveResourcesFromLayoutObject(LayoutObject*); 85 void RemoveResourcesFromLayoutObject(LayoutObject*);
68 86
69 typedef HashMap<const LayoutObject*, std::unique_ptr<SVGResources>> CacheMap; 87 typedef HashMap<const LayoutObject*, std::unique_ptr<SVGResources>> CacheMap;
70 CacheMap cache_; 88 CacheMap cache_;
71 }; 89 };
72 90
73 } // namespace blink 91 } // namespace blink
74 92
75 #endif 93 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698