• Home
  • Raw
  • Download

Lines Matching full:rand

354 const skcms_TransferFunction& random_xfer_function(SkRandom* rand) {  in random_xfer_function()  argument
355 return gTransferFunctions[rand->nextULessThan(kTransferFunctionCount)]; in random_xfer_function()
368 const skcms_Matrix3x3& random_gamut(SkRandom* rand) { in random_gamut() argument
369 return gGamuts[rand->nextULessThan(kGamutCount)]; in random_gamut()
384 ColorSpaceType random_colorspacetype(SkRandom* rand) { in random_colorspacetype() argument
385 return static_cast<ColorSpaceType>(rand->nextULessThan(kColorSpaceTypeCount)); in random_colorspacetype()
388 sk_sp<SkColorSpace> random_colorspace(SkRandom* rand) { in random_colorspace() argument
389 ColorSpaceType cs = random_colorspacetype(rand); in random_colorspace()
401 return SkColorSpace::MakeRGB(random_xfer_function(rand), random_gamut(rand)); in random_colorspace()
413 SkColor random_color(SkRandom* rand, ColorConstraint constraint) { in random_color() argument
414 uint32_t color = rand->nextU(); in random_color()
425 SkColor4f random_color4f(SkRandom* rand, ColorConstraint constraint) { in random_color4f() argument
426 SkColor4f result = { rand->nextRangeF(0.0f, 1.0f), in random_color4f()
427 rand->nextRangeF(0.0f, 1.0f), in random_color4f()
428 rand->nextRangeF(0.0f, 1.0f), in random_color4f()
429 rand->nextRangeF(0.0f, 1.0f) }; in random_color4f()
440 SkTileMode random_tilemode(SkRandom* rand) { in random_tilemode() argument
441 return static_cast<SkTileMode>(rand->nextULessThan(kSkTileModeCount)); in random_tilemode()
444 ShaderType random_shadertype(SkRandom* rand) { in random_shadertype() argument
445 return static_cast<ShaderType>(rand->nextULessThan(kShaderTypeCount)); in random_shadertype()
448 SkBlendMode random_porter_duff_bm(SkRandom* rand) { in random_porter_duff_bm() argument
452 return static_cast<SkBlendMode>(rand->nextRangeU((unsigned int) SkBlendMode::kClear, in random_porter_duff_bm()
456 SkBlendMode random_complex_bm(SkRandom* rand) { in random_complex_bm() argument
457 return static_cast<SkBlendMode>(rand->nextRangeU((unsigned int) SkBlendMode::kPlus, in random_complex_bm()
461 SkBlendMode random_blend_mode(SkRandom* rand) { in random_blend_mode() argument
462 return static_cast<SkBlendMode>(rand->nextULessThan(kSkBlendModeCount)); in random_blend_mode()
465 [[maybe_unused]] MaskFilterType random_maskfiltertype(SkRandom* rand) { in random_maskfiltertype() argument
466 if (rand->nextBool()) { in random_maskfiltertype()
470 return static_cast<MaskFilterType>(rand->nextULessThan(kMaskFilterTypeCount)); in random_maskfiltertype()
473 BlenderType random_blendertype(SkRandom* rand) { in random_blendertype() argument
474 return static_cast<BlenderType>(rand->nextULessThan(kBlenderTypeCount)); in random_blendertype()
477 ColorFilterType random_colorfiltertype(SkRandom* rand) { in random_colorfiltertype() argument
478 return static_cast<ColorFilterType>(rand->nextULessThan(kColorFilterTypeCount)); in random_colorfiltertype()
481 ImageFilterType random_imagefiltertype(SkRandom* rand) { in random_imagefiltertype() argument
482 return static_cast<ImageFilterType>(rand->nextULessThan(kImageFilterTypeCount)); in random_imagefiltertype()
485 [[maybe_unused]] ClipType random_cliptype(SkRandom* rand) { in random_cliptype() argument
486 if (rand->nextBool()) { in random_cliptype()
490 return static_cast<ClipType>(rand->nextULessThan(kClipTypeCount)); in random_cliptype()
493 [[maybe_unused]] DrawTypeFlags random_drawtype(SkRandom* rand) { in random_drawtype() argument
494 uint32_t index = rand->nextULessThan(9); in random_drawtype()
517 SkMatrix* random_local_matrix(SkRandom* rand, in random_local_matrix() argument
521 uint32_t matrix = rand->nextULessThan(constaint == LocalMatrixConstraint::kNone ? 4 : 3); in random_local_matrix()
537 sk_sp<SkImage> make_image(SkRandom* rand, Recorder* recorder) { in make_image() argument
539 if (rand->nextBool()) { in make_image()
543 SkImageInfo info = SkImageInfo::Make(32, 32, ct, kPremul_SkAlphaType, random_colorspace(rand)); in make_image()
555 sk_sp<SkImage> make_yuv_image(SkRandom* rand, Recorder* recorder) { in make_yuv_image() argument
558 if (rand->nextBool()) { in make_yuv_image()
578 if (rand->nextBool()) { in make_yuv_image()
590 sk_sp<SkPicture> make_picture(SkRandom* rand) { in make_picture() argument
605 std::pair<sk_sp<SkShader>, sk_sp<PrecompileShader>> create_coord_clamp_shader(SkRandom* rand, in create_coord_clamp_shader() argument
607 auto [s, o] = create_random_shader(rand, recorder); in create_coord_clamp_shader()
622 std::pair<sk_sp<SkShader>, sk_sp<PrecompileShader>> create_empty_shader(SkRandom* /* rand */) {
630 std::pair<sk_sp<SkShader>, sk_sp<PrecompileShader>> create_perlin_noise_shader(SkRandom* rand) { in create_perlin_noise_shader() argument
634 if (rand->nextBool()) { in create_perlin_noise_shader()
651 std::pair<sk_sp<SkShader>, sk_sp<PrecompileShader>> create_picture_shader(SkRandom* rand) { in create_picture_shader() argument
652 sk_sp<SkPicture> picture = make_picture(rand); in create_picture_shader()
657 SkMatrix* lmPtr = random_local_matrix(rand, &lmStorage); in create_picture_shader()
671 SkRandom* rand, in create_solid_shader() argument
676 if (rand->nextBool()) { in create_solid_shader()
677 s = SkShaders::Color(random_color(rand, constraint)); in create_solid_shader()
680 sk_sp<SkColorSpace> cs = random_colorspace(rand); in create_solid_shader()
681 s = SkShaders::Color(random_color4f(rand, constraint), cs); in create_solid_shader()
689 SkRandom* rand, in create_gradient_shader() argument
696 random_color4f(rand, constraint), in create_gradient_shader()
697 random_color4f(rand, constraint), in create_gradient_shader()
698 random_color4f(rand, constraint), in create_gradient_shader()
699 random_color4f(rand, constraint), in create_gradient_shader()
700 random_color4f(rand, constraint), in create_gradient_shader()
701 random_color4f(rand, constraint), in create_gradient_shader()
702 random_color4f(rand, constraint), in create_gradient_shader()
703 random_color4f(rand, constraint), in create_gradient_shader()
704 random_color4f(rand, constraint) in create_gradient_shader()
722 switch (rand->nextULessThan(3)) { in create_gradient_shader()
730 SkMatrix* lmPtr = random_local_matrix(rand, &lmStorage); in create_gradient_shader()
733 rand->nextBool() ? SkGradientShader::Interpolation::InPremul::kYes in create_gradient_shader()
737 rand->nextULessThan(SkGradientShader::Interpolation::kColorSpaceCount)); in create_gradient_shader()
743 SkTileMode tm = random_tilemode(rand); in create_gradient_shader()
783 std::pair<sk_sp<SkShader>, sk_sp<PrecompileShader>> create_localmatrix_shader(SkRandom* rand, in create_localmatrix_shader() argument
785 auto [s, o] = create_random_shader(rand, recorder); in create_localmatrix_shader()
792 bool hasPerspective = rand->nextBool(); in create_localmatrix_shader()
795 random_local_matrix(rand, &lmStorage, hasPerspective ? LocalMatrixConstraint::kWithPerspective in create_localmatrix_shader()
801 std::pair<sk_sp<SkShader>, sk_sp<PrecompileShader>> create_colorfilter_shader(SkRandom* rand, in create_colorfilter_shader() argument
803 auto [s, o] = create_random_shader(rand, recorder); in create_colorfilter_shader()
810 auto [cf, cfO] = create_random_colorfilter(rand); in create_colorfilter_shader()
816 std::pair<sk_sp<SkShader>, sk_sp<PrecompileShader>> create_image_shader(SkRandom* rand, in create_image_shader() argument
818 SkTileMode tmX = random_tilemode(rand); in create_image_shader()
819 SkTileMode tmY = random_tilemode(rand); in create_image_shader()
825 SkMatrix* lmPtr = random_local_matrix(rand, &lmStorage); in create_image_shader()
830 sk_sp<SkImage> image = make_image(rand, recorder); in create_image_shader()
833 switch (rand->nextULessThan(4)) { in create_image_shader()
861 std::pair<sk_sp<SkShader>, sk_sp<PrecompileShader>> create_yuv_image_shader(SkRandom* rand, in create_yuv_image_shader() argument
863 SkTileMode tmX = random_tilemode(rand); in create_yuv_image_shader()
864 SkTileMode tmY = random_tilemode(rand); in create_yuv_image_shader()
867 SkMatrix* lmPtr = random_local_matrix(rand, &lmStorage); in create_yuv_image_shader()
873 if (rand->nextBool()) { in create_yuv_image_shader()
877 sk_sp<SkImage> yuvImage = make_yuv_image(rand, recorder); in create_yuv_image_shader()
878 if (rand->nextBool()) { in create_yuv_image_shader()
890 std::pair<sk_sp<SkShader>, sk_sp<PrecompileShader>> create_blend_shader(SkRandom* rand, in create_blend_shader() argument
894 auto [blender, blenderO] = create_random_blender(rand); in create_blend_shader()
896 auto [dstS, dstO] = create_random_shader(rand, recorder); in create_blend_shader()
902 auto [srcS, srcO] = create_random_shader(rand, recorder); in create_blend_shader()
915 std::pair<sk_sp<SkShader>, sk_sp<PrecompileShader>> create_workingCS_shader(SkRandom* rand, in create_workingCS_shader() argument
917 auto [wrappedS, wrappedO] = create_random_shader(rand, recorder); in create_workingCS_shader()
923 sk_sp<SkColorSpace> cs = random_colorspace(rand); in create_workingCS_shader()
930 std::pair<sk_sp<SkShader>, sk_sp<PrecompileShader>> create_shader(SkRandom* rand, in create_shader() argument
938 return create_blend_shader(rand, recorder); in create_shader()
940 return create_colorfilter_shader(rand, recorder); in create_shader()
942 return create_coord_clamp_shader(rand, recorder); in create_shader()
944 return create_gradient_shader(rand, SkShaderBase::GradientType::kConical); in create_shader()
946 // return create_empty_shader(rand); in create_shader()
948 return create_image_shader(rand, recorder); in create_shader()
950 return create_gradient_shader(rand, SkShaderBase::GradientType::kLinear); in create_shader()
952 return create_localmatrix_shader(rand, recorder); in create_shader()
954 return create_perlin_noise_shader(rand); in create_shader()
956 return create_picture_shader(rand); in create_shader()
958 return create_gradient_shader(rand, SkShaderBase::GradientType::kRadial); in create_shader()
962 return create_solid_shader(rand); in create_shader()
964 return create_gradient_shader(rand, SkShaderBase::GradientType::kSweep); in create_shader()
966 return create_yuv_image_shader(rand, recorder); in create_shader()
968 return create_workingCS_shader(rand, recorder); in create_shader()
974 std::pair<sk_sp<SkShader>, sk_sp<PrecompileShader>> create_random_shader(SkRandom* rand, in create_random_shader() argument
976 return create_shader(rand, recorder, random_shadertype(rand)); in create_random_shader()
979 std::pair<sk_sp<SkShader>, sk_sp<PrecompileShader>> create_clip_shader(SkRandom* rand, in create_clip_shader() argument
984 switch (rand->nextULessThan(5)) { in create_clip_shader()
985 case 0: return create_gradient_shader(rand, SkShaderBase::GradientType::kConical, in create_clip_shader()
987 case 1: return create_gradient_shader(rand, SkShaderBase::GradientType::kLinear, in create_clip_shader()
989 case 2: return create_gradient_shader(rand, SkShaderBase::GradientType::kRadial, in create_clip_shader()
991 case 3: return create_solid_shader(rand, ColorConstraint::kTransparent); in create_clip_shader()
992 case 4: return create_gradient_shader(rand, SkShaderBase::GradientType::kSweep, in create_clip_shader()
999 std::pair<sk_sp<SkBlender>, sk_sp<PrecompileBlender>> create_bm_blender(SkRandom* rand, in create_bm_blender() argument
1015 std::pair<sk_sp<SkBlender>, sk_sp<PrecompileBlender>> create_rt_blender(SkRandom* rand) { in create_rt_blender() argument
1016 int option = rand->nextULessThan(3); in create_rt_blender()
1027 std::pair<sk_sp<SkBlender>, sk_sp<PrecompileBlender>> create_blender(SkRandom* rand, in create_blender() argument
1033 return create_bm_blender(rand, random_porter_duff_bm(rand)); in create_blender()
1035 return create_bm_blender(rand, random_complex_bm(rand)); in create_blender()
1039 return create_rt_blender(rand); in create_blender()
1045 std::pair<sk_sp<SkBlender>, sk_sp<PrecompileBlender>> create_random_blender(SkRandom* rand) { in create_random_blender() argument
1046 return create_blender(rand, random_blendertype(rand)); in create_random_blender()
1054 SkRandom* rand) { in create_rt_colorfilter() argument
1055 int option = rand->nextULessThan(3); in create_rt_colorfilter()
1067 SkRandom* rand) { in create_lerp_colorfilter() argument
1069 auto [dst, dstO] = create_random_colorfilter(rand); in create_lerp_colorfilter()
1070 auto [src, srcO] = create_random_colorfilter(rand); in create_lerp_colorfilter()
1074 std::tie(src, srcO) = create_random_colorfilter(rand); in create_lerp_colorfilter()
1095 SkRandom* rand) { in create_blendmode_colorfilter() argument
1103 blend = random_blend_mode(rand); in create_blendmode_colorfilter()
1104 cf = SkColorFilters::Blend(random_color4f(rand, ColorConstraint::kNone), in create_blendmode_colorfilter()
1105 random_colorspace(rand), in create_blendmode_colorfilter()
1123 SkRandom* rand) { in create_color_space_colorfilter() argument
1124 sk_sp<SkColorSpace> src = random_colorspace(rand); in create_color_space_colorfilter()
1125 sk_sp<SkColorSpace> dst = random_colorspace(rand); in create_color_space_colorfilter()
1164 SkRandom* rand) { in create_compose_colorfilter() argument
1165 auto [outerCF, outerO] = create_random_colorfilter(rand); in create_compose_colorfilter()
1166 auto [innerCF, innerO] = create_random_colorfilter(rand); in create_compose_colorfilter()
1185 SkRandom* rand) { in create_workingformat_colorfilter() argument
1186 auto [childCF, childO] = create_random_colorfilter(rand); in create_workingformat_colorfilter()
1194 const skcms_TransferFunction* tf = rand->nextBool() ? &random_xfer_function(rand) : nullptr; in create_workingformat_colorfilter()
1195 const skcms_Matrix3x3* gamut = rand->nextBool() ? &random_gamut(rand) : nullptr; in create_workingformat_colorfilter()
1216 SkRandom* rand, in create_colorfilter() argument
1223 return create_blendmode_colorfilter(rand); in create_colorfilter()
1225 return create_color_space_colorfilter(rand); in create_colorfilter()
1227 return create_compose_colorfilter(rand); in create_colorfilter()
1235 return create_lerp_colorfilter(rand); in create_colorfilter()
1247 return create_rt_colorfilter(rand); in create_colorfilter()
1253 return create_workingformat_colorfilter(rand); in create_colorfilter()
1260 SkRandom* rand) { in create_random_colorfilter() argument
1261 return create_colorfilter(rand, random_colorfiltertype(rand)); in create_random_colorfilter()
1267 SkRandom* /* rand */) { in arithmetic_imagefilter()
1284 SkRandom* rand) { in blendmode_imagefilter() argument
1286 SkBlendMode bm = random_blend_mode(rand); in blendmode_imagefilter()
1299 SkRandom* rand) { in runtime_blender_imagefilter() argument
1301 auto [blender, blenderO] = create_blender(rand, BlenderType::kRuntime); in runtime_blender_imagefilter()
1313 SkRandom* rand) { in blur_imagefilter() argument
1315 int option = rand->nextULessThan(3); in blur_imagefilter()
1333 SkRandom* rand) { in displacement_imagefilter() argument
1359 SkRandom* rand) { in colorfilter_imagefilter() argument
1361 auto [cf, o] = create_random_colorfilter(rand); in colorfilter_imagefilter()
1365 if (rand->nextBool()) { in colorfilter_imagefilter()
1367 auto [cf2, o2] = create_random_colorfilter(rand); in colorfilter_imagefilter()
1380 SkRandom* rand) { in lighting_imagefilter() argument
1387 int option = rand->nextULessThan(6); in lighting_imagefilter()
1441 SkRandom* rand) { in matrix_convolution_imagefilter() argument
1445 int option = rand->nextULessThan(3); in matrix_convolution_imagefilter()
1473 SkRandom* rand) { in morphology_imagefilter() argument
1478 if (rand->nextBool()) { in morphology_imagefilter()
1491 SkRandom* rand, in create_image_filter() argument
1498 return arithmetic_imagefilter(rand); in create_image_filter()
1500 return blendmode_imagefilter(rand); in create_image_filter()
1502 return runtime_blender_imagefilter(rand); in create_image_filter()
1504 return blur_imagefilter(rand); in create_image_filter()
1506 return colorfilter_imagefilter(rand); in create_image_filter()
1508 return displacement_imagefilter(recorder, rand); in create_image_filter()
1510 return lighting_imagefilter(rand); in create_image_filter()
1512 return matrix_convolution_imagefilter(rand); in create_image_filter()
1514 return morphology_imagefilter(rand); in create_image_filter()
1522 SkRandom* rand) { in create_random_image_filter() argument
1523 return create_image_filter(recorder, rand, random_imagefiltertype(rand)); in create_random_image_filter()
1526 std::pair<sk_sp<SkMaskFilter>, sk_sp<PrecompileMaskFilter>> create_blur_maskfilter(SkRandom* rand) { in create_blur_maskfilter() argument
1528 switch (rand->nextULessThan(4)) { in create_blur_maskfilter()
1537 switch (rand->nextULessThan(2)) { in create_blur_maskfilter()
1544 bool respectCTM = rand->nextBool(); in create_blur_maskfilter()
1549 std::pair<sk_sp<SkMaskFilter>, sk_sp<PrecompileMaskFilter>> create_maskfilter(SkRandom* rand, in create_maskfilter() argument
1553 case MaskFilterType::kBlur: return create_blur_maskfilter(rand); in create_maskfilter()
1560 std::pair<SkPaint, PaintOptions> create_paint(SkRandom* rand, in create_paint() argument
1568 paint.setColor(random_color(rand, ColorConstraint::kOpaque)); in create_paint()
1573 auto [s, o] = create_shader(rand, recorder, shaderType); in create_paint()
1583 auto [cf, o] = create_colorfilter(rand, colorFilterType); in create_paint()
1593 auto [mf, o] = create_maskfilter(rand, maskFilterType); in create_paint()
1603 auto [b, o] = create_blender(rand, blenderType); in create_paint()
1613 auto [filter, o] = create_image_filter(recorder, rand, imageFilterType); in create_paint()
1622 if (rand->nextBool()) { in create_paint()
1910 SkRandom* rand, in extract_vs_build_subtest() argument
1934 Coverage coverage = coverageOptions[rand->nextULessThan(3)]; in extract_vs_build_subtest()
2108 SkRandom rand(seed); in run_test() local
2116 std::tie(clipShader, clipShaderOption) = create_clip_shader(&rand, recorder.get()); in run_test()
2121 auto [paint, paintOptions] = create_paint(&rand, recorder.get(), s, bm, cf, mf, imageFilter); in run_test()
2130 seed, &rand, verbose); in run_test()
2150 SkRandom rand(seed); in DEF_CONDITIONAL_GRAPHITE_TEST_FOR_ALL_CONTEXTS() local
2151 ShaderType shaderType = random_shadertype(&rand); in DEF_CONDITIONAL_GRAPHITE_TEST_FOR_ALL_CONTEXTS()
2152 BlenderType blenderType = random_blendertype(&rand); in DEF_CONDITIONAL_GRAPHITE_TEST_FOR_ALL_CONTEXTS()
2153 ColorFilterType colorFilterType = random_colorfiltertype(&rand); in DEF_CONDITIONAL_GRAPHITE_TEST_FOR_ALL_CONTEXTS()
2154 MaskFilterType maskFilterType = random_maskfiltertype(&rand); in DEF_CONDITIONAL_GRAPHITE_TEST_FOR_ALL_CONTEXTS()
2155 ImageFilterType imageFilterType = ImageFilterType::kNone; // random_imagefiltertype(&rand); in DEF_CONDITIONAL_GRAPHITE_TEST_FOR_ALL_CONTEXTS()
2156 ClipType clipType = random_cliptype(&rand); in DEF_CONDITIONAL_GRAPHITE_TEST_FOR_ALL_CONTEXTS()
2157 DrawTypeFlags drawTypeFlags = random_drawtype(&rand); in DEF_CONDITIONAL_GRAPHITE_TEST_FOR_ALL_CONTEXTS()