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

Side by Side Diff: tests/PaintTest.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/PackBitsTest.cpp ('k') | tests/PathTest.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 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "Test.h" 8 #include "Test.h"
9 #include "SkBlurMask.h" 9 #include "SkBlurMask.h"
10 #include "SkBlurMaskFilter.h" 10 #include "SkBlurMaskFilter.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 64
65 static const struct { 65 static const struct {
66 size_t (*fSeedTextProc)(const SkUnichar[], void* dst, int count); 66 size_t (*fSeedTextProc)(const SkUnichar[], void* dst, int count);
67 SkPaint::TextEncoding fEncoding; 67 SkPaint::TextEncoding fEncoding;
68 } gRec[] = { 68 } gRec[] = {
69 { uni_to_utf8, SkPaint::kUTF8_TextEncoding }, 69 { uni_to_utf8, SkPaint::kUTF8_TextEncoding },
70 { uni_to_utf16, SkPaint::kUTF16_TextEncoding }, 70 { uni_to_utf16, SkPaint::kUTF16_TextEncoding },
71 { uni_to_utf32, SkPaint::kUTF32_TextEncoding }, 71 { uni_to_utf32, SkPaint::kUTF32_TextEncoding },
72 }; 72 };
73 73
74 SkMWCRandom rand; 74 SkRandom rand;
75 SkPaint paint; 75 SkPaint paint;
76 paint.setTypeface(SkTypeface::RefDefault())->unref(); 76 paint.setTypeface(SkTypeface::RefDefault())->unref();
77 SkTypeface* face = paint.getTypeface(); 77 SkTypeface* face = paint.getTypeface();
78 78
79 for (int i = 0; i < 1000; ++i) { 79 for (int i = 0; i < 1000; ++i) {
80 // generate some random text 80 // generate some random text
81 for (int j = 0; j < NGLYPHS; ++j) { 81 for (int j = 0; j < NGLYPHS; ++j) {
82 src[j] = ' ' + j; 82 src[j] = ' ' + j;
83 } 83 }
84 // inject some random chars, to sometimes abort early 84 // inject some random chars, to sometimes abort early
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 247
248 // need to implement charsToGlyphs on other backends (e.g. linux, win) 248 // need to implement charsToGlyphs on other backends (e.g. linux, win)
249 // before we can run this tests everywhere 249 // before we can run this tests everywhere
250 if (false) { 250 if (false) {
251 test_cmap(reporter); 251 test_cmap(reporter);
252 } 252 }
253 } 253 }
254 254
255 #include "TestClassDef.h" 255 #include "TestClassDef.h"
256 DEFINE_TESTCLASS("Paint", TestPaintClass, TestPaint) 256 DEFINE_TESTCLASS("Paint", TestPaintClass, TestPaint)
OLDNEW
« no previous file with comments | « tests/PackBitsTest.cpp ('k') | tests/PathTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698