[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
hyatt
hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:35:27 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 1fc4d49f224479cce1038d448a111d31d6aee3ca
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Aug 29 06:32:11 2002 +0000
Implement the flattening algorithm that walks the layer
hierarchy and produces the correct layer list for back
to front painting. (Still under construction. Not used yet.)
* khtml/rendering/render_layer.cpp:
(sortByZOrder):
(RenderLayer::RenderZTreeNode::constructLayerList):
* khtml/rendering/render_layer.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1935 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index 4674e6b..42e87af 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,14 @@
+2002-08-28 David Hyatt <hyatt at apple.com>
+
+ Implement the flattening algorithm that walks the layer
+ hierarchy and produces the correct layer list for back
+ to front painting. (Still under construction. Not used yet.)
+
+ * khtml/rendering/render_layer.cpp:
+ (sortByZOrder):
+ (RenderLayer::RenderZTreeNode::constructLayerList):
+ * khtml/rendering/render_layer.h:
+
2002-08-28 Richard Williamson (Local) <rjw at apple.com>
More tweaks to ccs.
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 4674e6b..42e87af 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,14 @@
+2002-08-28 David Hyatt <hyatt at apple.com>
+
+ Implement the flattening algorithm that walks the layer
+ hierarchy and produces the correct layer list for back
+ to front painting. (Still under construction. Not used yet.)
+
+ * khtml/rendering/render_layer.cpp:
+ (sortByZOrder):
+ (RenderLayer::RenderZTreeNode::constructLayerList):
+ * khtml/rendering/render_layer.h:
+
2002-08-28 Richard Williamson (Local) <rjw at apple.com>
More tweaks to ccs.
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 4674e6b..42e87af 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,14 @@
+2002-08-28 David Hyatt <hyatt at apple.com>
+
+ Implement the flattening algorithm that walks the layer
+ hierarchy and produces the correct layer list for back
+ to front painting. (Still under construction. Not used yet.)
+
+ * khtml/rendering/render_layer.cpp:
+ (sortByZOrder):
+ (RenderLayer::RenderZTreeNode::constructLayerList):
+ * khtml/rendering/render_layer.h:
+
2002-08-28 Richard Williamson (Local) <rjw at apple.com>
More tweaks to ccs.
diff --git a/WebCore/khtml/rendering/render_layer.cpp b/WebCore/khtml/rendering/render_layer.cpp
index 06bdf90..38aadd0 100644
--- a/WebCore/khtml/rendering/render_layer.cpp
+++ b/WebCore/khtml/rendering/render_layer.cpp
@@ -182,3 +182,112 @@ RenderLayer::constructLayerList(RenderZTreeNode* ztree, QPtrVector<RenderLayer::
ztree->constructLayerList(&mergeBuffer, result);
}
+// Sort the buffer from lowest z-index to highest. The common scenario will have
+// most z-indices equal, so we optimize for that case (i.e., the list will be mostly
+// sorted already).
+static void sortByZOrder(QPtrVector<RenderLayer::RenderLayerElement>* buffer,
+ QPtrVector<RenderLayer::RenderLayerElement>* mergeBuffer,
+ uint start,
+ uint end)
+{
+ if (start >= end)
+ return; // Sanity check.
+
+ if (end - start <= 6) {
+ // Apply a bubble sort for smaller lists.
+ for (uint i = end-1; i > start; i--) {
+ bool sorted = true;
+ for (uint j = start; j < i; j++) {
+ RenderLayer::RenderLayerElement* elt = buffer->at(j);
+ RenderLayer::RenderLayerElement* elt2 = buffer->at(j+1);
+ if (elt->zindex > elt2->zindex) {
+ sorted = false;
+ buffer->insert(j, elt2);
+ buffer->insert(j+1, elt);
+ }
+ }
+ if (sorted)
+ return;
+ }
+ }
+ else {
+ // Peform a merge sort for larger lists.
+ uint mid = (start+end)/2;
+ sortByZOrder(buffer, mergeBuffer, start, mid);
+ sortByZOrder(buffer, mergeBuffer, mid, end);
+
+ RenderLayer::RenderLayerElement* elt = buffer->at(mid-1);
+ RenderLayer::RenderLayerElement* elt2 = buffer->at(mid);
+
+ // Handle the fast common case (of equal z-indices). The list may already
+ // be completely sorted.
+ if (elt->zindex <= elt2->zindex)
+ return;
+
+ // We have to merge sort. Ensure our merge buffer is big enough to hold
+ // all the items.
+ mergeBuffer->resize(end - start);
+ uint i1 = start;
+ uint i2 = mid;
+
+ elt = buffer->at(i1);
+ elt2 = buffer->at(i2);
+
+ while (i1 < mid || i2 < end) {
+ if (i1 < mid && (i2 == end || elt->zindex <= elt2->zindex)) {
+ mergeBuffer->insert(mergeBuffer->count(), elt);
+ i1++;
+ if (i1 < mid)
+ elt = buffer->at(i1);
+ }
+ else {
+ mergeBuffer->insert(mergeBuffer->count(), elt2);
+ i2++;
+ if (i2 < end)
+ elt2 = buffer->at(i2);
+ }
+ }
+
+ for (uint i = start; i < end; i++)
+ buffer->insert(i, mergeBuffer->at(i-start));
+
+ mergeBuffer->clear();
+ }
+}
+
+void RenderLayer::RenderZTreeNode::constructLayerList(QPtrVector<RenderLayerElement>* mergeTmpBuffer,
+ QPtrVector<RenderLayerElement>* buffer)
+{
+ bool autoZIndex = layer->hasAutoZIndex();
+ int explicitZIndex = layer->zIndex();
+
+ if (layerElement) {
+ // We are a leaf node of the ztree, and so we just place our layer element into
+ // the buffer.
+ if (buffer->count() == buffer->size())
+ // Resize by a power of 2.
+ buffer->resize(2*buffer->size());
+
+ buffer->insert(buffer->count(), layerElement);
+ layerElement->zindex = explicitZIndex;
+ return;
+ }
+
+ uint startIndex = buffer->count();
+ for (RenderZTreeNode* current = child; child; child = child->next)
+ current->constructLayerList(mergeTmpBuffer, buffer);
+ uint endIndex = buffer->count();
+
+ if (autoZIndex)
+ return; // We just had to collect the kids. We don't apply a sort to them, since
+ // they will actually be layered in some ancestor layer's stacking context.
+
+ sortByZOrder(buffer, mergeTmpBuffer, startIndex, endIndex);
+
+ // Now set all of the elements' z-indices to match the parent's explicit z-index, so that
+ // they will be layered properly in the ancestor layer's stacking context.
+ for (uint i = startIndex; i < endIndex; i++) {
+ RenderLayer::RenderLayerElement* elt = buffer->at(i);
+ elt->zindex = explicitZIndex;
+ }
+}
diff --git a/WebCore/khtml/rendering/render_layer.h b/WebCore/khtml/rendering/render_layer.h
index af3c20b..95968ef 100644
--- a/WebCore/khtml/rendering/render_layer.h
+++ b/WebCore/khtml/rendering/render_layer.h
@@ -142,7 +142,7 @@ public:
~RenderZTreeNode() { delete next; delete child; }
void constructLayerList(QPtrVector<RenderLayerElement>* mergeTmpBuffer,
- QPtrVector<RenderLayerElement>* finalBuffer) { };
+ QPtrVector<RenderLayerElement>* finalBuffer);
};
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list