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

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

Issue 1275553002: Implement caching of stroked paths in the tessellating path renderer. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Use IsStrokeHairlineOrEquivalent() instead of stroke->isHairline() Created 5 years, 4 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/GrTessellatingPathRenderer.cpp » ('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 #include "SkStrokeRec.h" 17 #include "SkStrokeRec.h"
18 18
19 class GrStrokeInfo;
19 class SkMatrix; 20 class SkMatrix;
20 class SkPath; 21 class SkPath;
21 class SkRRect; 22 class SkRRect;
22 struct SkRect; 23 struct SkRect;
23 24
24 namespace GrTest { 25 namespace GrTest {
25 /** 26 /**
26 * A helper for use in Test functions. 27 * A helper for use in Test functions.
27 */ 28 */
28 const SkMatrix& TestMatrix(SkRandom*); 29 const SkMatrix& TestMatrix(SkRandom*);
29 const SkMatrix& TestMatrixPreservesRightAngles(SkRandom*); 30 const SkMatrix& TestMatrixPreservesRightAngles(SkRandom*);
30 const SkMatrix& TestMatrixRectStaysRect(SkRandom*); 31 const SkMatrix& TestMatrixRectStaysRect(SkRandom*);
31 const SkMatrix& TestMatrixInvertible(SkRandom*); 32 const SkMatrix& TestMatrixInvertible(SkRandom*);
32 const SkRect& TestRect(SkRandom*); 33 const SkRect& TestRect(SkRandom*);
33 const SkRect& TestSquare(SkRandom*); 34 const SkRect& TestSquare(SkRandom*);
34 const SkRRect& TestRRectSimple(SkRandom*); 35 const SkRRect& TestRRectSimple(SkRandom*);
35 const SkPath& TestPath(SkRandom*); 36 const SkPath& TestPath(SkRandom*);
36 const SkPath& TestPathConvex(SkRandom*); 37 const SkPath& TestPathConvex(SkRandom*);
37 SkStrokeRec TestStrokeRec(SkRandom*); 38 SkStrokeRec TestStrokeRec(SkRandom*);
39 GrStrokeInfo TestStrokeInfo(SkRandom*);
38 40
39 } 41 }
40 42
41 static inline GrColor GrRandomColor(SkRandom* random) { 43 static inline GrColor GrRandomColor(SkRandom* random) {
42 // There are only a few cases of random colors which interest us 44 // There are only a few cases of random colors which interest us
43 enum ColorMode { 45 enum ColorMode {
44 kAllOnes_ColorMode, 46 kAllOnes_ColorMode,
45 kAllZeros_ColorMode, 47 kAllZeros_ColorMode,
46 kAlphaOne_ColorMode, 48 kAlphaOne_ColorMode,
47 kRandom_ColorMode, 49 kRandom_ColorMode,
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 break; 96 break;
95 case kRandom_CoverageMode: 97 case kRandom_CoverageMode:
96 coverage = random->nextULessThan(256); 98 coverage = random->nextULessThan(256);
97 break; 99 break;
98 } 100 }
99 return coverage; 101 return coverage;
100 } 102 }
101 103
102 #endif 104 #endif
103 #endif 105 #endif
OLDNEW
« no previous file with comments | « no previous file | src/gpu/GrTessellatingPathRenderer.cpp » ('j') | src/gpu/GrTestUtils.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698