Index: cc/layer_sorter.cc |
diff --git a/cc/layer_sorter.cc b/cc/layer_sorter.cc |
index 5826b07eadf972763be4f814a8c2e991e5831b85..e5b71637626f832a9d842f200c0adfaeb6f38d71 100644 |
--- a/cc/layer_sorter.cc |
+++ b/cc/layer_sorter.cc |
@@ -21,9 +21,9 @@ using WebKit::WebTransformationMatrix; |
#if !defined( NDEBUG ) |
#if SHOW_DEBUG_LOG |
-static WTFLogChannel LogCCLayerSorter = { 0x00000000, "", WTFLogChannelOn }; |
+static WTFLogChannel LogLayerSorter = { 0x00000000, "", WTFLogChannelOn }; |
#else |
-static WTFLogChannel LogCCLayerSorter = { 0x00000000, "", WTFLogChannelOff }; |
+static WTFLogChannel LogLayerSorter = { 0x00000000, "", WTFLogChannelOff }; |
#endif |
#endif |
@@ -63,8 +63,8 @@ static bool edgeEdgeTest(const FloatPoint& a, const FloatPoint& b, const FloatPo |
return true; |
} |
-GraphNode::GraphNode(CCLayerImpl* cclayer) |
- : layer(cclayer) |
+GraphNode::GraphNode(LayerImpl* layerImpl) |
+ : layer(layerImpl) |
, incomingEdgeWeight(0) |
{ |
} |
@@ -73,19 +73,19 @@ GraphNode::~GraphNode() |
{ |
} |
-CCLayerSorter::CCLayerSorter() |
+LayerSorter::LayerSorter() |
: m_zRange(0) |
{ |
} |
-CCLayerSorter::~CCLayerSorter() |
+LayerSorter::~LayerSorter() |
{ |
} |
// Checks whether layer "a" draws on top of layer "b". The weight value returned is an indication of |
// the maximum z-depth difference between the layers or zero if the layers are found to be intesecting |
// (some features are in front and some are behind). |
-CCLayerSorter::ABCompareResult CCLayerSorter::checkOverlap(LayerShape* a, LayerShape* b, float zThreshold, float& weight) |
+LayerSorter::ABCompareResult LayerSorter::checkOverlap(LayerShape* a, LayerShape* b, float zThreshold, float& weight) |
{ |
weight = 0; |
@@ -164,14 +164,14 @@ LayerShape::LayerShape(float width, float height, const WebTransformationMatrix& |
FloatPoint clippedQuad[8]; |
int numVerticesInClippedQuad; |
- CCMathUtil::mapClippedQuad(drawTransform, layerQuad, clippedQuad, numVerticesInClippedQuad); |
+ MathUtil::mapClippedQuad(drawTransform, layerQuad, clippedQuad, numVerticesInClippedQuad); |
if (numVerticesInClippedQuad < 3) { |
projectedBounds = FloatRect(); |
return; |
} |
- projectedBounds = CCMathUtil::computeEnclosingRectOfVertices(clippedQuad, numVerticesInClippedQuad); |
+ projectedBounds = MathUtil::computeEnclosingRectOfVertices(clippedQuad, numVerticesInClippedQuad); |
// NOTE: it will require very significant refactoring and overhead to deal with |
// generalized polygons or multiple quads per layer here. For the sake of layer |
@@ -188,9 +188,9 @@ LayerShape::LayerShape(float width, float height, const WebTransformationMatrix& |
// Compute the normal of the layer's plane. |
bool clipped = false; |
- FloatPoint3D c1 = CCMathUtil::mapPoint(drawTransform, FloatPoint3D(0, 0, 0), clipped); |
- FloatPoint3D c2 = CCMathUtil::mapPoint(drawTransform, FloatPoint3D(0, 1, 0), clipped); |
- FloatPoint3D c3 = CCMathUtil::mapPoint(drawTransform, FloatPoint3D(1, 0, 0), clipped); |
+ FloatPoint3D c1 = MathUtil::mapPoint(drawTransform, FloatPoint3D(0, 0, 0), clipped); |
+ FloatPoint3D c2 = MathUtil::mapPoint(drawTransform, FloatPoint3D(0, 1, 0), clipped); |
+ FloatPoint3D c3 = MathUtil::mapPoint(drawTransform, FloatPoint3D(1, 0, 0), clipped); |
// FIXME: Deal with clipping. |
FloatPoint3D c12 = c2 - c1; |
FloatPoint3D c13 = c3 - c1; |
@@ -222,22 +222,22 @@ float LayerShape::layerZFromProjectedPoint(const FloatPoint& p) const |
return n / d; |
} |
-void CCLayerSorter::createGraphNodes(LayerList::iterator first, LayerList::iterator last) |
+void LayerSorter::createGraphNodes(LayerList::iterator first, LayerList::iterator last) |
{ |
#if !defined( NDEBUG ) |
- LOG(CCLayerSorter, "Creating graph nodes:\n"); |
+ LOG(LayerSorter, "Creating graph nodes:\n"); |
#endif |
float minZ = FLT_MAX; |
float maxZ = -FLT_MAX; |
for (LayerList::const_iterator it = first; it < last; it++) { |
m_nodes.push_back(GraphNode(*it)); |
GraphNode& node = m_nodes.at(m_nodes.size() - 1); |
- CCRenderSurface* renderSurface = node.layer->renderSurface(); |
+ RenderSurfaceImpl* renderSurface = node.layer->renderSurface(); |
if (!node.layer->drawsContent() && !renderSurface) |
continue; |
#if !defined( NDEBUG ) |
- LOG(CCLayerSorter, "Layer %d (%d x %d)\n", node.layer->id(), node.layer->bounds().width(), node.layer->bounds().height()); |
+ LOG(LayerSorter, "Layer %d (%d x %d)\n", node.layer->id(), node.layer->bounds().width(), node.layer->bounds().height()); |
#endif |
WebTransformationMatrix drawTransform; |
@@ -261,10 +261,10 @@ void CCLayerSorter::createGraphNodes(LayerList::iterator first, LayerList::itera |
m_zRange = fabsf(maxZ - minZ); |
} |
-void CCLayerSorter::createGraphEdges() |
+void LayerSorter::createGraphEdges() |
{ |
#if !defined( NDEBUG ) |
- LOG(CCLayerSorter, "Edges:\n"); |
+ LOG(LayerSorter, "Edges:\n"); |
#endif |
// Fraction of the total zRange below which z differences |
// are not considered reliable. |
@@ -293,7 +293,7 @@ void CCLayerSorter::createGraphEdges() |
if (startNode) { |
#if !defined( NDEBUG ) |
- LOG(CCLayerSorter, "%d -> %d\n", startNode->layer->id(), endNode->layer->id()); |
+ LOG(LayerSorter, "%d -> %d\n", startNode->layer->id(), endNode->layer->id()); |
#endif |
m_edges.push_back(GraphEdge(startNode, endNode, weight)); |
} |
@@ -311,7 +311,7 @@ void CCLayerSorter::createGraphEdges() |
// Finds and removes an edge from the list by doing a swap with the |
// last element of the list. |
-void CCLayerSorter::removeEdgeFromList(GraphEdge* edge, std::vector<GraphEdge*>& list) |
+void LayerSorter::removeEdgeFromList(GraphEdge* edge, std::vector<GraphEdge*>& list) |
{ |
std::vector<GraphEdge*>::iterator iter = std::find(list.begin(), list.end(), edge); |
ASSERT(iter != list.end()); |
@@ -337,10 +337,10 @@ void CCLayerSorter::removeEdgeFromList(GraphEdge* edge, std::vector<GraphEdge*>& |
// of the original list of layers, since that list should already have proper z-index |
// ordering of layers. |
// |
-void CCLayerSorter::sort(LayerList::iterator first, LayerList::iterator last) |
+void LayerSorter::sort(LayerList::iterator first, LayerList::iterator last) |
{ |
#if !defined( NDEBUG ) |
- LOG(CCLayerSorter, "Sorting start ----\n"); |
+ LOG(LayerSorter, "Sorting start ----\n"); |
#endif |
createGraphNodes(first, last); |
@@ -356,7 +356,7 @@ void CCLayerSorter::sort(LayerList::iterator first, LayerList::iterator last) |
} |
#if !defined( NDEBUG ) |
- LOG(CCLayerSorter, "Sorted list: "); |
+ LOG(LayerSorter, "Sorted list: "); |
#endif |
while (m_activeEdges.size() || noIncomingEdgeNodeList.size()) { |
while (noIncomingEdgeNodeList.size()) { |
@@ -372,7 +372,7 @@ void CCLayerSorter::sort(LayerList::iterator first, LayerList::iterator last) |
sortedList.push_back(fromNode); |
#if !defined( NDEBUG ) |
- LOG(CCLayerSorter, "%d, ", fromNode->layer->id()); |
+ LOG(LayerSorter, "%d, ", fromNode->layer->id()); |
#endif |
// Remove all its outgoing edges from the graph. |
@@ -417,7 +417,7 @@ void CCLayerSorter::sort(LayerList::iterator first, LayerList::iterator last) |
nextNode->incomingEdgeWeight = 0; |
noIncomingEdgeNodeList.push_back(nextNode); |
#if !defined( NDEBUG ) |
- LOG(CCLayerSorter, "Breaking cycle by cleaning up incoming edges from %d (weight = %f)\n", nextNode->layer->id(), minIncomingEdgeWeight); |
+ LOG(LayerSorter, "Breaking cycle by cleaning up incoming edges from %d (weight = %f)\n", nextNode->layer->id(), minIncomingEdgeWeight); |
#endif |
} |
@@ -428,7 +428,7 @@ void CCLayerSorter::sort(LayerList::iterator first, LayerList::iterator last) |
*it = sortedList[count++]->layer; |
#if !defined( NDEBUG ) |
- LOG(CCLayerSorter, "Sorting end ----\n"); |
+ LOG(LayerSorter, "Sorting end ----\n"); |
#endif |
m_nodes.clear(); |