Add red black tree

Review URL: http://codereview.appspot.com/4184063



git-svn-id: http://skia.googlecode.com/svn/trunk@823 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
bsalomon@google.com 2011-02-22 16:37:47 +00:00
parent 4c09d5cd4b
commit 6034c506bd
3 changed files with 1130 additions and 1 deletions

1123
gpu/src/GrRedBlackTree.h Normal file

File diff suppressed because it is too large Load Diff

View File

@ -19,6 +19,7 @@
#include "GrTDArray.h"
#include "GrTBSearch.h"
#include "GrMatrix.h"
#include "GrRedBlackTree.h"
static void dump(const GrTDArray<int>& array) {
#if 0
@ -31,7 +32,7 @@ static void dump(const GrTDArray<int>& array) {
static void test_tdarray() {
GrTDArray<int> array;
*array.append() = 0; dump(array);
*array.append() = 2; dump(array);
*array.append() = 4; dump(array);
@ -138,6 +139,7 @@ void gr_run_unittests() {
test_bsearch();
test_clip();
GrMatrix::UnitTest();
GrRedBlackTree<int>::UnitTest();
}

View File

@ -91,6 +91,7 @@
D539049B12EA01E30025F3D6 /* GrContext_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = D539049A12EA01E30025F3D6 /* GrContext_impl.h */; };
D53904A112EA026E0025F3D6 /* GrPaint.h in Headers */ = {isa = PBXBuildFile; fileRef = D53904A012EA026E0025F3D6 /* GrPaint.h */; };
D58CAF9A12E7212100CB9277 /* GrGLUtil.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D58CAF9812E7212100CB9277 /* GrGLUtil.cpp */; };
D5ED886F1313F92C00B98D64 /* GrRedBlackTree.h in Headers */ = {isa = PBXBuildFile; fileRef = D5ED886E1313F92C00B98D64 /* GrRedBlackTree.h */; };
D5FAF20C130726C6001550A4 /* GrGeometryBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = D5FAF20B130726C6001550A4 /* GrGeometryBuffer.h */; };
D5FAF22313072C27001550A4 /* GrBufferAllocPool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D5FAF22113072C27001550A4 /* GrBufferAllocPool.cpp */; };
D5FAF22413072C27001550A4 /* GrBufferAllocPool.h in Headers */ = {isa = PBXBuildFile; fileRef = D5FAF22213072C27001550A4 /* GrBufferAllocPool.h */; };
@ -182,6 +183,7 @@
D539049A12EA01E30025F3D6 /* GrContext_impl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GrContext_impl.h; path = ../../gpu/include/GrContext_impl.h; sourceTree = SOURCE_ROOT; };
D53904A012EA026E0025F3D6 /* GrPaint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GrPaint.h; path = ../../gpu/include/GrPaint.h; sourceTree = SOURCE_ROOT; };
D58CAF9812E7212100CB9277 /* GrGLUtil.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GrGLUtil.cpp; path = ../../gpu/src/GrGLUtil.cpp; sourceTree = SOURCE_ROOT; };
D5ED886E1313F92C00B98D64 /* GrRedBlackTree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GrRedBlackTree.h; path = ../../gpu/src/GrRedBlackTree.h; sourceTree = SOURCE_ROOT; };
D5FAF20B130726C6001550A4 /* GrGeometryBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GrGeometryBuffer.h; path = ../../gpu/include/GrGeometryBuffer.h; sourceTree = SOURCE_ROOT; };
D5FAF22113072C27001550A4 /* GrBufferAllocPool.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GrBufferAllocPool.cpp; path = ../../gpu/src/GrBufferAllocPool.cpp; sourceTree = SOURCE_ROOT; };
D5FAF22213072C27001550A4 /* GrBufferAllocPool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GrBufferAllocPool.h; path = ../../gpu/src/GrBufferAllocPool.h; sourceTree = SOURCE_ROOT; };
@ -275,6 +277,7 @@
08FB7795FE84155DC02AAC07 /* Source */ = {
isa = PBXGroup;
children = (
D5ED886E1313F92C00B98D64 /* GrRedBlackTree.h */,
D539049A12EA01E30025F3D6 /* GrContext_impl.h */,
00115DD812C1167A008296FE /* gr_unittests.cpp */,
00115DD912C1167A008296FE /* GrAllocPool.cpp */,
@ -394,6 +397,7 @@
D5FAF20C130726C6001550A4 /* GrGeometryBuffer.h in Headers */,
D5FAF22413072C27001550A4 /* GrBufferAllocPool.h in Headers */,
00216E5E130F0B03009A2160 /* GrGLIRect.h in Headers */,
D5ED886F1313F92C00B98D64 /* GrRedBlackTree.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};