| 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 { | 81 { |
| 82 quads.append(localToAbsoluteQuad(strokeBoundingBox())); | 82 quads.append(localToAbsoluteQuad(strokeBoundingBox())); |
| 83 } | 83 } |
| 84 | 84 |
| 85 void LayoutSVGModelObject::willBeDestroyed() | 85 void LayoutSVGModelObject::willBeDestroyed() |
| 86 { | 86 { |
| 87 SVGResourcesCache::clientDestroyed(this); | 87 SVGResourcesCache::clientDestroyed(this); |
| 88 LayoutObject::willBeDestroyed(); | 88 LayoutObject::willBeDestroyed(); |
| 89 } | 89 } |
| 90 | 90 |
| 91 PaintInvalidationReason LayoutSVGModelObject::getPaintInvalidationReason(const P
aintInvalidationState& paintInvalidationState, |
| 92 const LayoutRect& oldBounds, const LayoutPoint& oldLocation, const LayoutRec
t& newBounds, const LayoutPoint& newLocation) const |
| 93 { |
| 94 PaintInvalidationReason invalidationReason = LayoutObject::getPaintInvalidat
ionReason(paintInvalidationState, oldBounds, oldLocation, newBounds, newLocation
); |
| 95 |
| 96 // Disable incremental invalidation for SVG objects to prevent under- |
| 97 // invalidation. Unlike boxes, it is non-trivial (and rare) for SVG objects |
| 98 // to be able to be incrementally invalidated (e.g., on height changes). |
| 99 if (invalidationReason == PaintInvalidationIncremental) |
| 100 return PaintInvalidationFull; |
| 101 |
| 102 return invalidationReason; |
| 103 } |
| 104 |
| 91 void LayoutSVGModelObject::computeLayerHitTestRects(LayerHitTestRects& rects) co
nst | 105 void LayoutSVGModelObject::computeLayerHitTestRects(LayerHitTestRects& rects) co
nst |
| 92 { | 106 { |
| 93 // Using just the rect for the SVGRoot is good enough for now. | 107 // Using just the rect for the SVGRoot is good enough for now. |
| 94 SVGLayoutSupport::findTreeRootObject(this)->computeLayerHitTestRects(rects); | 108 SVGLayoutSupport::findTreeRootObject(this)->computeLayerHitTestRects(rects); |
| 95 } | 109 } |
| 96 | 110 |
| 97 void LayoutSVGModelObject::addLayerHitTestRects(LayerHitTestRects&, const PaintL
ayer* currentLayer, const LayoutPoint& layerOffset, const LayoutRect& containerR
ect) const | 111 void LayoutSVGModelObject::addLayerHitTestRects(LayerHitTestRects&, const PaintL
ayer* currentLayer, const LayoutPoint& layerOffset, const LayoutRect& containerR
ect) const |
| 98 { | 112 { |
| 99 // We don't walk into SVG trees at all - just report their container. | 113 // We don't walk into SVG trees at all - just report their container. |
| 100 } | 114 } |
| (...skipping 23 matching lines...) Expand all Loading... |
| 124 } | 138 } |
| 125 | 139 |
| 126 // The SVG addOutlineRects() method adds rects in local coordinates so the defau
lt absoluteElementBoundingBoxRect() | 140 // The SVG addOutlineRects() method adds rects in local coordinates so the defau
lt absoluteElementBoundingBoxRect() |
| 127 // returns incorrect values for SVG objects. Overriding this method provides acc
ess to the absolute bounds. | 141 // returns incorrect values for SVG objects. Overriding this method provides acc
ess to the absolute bounds. |
| 128 IntRect LayoutSVGModelObject::absoluteElementBoundingBoxRect() const | 142 IntRect LayoutSVGModelObject::absoluteElementBoundingBoxRect() const |
| 129 { | 143 { |
| 130 return localToAbsoluteQuad(FloatQuad(paintInvalidationRectInLocalSVGCoordina
tes())).enclosingBoundingBox(); | 144 return localToAbsoluteQuad(FloatQuad(paintInvalidationRectInLocalSVGCoordina
tes())).enclosingBoundingBox(); |
| 131 } | 145 } |
| 132 | 146 |
| 133 } // namespace blink | 147 } // namespace blink |
| OLD | NEW |