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

Side by Side Diff: tests/ClipStackTest.cpp

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 | « tests/ClampRangeTest.cpp ('k') | tests/ColorFilterTest.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 #include "Test.h" 8 #include "Test.h"
9 #if SK_SUPPORT_GPU 9 #if SK_SUPPORT_GPU
10 #include "GrReducedClip.h" 10 #include "GrReducedClip.h"
(...skipping 903 matching lines...) Expand 10 before | Expand all | Expand 10 after
914 914
915 // We want to test inverse fills. However, they are quite rare in practice s o don't over do it. 915 // We want to test inverse fills. However, they are quite rare in practice s o don't over do it.
916 static const SkScalar kFractionInverted = SK_Scalar1 / kMaxElemsPerTest; 916 static const SkScalar kFractionInverted = SK_Scalar1 / kMaxElemsPerTest;
917 917
918 static const AddElementFunc kElementFuncs[] = { 918 static const AddElementFunc kElementFuncs[] = {
919 add_rect, 919 add_rect,
920 add_round_rect, 920 add_round_rect,
921 add_oval, 921 add_oval,
922 }; 922 };
923 923
924 SkMWCRandom r; 924 SkRandom r;
925 925
926 for (int i = 0; i < kNumTests; ++i) { 926 for (int i = 0; i < kNumTests; ++i) {
927 // Randomly generate a clip stack. 927 // Randomly generate a clip stack.
928 SkClipStack stack; 928 SkClipStack stack;
929 int numElems = r.nextRangeU(kMinElemsPerTest, kMaxElemsPerTest); 929 int numElems = r.nextRangeU(kMinElemsPerTest, kMaxElemsPerTest);
930 for (int e = 0; e < numElems; ++e) { 930 for (int e = 0; e < numElems; ++e) {
931 SkRegion::Op op = kOps[r.nextULessThan(SK_ARRAY_COUNT(kOps))]; 931 SkRegion::Op op = kOps[r.nextULessThan(SK_ARRAY_COUNT(kOps))];
932 if (op == SkRegion::kReplace_Op) { 932 if (op == SkRegion::kReplace_Op) {
933 if (r.nextU() % kReplaceDiv) { 933 if (r.nextU() % kReplaceDiv) {
934 --e; 934 --e;
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
1055 test_rect_inverse_fill(reporter); 1055 test_rect_inverse_fill(reporter);
1056 test_path_replace(reporter); 1056 test_path_replace(reporter);
1057 test_quickContains(reporter); 1057 test_quickContains(reporter);
1058 #if SK_SUPPORT_GPU 1058 #if SK_SUPPORT_GPU
1059 test_reduced_clip_stack(reporter); 1059 test_reduced_clip_stack(reporter);
1060 #endif 1060 #endif
1061 } 1061 }
1062 1062
1063 #include "TestClassDef.h" 1063 #include "TestClassDef.h"
1064 DEFINE_TESTCLASS("ClipStack", TestClipStackClass, TestClipStack) 1064 DEFINE_TESTCLASS("ClipStack", TestClipStackClass, TestClipStack)
OLDNEW
« no previous file with comments | « tests/ClampRangeTest.cpp ('k') | tests/ColorFilterTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698