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

Side by Side Diff: third_party/WebKit/Source/core/layout/svg/SVGResourcesCache.cpp

Issue 2846513002: More targeted resource-switching mechanism for SVG selection painting (Closed)
Patch Set: Rebased onto dependent patch(es) 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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 void SVGResourcesCache::ClientDestroyed(LayoutObject* layout_object) { 179 void SVGResourcesCache::ClientDestroyed(LayoutObject* layout_object) {
180 DCHECK(layout_object); 180 DCHECK(layout_object);
181 181
182 SVGResources* resources = CachedResourcesForLayoutObject(layout_object); 182 SVGResources* resources = CachedResourcesForLayoutObject(layout_object);
183 if (resources) 183 if (resources)
184 resources->RemoveClientFromCache(layout_object); 184 resources->RemoveClientFromCache(layout_object);
185 SVGResourcesCache& cache = ResourcesCache(layout_object->GetDocument()); 185 SVGResourcesCache& cache = ResourcesCache(layout_object->GetDocument());
186 cache.RemoveResourcesFromLayoutObject(layout_object); 186 cache.RemoveResourcesFromLayoutObject(layout_object);
187 } 187 }
188 188
189 SVGResourcesCache::TemporaryStyleScope::TemporaryStyleScope(
190 LayoutObject& layout_object,
191 const ComputedStyle& style,
192 const ComputedStyle& temporary_style)
193 : layout_object_(layout_object),
194 original_style_(style),
195 styles_are_equal_(style == temporary_style) {
196 SwitchTo(temporary_style);
197 }
198
199 void SVGResourcesCache::TemporaryStyleScope::SwitchTo(
200 const ComputedStyle& style) {
201 DCHECK(LayoutObjectCanHaveResources(&layout_object_));
202 if (styles_are_equal_)
203 return;
204 SVGResourcesCache& cache = ResourcesCache(layout_object_.GetDocument());
205 cache.RemoveResourcesFromLayoutObject(&layout_object_);
206 cache.AddResourcesFromLayoutObject(&layout_object_, style);
Stephen Chennney 2017/04/28 16:16:40 A non-trivial chunk of invalidation logic is gone
fs 2017/04/28 18:16:34 That is correct. Optimally we'd like to just produ
207 }
208
189 } // namespace blink 209 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698