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

Side by Side Diff: include/gpu/GrTestUtils.h

Issue 1108053004: Add dash lines batch unit test (Closed) Base URL: https://skia.googlesource.com/skia.git@randbatch1
Patch Set: tweaks Created 5 years, 7 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
« no previous file with comments | « no previous file | src/gpu/GrStrokeInfo.h » ('j') | src/gpu/GrTestUtils.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 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 #ifndef GrTestUtils_DEFINED 8 #ifndef GrTestUtils_DEFINED
9 #define GrTestUtils_DEFINED 9 #define GrTestUtils_DEFINED
10 10
11 #include "SkTypes.h" 11 #include "SkTypes.h"
12 12
13 #ifdef GR_TEST_UTILS 13 #ifdef GR_TEST_UTILS
14 14
15 #include "GrColor.h" 15 #include "GrColor.h"
16 #include "SkRandom.h" 16 #include "SkRandom.h"
17 17
18 class SkMatrix; 18 class SkMatrix;
19 struct SkRect; 19 struct SkRect;
20 20
21 namespace GrTest { 21 namespace GrTest {
22 /** 22 /**
23 * A helper for use in Test functions. 23 * A helper for use in Test functions.
24 */ 24 */
25 const SkMatrix& TestMatrix(SkRandom*); 25 const SkMatrix& TestMatrix(SkRandom*);
26 const SkMatrix& TestMatrixPreservesRightAngles(SkRandom*);
26 const SkRect& TestRect(SkRandom*); 27 const SkRect& TestRect(SkRandom*);
27 28
28 } 29 }
29 30
30 static inline GrColor GrRandomColor(SkRandom* random) { 31 static inline GrColor GrRandomColor(SkRandom* random) {
31 // There are only a few cases of random colors which interest us 32 // There are only a few cases of random colors which interest us
32 enum ColorMode { 33 enum ColorMode {
33 kAllOnes_ColorMode, 34 kAllOnes_ColorMode,
34 kAllZeros_ColorMode, 35 kAllZeros_ColorMode,
35 kAlphaOne_ColorMode, 36 kAlphaOne_ColorMode,
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 break; 84 break;
84 case kRandom_CoverageMode: 85 case kRandom_CoverageMode:
85 coverage = random->nextULessThan(256); 86 coverage = random->nextULessThan(256);
86 break; 87 break;
87 } 88 }
88 return coverage; 89 return coverage;
89 } 90 }
90 91
91 #endif 92 #endif
92 #endif 93 #endif
OLDNEW
« no previous file with comments | « no previous file | src/gpu/GrStrokeInfo.h » ('j') | src/gpu/GrTestUtils.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698