Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (c) 2009, Google Inc. All rights reserved. | 2 * Copyright (c) 2009, Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 | 32 |
| 33 #include "core/rendering/svg/RenderSVGModelObject.h" | 33 #include "core/rendering/svg/RenderSVGModelObject.h" |
| 34 | 34 |
| 35 #include "SVGNames.h" | 35 #include "SVGNames.h" |
| 36 #include "core/rendering/RenderLayer.h" | |
| 37 #include "core/rendering/RenderView.h" | |
| 36 #include "core/rendering/svg/RenderSVGRoot.h" | 38 #include "core/rendering/svg/RenderSVGRoot.h" |
| 37 #include "core/rendering/svg/SVGResourcesCache.h" | 39 #include "core/rendering/svg/SVGResourcesCache.h" |
| 38 #include "core/svg/SVGGraphicsElement.h" | 40 #include "core/svg/SVGGraphicsElement.h" |
| 39 | 41 |
| 40 namespace WebCore { | 42 namespace WebCore { |
| 41 | 43 |
| 42 RenderSVGModelObject::RenderSVGModelObject(SVGElement* node) | 44 RenderSVGModelObject::RenderSVGModelObject(SVGElement* node) |
| 43 : RenderObject(node) | 45 : RenderObject(node) |
| 44 { | 46 { |
| 45 } | 47 } |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 116 return false; | 118 return false; |
| 117 } | 119 } |
| 118 | 120 |
| 119 // The SVG addFocusRingRects() method adds rects in local coordinates so the def ault absoluteFocusRingQuads | 121 // The SVG addFocusRingRects() method adds rects in local coordinates so the def ault absoluteFocusRingQuads |
| 120 // returns incorrect values for SVG objects. Overriding this method provides acc ess to the absolute bounds. | 122 // returns incorrect values for SVG objects. Overriding this method provides acc ess to the absolute bounds. |
| 121 void RenderSVGModelObject::absoluteFocusRingQuads(Vector<FloatQuad>& quads) | 123 void RenderSVGModelObject::absoluteFocusRingQuads(Vector<FloatQuad>& quads) |
| 122 { | 124 { |
| 123 quads.append(localToAbsoluteQuad(FloatQuad(repaintRectInLocalCoordinates())) ); | 125 quads.append(localToAbsoluteQuad(FloatQuad(repaintRectInLocalCoordinates())) ); |
| 124 } | 126 } |
| 125 | 127 |
| 128 void RenderSVGModelObject::repaintTreeAfterLayout() | |
| 129 { | |
| 130 // Note: This is a reduced version of RenderBox::repaintTreeAfterLayout(). | |
|
leviw_travelin_and_unemployed
2014/05/02 18:30:15
This makes me sad, but I don't have a better idea
| |
| 131 | |
| 132 ASSERT(RuntimeEnabledFeatures::repaintAfterLayoutEnabled()); | |
| 133 ASSERT(!needsLayout()); | |
| 134 | |
| 135 const LayoutRect oldRepaintRect = previousRepaintRect(); | |
| 136 const LayoutPoint oldPositionFromRepaintContainer = previousPositionFromRepa intContainer(); | |
| 137 RenderLayerModelObject* repaintContainer = containerForRepaint(); | |
| 138 setPreviousRepaintRect(clippedOverflowRectForRepaint(repaintContainer)); | |
| 139 setPreviousPositionFromRepaintContainer(positionFromRepaintContainer(repaint Container)); | |
| 140 | |
| 141 // If we are set to do a full repaint that means the RenderView will be | |
| 142 // invalidated. We can then skip issuing of invalidations for the child | |
| 143 // renderers as they'll be covered by the RenderView. | |
| 144 if (view()->doingFullRepaint()) { | |
| 145 LayoutStateDisabler layoutStateDisabler(*this); | |
| 146 RenderObject::repaintTreeAfterLayout(); | |
| 147 return; | |
| 148 } | |
| 149 | |
| 150 if (onlyNeededPositionedMovementLayout() && compositingState() != PaintsInto OwnBacking) { | |
|
leviw_travelin_and_unemployed
2014/05/02 18:30:15
nit: don't need braces
fs
2014/05/05 08:27:12
Dropped.
| |
| 151 setShouldDoFullRepaintAfterLayout(true); | |
| 152 } | |
| 153 | |
| 154 const LayoutRect& newRepaintRect = previousRepaintRect(); | |
| 155 const LayoutPoint& newPositionFromRepaintContainer = previousPositionFromRep aintContainer(); | |
| 156 bool didFullRepaint = repaintAfterLayoutIfNeeded(containerForRepaint(), | |
| 157 shouldDoFullRepaintAfterLayout(), oldRepaintRect, oldPositionFromRepaint Container, &newRepaintRect, &newPositionFromRepaintContainer); | |
| 158 | |
| 159 if (!didFullRepaint) | |
| 160 repaintOverflowIfNeeded(); | |
| 161 | |
| 162 // Repaint any scrollbars if there is a scrollable area for this renderer. | |
| 163 if (enclosingLayer()) { | |
|
leviw_travelin_and_unemployed
2014/05/02 18:30:15
This block of code should be moved into a shared f
fs
2014/05/05 08:27:12
Relocated to RenderObject::repaintScrollbarsIfNeed
| |
| 164 if (RenderLayerScrollableArea* area = enclosingLayer()->scrollableArea() ) { | |
| 165 if (area->hasVerticalBarDamage()) | |
| 166 repaintRectangle(area->verticalBarDamage()); | |
| 167 if (area->hasHorizontalBarDamage()) | |
| 168 repaintRectangle(area->horizontalBarDamage()); | |
| 169 area->resetScrollbarDamage(); | |
| 170 } | |
| 171 } | |
| 172 | |
| 173 LayoutStateDisabler layoutStateDisabler(*this); | |
|
leviw_travelin_and_unemployed
2014/05/02 18:30:15
Should we just have one of these at the top of the
fs
2014/05/05 08:27:12
Makes sense. Hoisted and combined.
| |
| 174 RenderObject::repaintTreeAfterLayout(); | |
| 175 } | |
| 176 | |
| 126 } // namespace WebCore | 177 } // namespace WebCore |
| OLD | NEW |