Title: [96120] trunk/Source/WebCore
- Revision
- 96120
- Author
- noam.rosent...@nokia.com
- Date
- 2011-09-27 09:38:19 -0700 (Tue, 27 Sep 2011)
Log Message
[Texmap] Code cleanup: remove unused boundingRect/visibleRect calculations
https://bugs.webkit.org/show_bug.cgi?id=68897
Reviewed by Andreas Kling.
No new functionality so no new tests.
* platform/graphics/texmap/TextureMapperNode.cpp:
(WebCore::TextureMapperNode::computeAllTransforms):
(WebCore::TextureMapperNode::computeTiles):
(WebCore::TextureMapperNode::syncCompositingState):
* platform/graphics/texmap/TextureMapperNode.h:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (96119 => 96120)
--- trunk/Source/WebCore/ChangeLog 2011-09-27 16:28:18 UTC (rev 96119)
+++ trunk/Source/WebCore/ChangeLog 2011-09-27 16:38:19 UTC (rev 96120)
@@ -1,5 +1,20 @@
2011-09-27 No'am Rosenthal <noam.rosent...@nokia.com>
+ [Texmap] Code cleanup: remove unused boundingRect/visibleRect calculations
+ https://bugs.webkit.org/show_bug.cgi?id=68897
+
+ Reviewed by Andreas Kling.
+
+ No new functionality so no new tests.
+
+ * platform/graphics/texmap/TextureMapperNode.cpp:
+ (WebCore::TextureMapperNode::computeAllTransforms):
+ (WebCore::TextureMapperNode::computeTiles):
+ (WebCore::TextureMapperNode::syncCompositingState):
+ * platform/graphics/texmap/TextureMapperNode.h:
+
+2011-09-27 No'am Rosenthal <noam.rosent...@nokia.com>
+
[Texmap][Qt] Refactor texture-upload to allow direct chunk update
https://bugs.webkit.org/show_bug.cgi?id=68808
Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapperNode.cpp (96119 => 96120)
--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperNode.cpp 2011-09-27 16:28:18 UTC (rev 96119)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperNode.cpp 2011-09-27 16:38:19 UTC (rev 96120)
@@ -136,20 +136,6 @@
.translate3d(-originX, -originY, -m_state.anchorPoint.z());
}
-bool TextureMapperNode::needsToComputeBoundingRect() const
-{
- if (m_size.width() > gTileDimension || m_size.height() > gTileDimension)
- return true;
- if (!m_state.masksToBounds)
- return false;
-
- for (size_t i = 0; i < m_children.size(); ++i)
- if (m_children[i]->needsToComputeBoundingRect())
- return true;
-
- return false;
-}
-
void TextureMapperNode::computeAllTransforms()
{
if (m_size.isEmpty() && m_state.masksToBounds)
@@ -160,7 +146,6 @@
computePerspectiveTransformIfNeeded();
m_transforms.target = TransformationMatrix(m_parent ? m_parent->m_transforms.forDescendants : TransformationMatrix()).multiply(m_transforms.local);
- m_transforms.targetBoundingRect = FloatRect(m_transforms.target.mapRect(targetRect()));
m_state.visible = m_state.backfaceVisibility || m_transforms.target.inverse().m33() >= 0;
if (!m_state.visible)
@@ -186,28 +171,6 @@
m_transforms.forDescendants.multiply(m_transforms.perspective);
}
-void TextureMapperNode::computeBoundingRectFromRootIfNeeded()
-{
- if (!needsToComputeBoundingRect())
- return;
- if (!m_parent) {
- m_transforms.boundingRectFromRoot = m_transforms.boundingRectFromRootForDescendants = IntRect(0, 0, -1, -1);
- return;
- }
-
- const FloatRect targetRectInRootCoordinates = m_transforms.target.mapRect(targetRect());
-
- const FloatRect parentBoundingRect = m_parent->m_transforms.boundingRectFromRootForDescendants;
- if (parentBoundingRect.width() < 0)
- m_transforms.boundingRectFromRoot = targetRectInRootCoordinates;
- else {
- m_transforms.boundingRectFromRootForDescendants = m_transforms.boundingRectFromRoot = parentBoundingRect;
- m_transforms.boundingRectFromRoot.intersect(targetRectInRootCoordinates);
- }
- if (m_state.masksToBounds)
- m_transforms.boundingRectFromRootForDescendants.intersect(m_transforms.boundingRectFromRoot);
-}
-
void TextureMapperNode::computeTiles()
{
if (m_currentContent.contentType == HTMLContentType && !m_state.drawsContent) {
@@ -227,10 +190,7 @@
FloatRect tileRectInRootCoordinates = tileRect;
tileRectInRootCoordinates.scale(1.0 / m_state.contentScale);
tileRectInRootCoordinates = m_transforms.target.mapRect(tileRectInRootCoordinates);
- static bool sDiscardHiddenTiles = false;
- // FIXME: discard hidden tiles.
- if (!sDiscardHiddenTiles || !needsToComputeBoundingRect() || tileRectInRootCoordinates.intersects(m_state.visibleRect))
- tilesToAdd.append(tileRect);
+ tilesToAdd.append(tileRect);
}
}
@@ -271,21 +231,6 @@
m_tiles.remove(tilesToRemove[i]);
}
-void TextureMapperNode::computeVisibleRectIfNeeded()
-{
- if (!needsToComputeBoundingRect())
- return;
- FloatRect rootVisibleRect;
- if (!m_parent)
- rootVisibleRect = m_state.rootVisibleRect;
- else if (m_parent)
- rootVisibleRect = m_parent->m_state.rootVisibleRect;
-
- m_state.rootVisibleRect = rootVisibleRect;
- m_state.visibleRect = m_state.rootVisibleRect;
- m_state.visibleRect.intersect(m_transforms.boundingRectFromRoot);
-}
-
void TextureMapperNode::renderContent(TextureMapper* textureMapper, GraphicsLayer* layer)
{
if (m_size.isEmpty() || !layer || (!m_state.drawsContent && m_currentContent.contentType == HTMLContentType)) {
@@ -567,11 +512,6 @@
m_parent->m_children.remove(m_parent->m_children.find(this));
}
-void TextureMapperNode::setVisibleRect(const IntRect& rect)
-{
- m_state.rootVisibleRect = m_state.visibleRect = rect;
-}
-
void TextureMapperNode::syncCompositingState(GraphicsLayerTextureMapper* graphicsLayer, int options)
{
syncCompositingState(graphicsLayer, rootLayer()->m_textureMapper, options);
@@ -895,7 +835,6 @@
syncAnimations(graphicsLayer);
computeAllTransforms();
- computeBoundingRectFromRootIfNeeded();
computePerspectiveTransformIfNeeded();
computeTiles();
computeOverlapsIfNeeded();
Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapperNode.h (96119 => 96120)
--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperNode.h 2011-09-27 16:28:18 UTC (rev 96119)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperNode.h 2011-09-27 16:38:19 UTC (rev 96120)
@@ -135,7 +135,6 @@
IntSize size() const { return IntSize(m_size.width() + .5, m_size.height() + .5); }
void setTransform(const TransformationMatrix&);
void setOpacity(float value) { m_opacity = value; }
- void setVisibleRect(const IntRect&);
void setTextureMapper(TextureMapper* texmap) { m_textureMapper = texmap; }
bool descendantsOrSelfHaveRunningAnimations() const;
@@ -148,7 +147,6 @@
private:
TextureMapperNode* rootLayer();
void computeAllTransforms();
- void computeVisibleRectIfNeeded();
void computePerspectiveTransformIfNeeded();
void computeReplicaTransformIfNeeded();
void computeOverlapsIfNeeded();
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes