| OLD | NEW |
| 1 /* | 1 /* |
| 2 Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> | 2 Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> |
| 3 2004, 2005, 2010 Rob Buis <buis@kde.org> | 3 2004, 2005, 2010 Rob Buis <buis@kde.org> |
| 4 Copyright (C) Research In Motion Limited 2010. All rights reserved. | 4 Copyright (C) Research In Motion Limited 2010. All rights reserved. |
| 5 | 5 |
| 6 Based on khtml code by: | 6 Based on khtml code by: |
| 7 Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) | 7 Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 8 Copyright (C) 1999-2003 Lars Knoll (knoll@kde.org) | 8 Copyright (C) 1999-2003 Lars Knoll (knoll@kde.org) |
| 9 Copyright (C) 2002-2003 Dirk Mueller (mueller@kde.org) | 9 Copyright (C) 2002-2003 Dirk Mueller (mueller@kde.org) |
| 10 Copyright (C) 2002 Apple Computer, Inc. | 10 Copyright (C) 2002 Apple Computer, Inc. |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 styleDifference.setNeedsPaintInvalidationObject(); | 122 styleDifference.setNeedsPaintInvalidationObject(); |
| 123 } else if (diffNeedsPaintInvalidation(other)) { | 123 } else if (diffNeedsPaintInvalidation(other)) { |
| 124 styleDifference.setNeedsPaintInvalidationObject(); | 124 styleDifference.setNeedsPaintInvalidationObject(); |
| 125 } | 125 } |
| 126 | 126 |
| 127 return styleDifference; | 127 return styleDifference; |
| 128 } | 128 } |
| 129 | 129 |
| 130 bool SVGComputedStyle::diffNeedsLayoutAndPaintInvalidation( | 130 bool SVGComputedStyle::diffNeedsLayoutAndPaintInvalidation( |
| 131 const SVGComputedStyle* other) const { | 131 const SVGComputedStyle* other) const { |
| 132 // If resources change, we need a relayout, as the presence of resources influ
ences the paint invalidation rect. | 132 // If resources change, we need a relayout, as the presence of resources |
| 133 // influences the paint invalidation rect. |
| 133 if (resources != other->resources) | 134 if (resources != other->resources) |
| 134 return true; | 135 return true; |
| 135 | 136 |
| 136 // If markers change, we need a relayout, as marker boundaries are cached in L
ayoutSVGPath. | 137 // If markers change, we need a relayout, as marker boundaries are cached in |
| 138 // LayoutSVGPath. |
| 137 if (inheritedResources != other->inheritedResources) | 139 if (inheritedResources != other->inheritedResources) |
| 138 return true; | 140 return true; |
| 139 | 141 |
| 140 // All text related properties influence layout. | 142 // All text related properties influence layout. |
| 141 if (svg_inherited_flags.textAnchor != other->svg_inherited_flags.textAnchor || | 143 if (svg_inherited_flags.textAnchor != other->svg_inherited_flags.textAnchor || |
| 142 svg_inherited_flags.dominantBaseline != | 144 svg_inherited_flags.dominantBaseline != |
| 143 other->svg_inherited_flags.dominantBaseline || | 145 other->svg_inherited_flags.dominantBaseline || |
| 144 svg_noninherited_flags.f.alignmentBaseline != | 146 svg_noninherited_flags.f.alignmentBaseline != |
| 145 other->svg_noninherited_flags.f.alignmentBaseline || | 147 other->svg_noninherited_flags.f.alignmentBaseline || |
| 146 svg_noninherited_flags.f.baselineShift != | 148 svg_noninherited_flags.f.baselineShift != |
| 147 other->svg_noninherited_flags.f.baselineShift) | 149 other->svg_noninherited_flags.f.baselineShift) |
| 148 return true; | 150 return true; |
| 149 | 151 |
| 150 // Text related properties influence layout. | 152 // Text related properties influence layout. |
| 151 if (misc->baselineShiftValue != other->misc->baselineShiftValue) | 153 if (misc->baselineShiftValue != other->misc->baselineShiftValue) |
| 152 return true; | 154 return true; |
| 153 | 155 |
| 154 // These properties affect the cached stroke bounding box rects. | 156 // These properties affect the cached stroke bounding box rects. |
| 155 if (svg_inherited_flags.capStyle != other->svg_inherited_flags.capStyle || | 157 if (svg_inherited_flags.capStyle != other->svg_inherited_flags.capStyle || |
| 156 svg_inherited_flags.joinStyle != other->svg_inherited_flags.joinStyle) | 158 svg_inherited_flags.joinStyle != other->svg_inherited_flags.joinStyle) |
| 157 return true; | 159 return true; |
| 158 | 160 |
| 159 // vector-effect changes require a re-layout. | 161 // vector-effect changes require a re-layout. |
| 160 if (svg_noninherited_flags.f.vectorEffect != | 162 if (svg_noninherited_flags.f.vectorEffect != |
| 161 other->svg_noninherited_flags.f.vectorEffect) | 163 other->svg_noninherited_flags.f.vectorEffect) |
| 162 return true; | 164 return true; |
| 163 | 165 |
| 164 // Some stroke properties, requires relayouts, as the cached stroke boundaries
need to be recalculated. | 166 // Some stroke properties, requires relayouts, as the cached stroke boundaries |
| 167 // need to be recalculated. |
| 165 if (stroke.get() != other->stroke.get()) { | 168 if (stroke.get() != other->stroke.get()) { |
| 166 if (stroke->width != other->stroke->width || | 169 if (stroke->width != other->stroke->width || |
| 167 stroke->paintType != other->stroke->paintType || | 170 stroke->paintType != other->stroke->paintType || |
| 168 stroke->paintColor != other->stroke->paintColor || | 171 stroke->paintColor != other->stroke->paintColor || |
| 169 stroke->paintUri != other->stroke->paintUri || | 172 stroke->paintUri != other->stroke->paintUri || |
| 170 stroke->miterLimit != other->stroke->miterLimit || | 173 stroke->miterLimit != other->stroke->miterLimit || |
| 171 *stroke->dashArray != *other->stroke->dashArray || | 174 *stroke->dashArray != *other->stroke->dashArray || |
| 172 stroke->dashOffset != other->stroke->dashOffset || | 175 stroke->dashOffset != other->stroke->dashOffset || |
| 173 stroke->visitedLinkPaintColor != other->stroke->visitedLinkPaintColor || | 176 stroke->visitedLinkPaintColor != other->stroke->visitedLinkPaintColor || |
| 174 stroke->visitedLinkPaintUri != other->stroke->visitedLinkPaintUri || | 177 stroke->visitedLinkPaintUri != other->stroke->visitedLinkPaintUri || |
| (...skipping 14 matching lines...) Expand all Loading... |
| 189 return true; | 192 return true; |
| 190 | 193 |
| 191 // Painting related properties only need paint invalidation. | 194 // Painting related properties only need paint invalidation. |
| 192 if (misc.get() != other->misc.get()) { | 195 if (misc.get() != other->misc.get()) { |
| 193 if (misc->floodColor != other->misc->floodColor || | 196 if (misc->floodColor != other->misc->floodColor || |
| 194 misc->floodOpacity != other->misc->floodOpacity || | 197 misc->floodOpacity != other->misc->floodOpacity || |
| 195 misc->lightingColor != other->misc->lightingColor) | 198 misc->lightingColor != other->misc->lightingColor) |
| 196 return true; | 199 return true; |
| 197 } | 200 } |
| 198 | 201 |
| 199 // If fill changes, we just need to issue paint invalidations. Fill boundaries
are not influenced by this, only by the Path, that LayoutSVGPath contains. | 202 // If fill changes, we just need to issue paint invalidations. Fill boundaries |
| 203 // are not influenced by this, only by the Path, that LayoutSVGPath contains. |
| 200 if (fill.get() != other->fill.get()) { | 204 if (fill.get() != other->fill.get()) { |
| 201 if (fill->paintType != other->fill->paintType || | 205 if (fill->paintType != other->fill->paintType || |
| 202 fill->paintColor != other->fill->paintColor || | 206 fill->paintColor != other->fill->paintColor || |
| 203 fill->paintUri != other->fill->paintUri || | 207 fill->paintUri != other->fill->paintUri || |
| 204 fill->opacity != other->fill->opacity) | 208 fill->opacity != other->fill->opacity) |
| 205 return true; | 209 return true; |
| 206 } | 210 } |
| 207 | 211 |
| 208 // If gradient stops change, we just need to issue paint invalidations. Style
updates are already handled through LayoutSVGGradientSTop. | 212 // If gradient stops change, we just need to issue paint invalidations. Style |
| 213 // updates are already handled through LayoutSVGGradientSTop. |
| 209 if (stops != other->stops) | 214 if (stops != other->stops) |
| 210 return true; | 215 return true; |
| 211 | 216 |
| 212 // Changes of these flags only cause paint invalidations. | 217 // Changes of these flags only cause paint invalidations. |
| 213 if (svg_inherited_flags.colorRendering != | 218 if (svg_inherited_flags.colorRendering != |
| 214 other->svg_inherited_flags.colorRendering || | 219 other->svg_inherited_flags.colorRendering || |
| 215 svg_inherited_flags.shapeRendering != | 220 svg_inherited_flags.shapeRendering != |
| 216 other->svg_inherited_flags.shapeRendering || | 221 other->svg_inherited_flags.shapeRendering || |
| 217 svg_inherited_flags.clipRule != other->svg_inherited_flags.clipRule || | 222 svg_inherited_flags.clipRule != other->svg_inherited_flags.clipRule || |
| 218 svg_inherited_flags.fillRule != other->svg_inherited_flags.fillRule || | 223 svg_inherited_flags.fillRule != other->svg_inherited_flags.fillRule || |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 pt = paintOrderSequence(PT_MARKERS, PT_STROKE, PT_FILL); | 270 pt = paintOrderSequence(PT_MARKERS, PT_STROKE, PT_FILL); |
| 266 break; | 271 break; |
| 267 } | 272 } |
| 268 | 273 |
| 269 pt = | 274 pt = |
| 270 (pt >> (kPaintOrderBitwidth * index)) & ((1u << kPaintOrderBitwidth) - 1); | 275 (pt >> (kPaintOrderBitwidth * index)) & ((1u << kPaintOrderBitwidth) - 1); |
| 271 return (EPaintOrderType)pt; | 276 return (EPaintOrderType)pt; |
| 272 } | 277 } |
| 273 | 278 |
| 274 } // namespace blink | 279 } // namespace blink |
| OLD | NEW |