Changeset 96120 in webkit
- Timestamp:
- Sep 27, 2011 9:38:19 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r96118 r96120 1 2011-09-27 No'am Rosenthal <noam.rosenthal@nokia.com> 2 3 [Texmap] Code cleanup: remove unused boundingRect/visibleRect calculations 4 https://bugs.webkit.org/show_bug.cgi?id=68897 5 6 Reviewed by Andreas Kling. 7 8 No new functionality so no new tests. 9 10 * platform/graphics/texmap/TextureMapperNode.cpp: 11 (WebCore::TextureMapperNode::computeAllTransforms): 12 (WebCore::TextureMapperNode::computeTiles): 13 (WebCore::TextureMapperNode::syncCompositingState): 14 * platform/graphics/texmap/TextureMapperNode.h: 15 1 16 2011-09-27 No'am Rosenthal <noam.rosenthal@nokia.com> 2 17 -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapperNode.cpp
r95901 r96120 137 137 } 138 138 139 bool TextureMapperNode::needsToComputeBoundingRect() const140 {141 if (m_size.width() > gTileDimension || m_size.height() > gTileDimension)142 return true;143 if (!m_state.masksToBounds)144 return false;145 146 for (size_t i = 0; i < m_children.size(); ++i)147 if (m_children[i]->needsToComputeBoundingRect())148 return true;149 150 return false;151 }152 153 139 void TextureMapperNode::computeAllTransforms() 154 140 { … … 161 147 162 148 m_transforms.target = TransformationMatrix(m_parent ? m_parent->m_transforms.forDescendants : TransformationMatrix()).multiply(m_transforms.local); 163 m_transforms.targetBoundingRect = FloatRect(m_transforms.target.mapRect(targetRect()));164 149 165 150 m_state.visible = m_state.backfaceVisibility || m_transforms.target.inverse().m33() >= 0; … … 185 170 186 171 m_transforms.forDescendants.multiply(m_transforms.perspective); 187 }188 189 void TextureMapperNode::computeBoundingRectFromRootIfNeeded()190 {191 if (!needsToComputeBoundingRect())192 return;193 if (!m_parent) {194 m_transforms.boundingRectFromRoot = m_transforms.boundingRectFromRootForDescendants = IntRect(0, 0, -1, -1);195 return;196 }197 198 const FloatRect targetRectInRootCoordinates = m_transforms.target.mapRect(targetRect());199 200 const FloatRect parentBoundingRect = m_parent->m_transforms.boundingRectFromRootForDescendants;201 if (parentBoundingRect.width() < 0)202 m_transforms.boundingRectFromRoot = targetRectInRootCoordinates;203 else {204 m_transforms.boundingRectFromRootForDescendants = m_transforms.boundingRectFromRoot = parentBoundingRect;205 m_transforms.boundingRectFromRoot.intersect(targetRectInRootCoordinates);206 }207 if (m_state.masksToBounds)208 m_transforms.boundingRectFromRootForDescendants.intersect(m_transforms.boundingRectFromRoot);209 172 } 210 173 … … 228 191 tileRectInRootCoordinates.scale(1.0 / m_state.contentScale); 229 192 tileRectInRootCoordinates = m_transforms.target.mapRect(tileRectInRootCoordinates); 230 static bool sDiscardHiddenTiles = false; 231 // FIXME: discard hidden tiles. 232 if (!sDiscardHiddenTiles || !needsToComputeBoundingRect() || tileRectInRootCoordinates.intersects(m_state.visibleRect)) 233 tilesToAdd.append(tileRect); 193 tilesToAdd.append(tileRect); 234 194 } 235 195 } … … 270 230 for (size_t i = 0; i < tilesToRemove.size() && m_tiles.size() > TileEraseThreshold; ++i) 271 231 m_tiles.remove(tilesToRemove[i]); 272 }273 274 void TextureMapperNode::computeVisibleRectIfNeeded()275 {276 if (!needsToComputeBoundingRect())277 return;278 FloatRect rootVisibleRect;279 if (!m_parent)280 rootVisibleRect = m_state.rootVisibleRect;281 else if (m_parent)282 rootVisibleRect = m_parent->m_state.rootVisibleRect;283 284 m_state.rootVisibleRect = rootVisibleRect;285 m_state.visibleRect = m_state.rootVisibleRect;286 m_state.visibleRect.intersect(m_transforms.boundingRectFromRoot);287 232 } 288 233 … … 566 511 if (m_parent) 567 512 m_parent->m_children.remove(m_parent->m_children.find(this)); 568 }569 570 void TextureMapperNode::setVisibleRect(const IntRect& rect)571 {572 m_state.rootVisibleRect = m_state.visibleRect = rect;573 513 } 574 514 … … 896 836 897 837 computeAllTransforms(); 898 computeBoundingRectFromRootIfNeeded();899 838 computePerspectiveTransformIfNeeded(); 900 839 computeTiles(); -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapperNode.h
r95901 r96120 136 136 void setTransform(const TransformationMatrix&); 137 137 void setOpacity(float value) { m_opacity = value; } 138 void setVisibleRect(const IntRect&);139 138 void setTextureMapper(TextureMapper* texmap) { m_textureMapper = texmap; } 140 139 bool descendantsOrSelfHaveRunningAnimations() const; … … 149 148 TextureMapperNode* rootLayer(); 150 149 void computeAllTransforms(); 151 void computeVisibleRectIfNeeded();152 150 void computePerspectiveTransformIfNeeded(); 153 151 void computeReplicaTransformIfNeeded();
Note: See TracChangeset
for help on using the changeset viewer.