Changeset 217748 in webkit
- Timestamp:
- Jun 2, 2017 7:27:27 PM (7 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r217742 r217748 1 2017-06-02 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 REGRESSION(r216212): RenderReplaced::paint() should not save and restore the context unless it has to 4 https://bugs.webkit.org/show_bug.cgi?id=172883 5 <rdar://problem/32548614> 6 7 Reviewed by Tim Horton. 8 9 After implementing dragged content fading, RenderReplace::paint is now always guarded by unnecessary calls to 10 GraphicsContext::save and GraphicsContext::restore, even when there is no dragged content being rendered. To 11 address this, we initialize our GraphicsContextStateSaver with saveAndRestore = false, indicating that we don't 12 want to immediately try and save the context. 13 14 If we are in a dragged content range, we will then call GraphicsContextStateSaver::save, which saves the 15 graphics context and also causes the GraphicsContextStateSaver to eventually try and restore() when it is 16 destroyed. Otherwise, in the common codepath where the renderer is not in a dragged content range, the 17 constructor and destructor of GraphicsContextStateSaver will be no-ops with respect to saving and restoring the 18 graphics context. 19 20 * rendering/RenderReplaced.cpp: 21 (WebCore::RenderReplaced::paint): 22 1 23 2017-06-02 Myles C. Maxfield <mmaxfield@apple.com> 2 24 -
trunk/Source/WebCore/rendering/RenderReplaced.cpp
r216212 r217748 160 160 #endif 161 161 162 GraphicsContextStateSaver savedGraphicsContext(paintInfo.context() );162 GraphicsContextStateSaver savedGraphicsContext(paintInfo.context(), false); 163 163 if (element() && element()->parentOrShadowHostElement()) { 164 164 auto* parentContainer = element()->parentOrShadowHostElement(); 165 if (draggedContentContainsReplacedElement(document().markers().markersFor(parentContainer, DocumentMarker::DraggedContent), *element())) 165 if (draggedContentContainsReplacedElement(document().markers().markersFor(parentContainer, DocumentMarker::DraggedContent), *element())) { 166 savedGraphicsContext.save(); 166 167 paintInfo.context().setAlpha(0.25); 168 } 167 169 } 168 170
Note: See TracChangeset
for help on using the changeset viewer.