Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Side by Side Diff: src/gpu/GrRedBlackTree.h

Issue 23576015: Change old PRG to be SkLCGRandom; change new one to SkRandom (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Fix some spurious SkMWCRandoms Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/gpu/GrOvalRenderer.cpp ('k') | src/gpu/effects/GrBezierEffect.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #ifndef GrRedBlackTree_DEFINED 10 #ifndef GrRedBlackTree_DEFINED
(...skipping 931 matching lines...) Expand 10 before | Expand all | Expand 10 after
942 return true; 942 return true;
943 } 943 }
944 #endif 944 #endif
945 945
946 #include "SkRandom.h" 946 #include "SkRandom.h"
947 947
948 template <typename T, typename C> 948 template <typename T, typename C>
949 void GrRedBlackTree<T,C>::UnitTest() { 949 void GrRedBlackTree<T,C>::UnitTest() {
950 GrRedBlackTree<int> tree; 950 GrRedBlackTree<int> tree;
951 951
952 SkMWCRandom r; 952 SkRandom r;
953 953
954 int count[100] = {0}; 954 int count[100] = {0};
955 // add 10K ints 955 // add 10K ints
956 for (int i = 0; i < 10000; ++i) { 956 for (int i = 0; i < 10000; ++i) {
957 int x = r.nextU()%100; 957 int x = r.nextU()%100;
958 SkDEBUGCODE(Iter xi = ) tree.insert(x); 958 SkDEBUGCODE(Iter xi = ) tree.insert(x);
959 SkASSERT(*xi == x); 959 SkASSERT(*xi == x);
960 ++count[x]; 960 ++count[x];
961 } 961 }
962 962
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
1108 // remove all entries 1108 // remove all entries
1109 while (!tree.empty()) { 1109 while (!tree.empty()) {
1110 tree.remove(tree.begin()); 1110 tree.remove(tree.begin());
1111 } 1111 }
1112 1112
1113 // test reset on empty tree. 1113 // test reset on empty tree.
1114 tree.reset(); 1114 tree.reset();
1115 } 1115 }
1116 1116
1117 #endif 1117 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrOvalRenderer.cpp ('k') | src/gpu/effects/GrBezierEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698