Home
last modified time | relevance | path

Searched refs:fRandom (Results 1 – 25 of 54) sorted by relevance

123

/external/skia/samplecode/
DSampleManyRects.cpp40 SkRect rect = SkRect::MakeWH(SkIntToScalar(fRandom.nextRangeU(10, 100)), in onDrawContent()
41 SkIntToScalar(fRandom.nextRangeU(10, 100))); in onDrawContent()
42 int x = fRandom.nextRangeU(0, dsize.fWidth); in onDrawContent()
43 int y = fRandom.nextRangeU(0, dsize.fHeight); in onDrawContent()
50 rotate.setRotate(fRandom.nextUScalar1() * 360, in onDrawContent()
61 paint.setColor(fRandom.nextU()); in onDrawContent()
69 SkRandom fRandom; member in ManyRectsView
/external/skia/src/gpu/effects/
DGrDistanceFieldGeoProc.cpp273 int texIdx = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx in TestCreate()
283 kTileModes[d->fRandom->nextULessThan(SK_ARRAY_COUNT(kTileModes))], in TestCreate()
284 kTileModes[d->fRandom->nextULessThan(SK_ARRAY_COUNT(kTileModes))], in TestCreate()
286 GrSamplerParams params(tileModes, d->fRandom->nextBool() ? GrSamplerParams::kBilerp_FilterMode in TestCreate()
290 flags |= d->fRandom->nextBool() ? kSimilarity_DistanceFieldEffectFlag : 0; in TestCreate()
292 flags |= d->fRandom->nextBool() ? kScaleOnly_DistanceFieldEffectFlag : 0; in TestCreate()
295 return GrDistanceFieldA8TextGeoProc::Make(GrRandomColor(d->fRandom), in TestCreate()
296 GrTest::TestMatrix(d->fRandom), in TestCreate()
299 d->fRandom->nextF(), in TestCreate()
302 d->fRandom->nextBool()); in TestCreate()
[all …]
DGrConstColorProcessor.cpp99 int colorPicker = d->fRandom->nextULessThan(3); in TestCreate()
102 uint32_t a = d->fRandom->nextULessThan(0x100); in TestCreate()
103 uint32_t r = d->fRandom->nextULessThan(a+1); in TestCreate()
104 uint32_t g = d->fRandom->nextULessThan(a+1); in TestCreate()
105 uint32_t b = d->fRandom->nextULessThan(a+1); in TestCreate()
113 uint32_t c = d->fRandom->nextULessThan(0x100); in TestCreate()
117 InputMode mode = static_cast<InputMode>(d->fRandom->nextULessThan(kInputModeCnt)); in TestCreate()
DGrMatrixConvolutionEffect.cpp251 int texIdx = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx in TestCreate()
255 int width = d->fRandom->nextRangeU(1, MAX_KERNEL_SIZE); in TestCreate()
256 int height = d->fRandom->nextRangeU(1, MAX_KERNEL_SIZE / width); in TestCreate()
260 kernel.get()[i] = d->fRandom->nextSScalar1(); in TestCreate()
262 SkScalar gain = d->fRandom->nextSScalar1(); in TestCreate()
263 SkScalar bias = d->fRandom->nextSScalar1(); in TestCreate()
264 SkIPoint kernelOffset = SkIPoint::Make(d->fRandom->nextRangeU(0, kernelSize.width()), in TestCreate()
265 d->fRandom->nextRangeU(0, kernelSize.height())); in TestCreate()
266 SkIRect bounds = SkIRect::MakeXYWH(d->fRandom->nextRangeU(0, proxy->width()), in TestCreate()
267 d->fRandom->nextRangeU(0, proxy->height()), in TestCreate()
[all …]
DGrSimpleTextureEffect.cpp76 int texIdx = testData->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx in TestCreate()
82 kTileModes[testData->fRandom->nextULessThan(SK_ARRAY_COUNT(kTileModes))], in TestCreate()
83 kTileModes[testData->fRandom->nextULessThan(SK_ARRAY_COUNT(kTileModes))], in TestCreate()
86 testData->fRandom->nextBool() ? GrSamplerParams::kBilerp_FilterMode in TestCreate()
89 const SkMatrix& matrix = GrTest::TestMatrix(testData->fRandom); in TestCreate()
90 sk_sp<GrColorSpaceXform> colorSpaceXform = GrTest::TestColorXform(testData->fRandom); in TestCreate()
DGrTextureDomain.cpp300 int texIdx = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx in TestCreate()
304 domain.fLeft = d->fRandom->nextRangeScalar(0, proxy->width()); in TestCreate()
305 domain.fRight = d->fRandom->nextRangeScalar(domain.fLeft, proxy->width()); in TestCreate()
306 domain.fTop = d->fRandom->nextRangeScalar(0, proxy->height()); in TestCreate()
307 domain.fBottom = d->fRandom->nextRangeScalar(domain.fTop, proxy->height()); in TestCreate()
309 (GrTextureDomain::Mode) d->fRandom->nextULessThan(GrTextureDomain::kModeCount); in TestCreate()
310 const SkMatrix& matrix = GrTest::TestMatrix(d->fRandom); in TestCreate()
311 bool bilerp = mode != GrTextureDomain::kRepeat_Mode ? d->fRandom->nextBool() : false; in TestCreate()
312 sk_sp<GrColorSpaceXform> colorSpaceXform = GrTest::TestColorXform(d->fRandom); in TestCreate()
415 int texIdx = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx in TestCreate()
[all …]
DGrBitmapTextGeoProc.cpp155 int texIdx = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx in TestCreate()
165 kTileModes[d->fRandom->nextULessThan(SK_ARRAY_COUNT(kTileModes))], in TestCreate()
166 kTileModes[d->fRandom->nextULessThan(SK_ARRAY_COUNT(kTileModes))], in TestCreate()
168 GrSamplerParams params(tileModes, d->fRandom->nextBool() ? GrSamplerParams::kBilerp_FilterMode in TestCreate()
172 switch (d->fRandom->nextULessThan(3)) { in TestCreate()
184 return GrBitmapTextGeoProc::Make(GrRandomColor(d->fRandom), std::move(proxy), in TestCreate()
185 params, format, GrTest::TestMatrix(d->fRandom), in TestCreate()
186 d->fRandom->nextBool()); in TestCreate()
DGrSimpleTextureEffect.fp63 int texIdx = testData->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx
71 kTileModes[testData->fRandom->nextULessThan(SK_ARRAY_COUNT(kTileModes))],
72 kTileModes[testData->fRandom->nextULessThan(SK_ARRAY_COUNT(kTileModes))],
74 GrSamplerParams params(tileModes, testData->fRandom->nextBool()
78 const SkMatrix& matrix = GrTest::TestMatrix(testData->fRandom);
79 sk_sp<GrColorSpaceXform> colorSpaceXform = GrTest::TestColorXform(testData->fRandom);
DGrGaussianConvolutionFragmentProcessor.cpp243 int texIdx = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx in TestCreate()
248 int modeIdx = d->fRandom->nextRangeU(0, GrTextureDomain::kModeCount-1); in TestCreate()
251 if (d->fRandom->nextBool()) { in TestCreate()
253 bounds[0] = d->fRandom->nextRangeU(0, proxy->width()-1); in TestCreate()
254 bounds[1] = d->fRandom->nextRangeU(bounds[0], proxy->width()-1); in TestCreate()
257 bounds[0] = d->fRandom->nextRangeU(0, proxy->height()-1); in TestCreate()
258 bounds[1] = d->fRandom->nextRangeU(bounds[0], proxy->height()-1); in TestCreate()
261 int radius = d->fRandom->nextRangeU(1, kMaxKernelRadius); in TestCreate()
DGrEllipseEffect.cpp117 center.fX = testData->fRandom->nextRangeScalar(0.f, 1000.f); in TestCreate()
118 center.fY = testData->fRandom->nextRangeScalar(0.f, 1000.f); in TestCreate()
119 SkScalar rx = testData->fRandom->nextRangeF(0.f, 1000.f); in TestCreate()
120 SkScalar ry = testData->fRandom->nextRangeF(0.f, 1000.f); in TestCreate()
123 et = (GrPrimitiveEdgeType)testData->fRandom->nextULessThan(kGrProcessorEdgeTypeCnt); in TestCreate()
DGrConvexPolyEffect.cpp60 SkRect rect = SkRect::MakeLTRB(d->fRandom->nextSScalar1(), in TestCreate()
61 d->fRandom->nextSScalar1(), in TestCreate()
62 d->fRandom->nextSScalar1(), in TestCreate()
63 d->fRandom->nextSScalar1()); in TestCreate()
67 d->fRandom->nextULessThan(kGrProcessorEdgeTypeCnt)); in TestCreate()
354 int count = d->fRandom->nextULessThan(kMaxEdges) + 1; in TestCreate()
357 edges[i] = d->fRandom->nextSScalar1(); in TestCreate()
363 d->fRandom->nextULessThan(kGrProcessorEdgeTypeCnt)); in TestCreate()
DGrCircleEffect.cpp95 center.fX = testData->fRandom->nextRangeScalar(0.f, 1000.f); in TestCreate()
96 center.fY = testData->fRandom->nextRangeScalar(0.f, 1000.f); in TestCreate()
97 SkScalar radius = testData->fRandom->nextRangeF(0.f, 1000.f); in TestCreate()
100 et = (GrPrimitiveEdgeType)testData->fRandom->nextULessThan(kGrProcessorEdgeTypeCnt); in TestCreate()
DGrBezierEffect.cpp266 d->fRandom->nextULessThan(kGrProcessorEdgeTypeCnt)); in TestCreate()
267 gp = GrConicEffect::Make(GrRandomColor(d->fRandom), GrTest::TestMatrix(d->fRandom), in TestCreate()
268 edgeType, *d->caps(), GrTest::TestMatrix(d->fRandom), in TestCreate()
269 d->fRandom->nextBool()); in TestCreate()
468 d->fRandom->nextULessThan(kGrProcessorEdgeTypeCnt)); in TestCreate()
469 gp = GrQuadEffect::Make(GrRandomColor(d->fRandom), GrTest::TestMatrix(d->fRandom), edgeType, in TestCreate()
470 *d->caps(), GrTest::TestMatrix(d->fRandom), in TestCreate()
471 d->fRandom->nextBool()); in TestCreate()
694 d->fRandom->nextULessThan(kGrProcessorEdgeTypeCnt)); in TestCreate()
695 gp = GrCubicEffect::Make(GrRandomColor(d->fRandom), GrTest::TestMatrix(d->fRandom), in TestCreate()
[all …]
DGrCircleEffect.fp59 center.fX = testData->fRandom->nextRangeScalar(0.f, 1000.f);
60 center.fY = testData->fRandom->nextRangeScalar(0.f, 1000.f);
61 SkScalar radius = testData->fRandom->nextRangeF(0.f, 1000.f);
64 et = (GrPrimitiveEdgeType) testData->fRandom->nextULessThan(kGrProcessorEdgeTypeCnt);
DGrEllipseEffect.fp96 center.fX = testData->fRandom->nextRangeScalar(0.f, 1000.f);
97 center.fY = testData->fRandom->nextRangeScalar(0.f, 1000.f);
98 SkScalar rx = testData->fRandom->nextRangeF(0.f, 1000.f);
99 SkScalar ry = testData->fRandom->nextRangeF(0.f, 1000.f);
102 et = (GrPrimitiveEdgeType) testData->fRandom->nextULessThan(kGrProcessorEdgeTypeCnt);
DGrRRectEffect.cpp110 SkScalar w = d->fRandom->nextRangeScalar(20.f, 1000.f); in TestCreate()
111 SkScalar h = d->fRandom->nextRangeScalar(20.f, 1000.f); in TestCreate()
112 SkScalar r = d->fRandom->nextRangeF(kRadiusMin, 9.f); in TestCreate()
118 (GrPrimitiveEdgeType)d->fRandom->nextULessThan(kGrProcessorEdgeTypeCnt); in TestCreate()
440 SkScalar w = d->fRandom->nextRangeScalar(20.f, 1000.f); in TestCreate()
441 SkScalar h = d->fRandom->nextRangeScalar(20.f, 1000.f); in TestCreate()
443 r[SkRRect::kUpperLeft_Corner].fX = d->fRandom->nextRangeF(kRadiusMin, 9.f); in TestCreate()
446 r[SkRRect::kUpperLeft_Corner].fY = d->fRandom->nextRangeF(kRadiusMin, 9.f); in TestCreate()
450 if (d->fRandom->nextBool()) { in TestCreate()
452 r[SkRRect::kLowerRight_Corner].fX = d->fRandom->nextRangeF(kRadiusMin, 9.f); in TestCreate()
[all …]
/external/skia/src/effects/
DGrAlphaThresholdFragmentProcessor.fp76 float innerThresh = testData->fRandom->nextUScalar1() * .99f + 0.005f;
77 float outerThresh = testData->fRandom->nextUScalar1() * .99f + 0.005f;
80 uint32_t width = testData->fRandom->nextULessThan(kMaxWidth);
81 uint32_t height = testData->fRandom->nextULessThan(kMaxHeight);
82 uint32_t x = testData->fRandom->nextULessThan(kMaxWidth - width);
83 uint32_t y = testData->fRandom->nextULessThan(kMaxHeight - height);
85 sk_sp<GrColorSpaceXform> colorSpaceXform = GrTest::TestColorXform(testData->fRandom);
DGrAlphaThresholdFragmentProcessor.cpp117 float innerThresh = testData->fRandom->nextUScalar1() * .99f + 0.005f; in TestCreate()
118 float outerThresh = testData->fRandom->nextUScalar1() * .99f + 0.005f; in TestCreate()
121 uint32_t width = testData->fRandom->nextULessThan(kMaxWidth); in TestCreate()
122 uint32_t height = testData->fRandom->nextULessThan(kMaxHeight); in TestCreate()
123 uint32_t x = testData->fRandom->nextULessThan(kMaxWidth - width); in TestCreate()
124 uint32_t y = testData->fRandom->nextULessThan(kMaxHeight - height); in TestCreate()
126 sk_sp<GrColorSpaceXform> colorSpaceXform = GrTest::TestColorXform(testData->fRandom); in TestCreate()
DSkDisplacementMapEffect.cpp491 int texIdxDispl = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx : in TestCreate()
493 int texIdxColor = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx : in TestCreate()
500 d->fRandom->nextRangeU(1, kMaxComponent)); in TestCreate()
503 d->fRandom->nextRangeU(1, kMaxComponent)); in TestCreate()
504 SkVector scale = SkVector::Make(d->fRandom->nextRangeScalar(0, 100.0f), in TestCreate()
505 d->fRandom->nextRangeScalar(0, 100.0f)); in TestCreate()
507 colorDimensions.fWidth = d->fRandom->nextRangeU(0, colorProxy->width()); in TestCreate()
508 colorDimensions.fHeight = d->fRandom->nextRangeU(0, colorProxy->height()); in TestCreate()
509 auto colorSpaceXform = GrTest::TestColorXform(d->fRandom); in TestCreate()
/external/skia/src/shaders/gradients/
DSkTwoPointConicalGradient_gpu.cpp186 SkPoint center1 = {d->fRandom->nextUScalar1(), d->fRandom->nextUScalar1()}; in TestCreate()
187 SkScalar radius1 = d->fRandom->nextUScalar1(); in TestCreate()
191 center2.set(d->fRandom->nextUScalar1(), d->fRandom->nextUScalar1()); in TestCreate()
202 RandomGradientParams params(d->fRandom); in TestCreate()
468 SkPoint center1 = {d->fRandom->nextUScalar1(), d->fRandom->nextUScalar1()}; in TestCreate()
473 center2.set(d->fRandom->nextUScalar1(), d->fRandom->nextUScalar1()); in TestCreate()
480 radius2 = d->fRandom->nextRangeF(0.f, diffLen); in TestCreate()
482 RandomGradientParams params(d->fRandom); in TestCreate()
672 SkPoint center1 = {d->fRandom->nextUScalar1(), d->fRandom->nextUScalar1()}; in TestCreate()
677 center2.set(d->fRandom->nextUScalar1(), d->fRandom->nextUScalar1()); in TestCreate()
[all …]
/external/skia/src/gpu/
DGrDefaultGeoProcFactory.cpp297 if (d->fRandom->nextBool()) { in TestCreate()
300 if (d->fRandom->nextBool()) { in TestCreate()
303 if (d->fRandom->nextBool()) { in TestCreate()
306 if (d->fRandom->nextBool()) { in TestCreate()
311 GrRandomColor(d->fRandom), in TestCreate()
312 GrTest::TestColorXform(d->fRandom), in TestCreate()
313 GrTest::TestMatrix(d->fRandom), in TestCreate()
314 GrTest::TestMatrix(d->fRandom), in TestCreate()
315 d->fRandom->nextBool(), in TestCreate()
316 GrRandomCoverage(d->fRandom)); in TestCreate()
DGrProcessorUnitTest.h53 : fRandom(random) in GrProcessorTestData()
60 SkRandom* fRandom; member
91 uint32_t idx = data->fRandom->nextRangeU(0, GetFactories()->count() - 1); in Make()
126 uint32_t idx = data->fRandom->nextRangeU(0, GetFactories()->count() - 1); in Get()
/external/skia/bench/
DMatrixBench.cpp150 SkScalar rot0 = (fRandom.nextBool()) ? fRandom.nextRangeF(-180, 180) : 0.0f; in onDelayedSetup()
151 SkScalar sx = fRandom.nextRangeF(-3000.f, 3000.f); in onDelayedSetup()
152 SkScalar sy = (fRandom.nextBool()) ? fRandom.nextRangeF(-3000.f, 3000.f) : sx; in onDelayedSetup()
153 SkScalar rot1 = fRandom.nextRangeF(-180, 180); in onDelayedSetup()
167 SkRandom fRandom; member in DecomposeMatrixBench
/external/skia/tests/
DGLProgramsTest.cpp176 bool terminate = (1 == maxLevels) || (d->fRandom->nextF() < terminateProbability); in create_random_proc_tree()
197 SkBlendMode mode = static_cast<SkBlendMode>(d->fRandom->nextRangeU(0, in create_random_proc_tree()
200 if (d->fRandom->nextF() < 0.5f) { in create_random_proc_tree()
218 if (d->fRandom->nextF() < procTreeProbability) { in set_random_color_coverage_stages()
224 int numProcs = d->fRandom->nextULessThan(maxStages + 1); in set_random_color_coverage_stages()
225 int numColorProcs = d->fRandom->nextULessThan(numProcs + 1); in set_random_color_coverage_stages()
/external/skia/gm/
Dblurcircles2.cpp98 blurRadius += fRandom.nextSScalar1() * kDeltaBlurRadius; in onDraw()
106 radius += fRandom.nextSScalar1() * kDeltaRadius; in onDraw()
159 SkRandom fRandom; member in BlurCircles2GM

123