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

Side by Side Diff: src/core/SkFloat.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 | « samplecode/SampleVertices.cpp ('k') | src/core/SkXfermode.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 2008 The Android Open Source Project 3 * Copyright 2008 The Android Open Source Project
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 #include "SkFloat.h" 10 #include "SkFloat.h"
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 n = b.getInt(); 284 n = b.getInt();
285 SkASSERT(n == 5); 285 SkASSERT(n == 5);
286 286
287 c.setInt(-3); 287 c.setInt(-3);
288 n = c.getInt(); 288 n = c.getInt();
289 SkASSERT(n == -3); 289 SkASSERT(n == -3);
290 290
291 d.setAdd(c, b); 291 d.setAdd(c, b);
292 SkDebugf("SkFloat: %d + %d = %d\n", c.getInt(), b.getInt(), d.getInt()); 292 SkDebugf("SkFloat: %d + %d = %d\n", c.getInt(), b.getInt(), d.getInt());
293 293
294 SkMWCRandom rand; 294 SkRandom rand;
295 295
296 int i; 296 int i;
297 for (i = 0; i < 1000; i++) 297 for (i = 0; i < 1000; i++)
298 { 298 {
299 float fa, fb; 299 float fa, fb;
300 int aa = rand.nextS() >> 14; 300 int aa = rand.nextS() >> 14;
301 int bb = rand.nextS() >> 14; 301 int bb = rand.nextS() >> 14;
302 a.setInt(aa); 302 a.setInt(aa);
303 b.setInt(bb); 303 b.setInt(bb);
304 SkASSERT(a.getInt() == aa); 304 SkASSERT(a.getInt() == aa);
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 a.assertEquals(2.0f, 0); 384 a.assertEquals(2.0f, 0);
385 a.setInt(27); 385 a.setInt(27);
386 a.cubeRoot(); 386 a.cubeRoot();
387 a.assertEquals(3.0f, 0); 387 a.assertEquals(3.0f, 0);
388 #endif 388 #endif
389 } 389 }
390 #endif 390 #endif
391 } 391 }
392 392
393 #endif 393 #endif
OLDNEW
« no previous file with comments | « samplecode/SampleVertices.cpp ('k') | src/core/SkXfermode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698