Chromium Code Reviews| 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 115 svg_noninherited_flags = other->svg_noninherited_flags; | 115 svg_noninherited_flags = other->svg_noninherited_flags; |
| 116 stops = other->stops; | 116 stops = other->stops; |
| 117 misc = other->misc; | 117 misc = other->misc; |
| 118 resources = other->resources; | 118 resources = other->resources; |
| 119 } | 119 } |
| 120 | 120 |
| 121 StyleDifference SVGRenderStyle::diff(const SVGRenderStyle* other) const | 121 StyleDifference SVGRenderStyle::diff(const SVGRenderStyle* other) const |
| 122 { | 122 { |
| 123 StyleDifference styleDifference; | 123 StyleDifference styleDifference; |
| 124 | 124 |
| 125 if (diffNeedsLayout(other)) | 125 if (diffNeedsLayoutAndRepaint(other)) { |
| 126 styleDifference.setNeedsFullLayout(); | 126 styleDifference.setNeedsFullLayout(); |
| 127 if (diffNeedsRepaint(other)) | |
| 128 styleDifference.setNeedsRepaintObject(); | 127 styleDifference.setNeedsRepaintObject(); |
|
Julien - ping for review
2014/05/07 00:24:32
We didn't do that before, why do we want to do thi
Xianzhu
2014/05/07 00:39:22
I'm a bit confused. Doesn't RenderObject::setStyle
Julien - ping for review
2014/05/08 21:03:49
They both do. However this is forcing the object t
Xianzhu
2014/05/08 21:52:55
The code in RenderObject.cpp is changed to the fol
| |
| 128 } else if (diffNeedsRepaint(other)) { | |
| 129 styleDifference.setNeedsRepaintObject(); | |
| 130 } | |
| 129 | 131 |
| 130 return styleDifference; | 132 return styleDifference; |
| 131 } | 133 } |
| 132 | 134 |
| 133 bool SVGRenderStyle::diffNeedsLayout(const SVGRenderStyle* other) const | 135 bool SVGRenderStyle::diffNeedsLayoutAndRepaint(const SVGRenderStyle* other) cons t |
| 134 { | 136 { |
| 135 // If resources change, we need a relayout, as the presence of resources inf luences the repaint rect. | 137 // If resources change, we need a relayout, as the presence of resources inf luences the repaint rect. |
| 136 if (resources != other->resources) | 138 if (resources != other->resources) |
| 137 return true; | 139 return true; |
| 138 | 140 |
| 139 // If markers change, we need a relayout, as marker boundaries are cached in RenderSVGPath. | 141 // If markers change, we need a relayout, as marker boundaries are cached in RenderSVGPath. |
| 140 if (inheritedResources != other->inheritedResources) | 142 if (inheritedResources != other->inheritedResources) |
| 141 return true; | 143 return true; |
| 142 | 144 |
| 143 // All text related properties influence layout. | 145 // All text related properties influence layout. |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 227 } | 229 } |
| 228 | 230 |
| 229 EPaintOrderType SVGRenderStyle::paintOrderType(unsigned index) const | 231 EPaintOrderType SVGRenderStyle::paintOrderType(unsigned index) const |
| 230 { | 232 { |
| 231 ASSERT(index < ((1 << kPaintOrderBitwidth)-1)); | 233 ASSERT(index < ((1 << kPaintOrderBitwidth)-1)); |
| 232 unsigned pt = (paintOrder() >> (kPaintOrderBitwidth*index)) & ((1u << kPaint OrderBitwidth) - 1); | 234 unsigned pt = (paintOrder() >> (kPaintOrderBitwidth*index)) & ((1u << kPaint OrderBitwidth) - 1); |
| 233 return (EPaintOrderType)pt; | 235 return (EPaintOrderType)pt; |
| 234 } | 236 } |
| 235 | 237 |
| 236 } | 238 } |
| OLD | NEW |