63 const SkPoint pts[] = {{ 15, 14.7112684f }, { 0.709064007f, 12.6108112f }};
72 1.06608627e-06f, 4.26434525e-07f, 6.2855f, 2.6611f, 273.4393f, 244.0046f
98 info->fColors = colorStorage;
99 info->fColorOffsets = posStorage.
get();
189 s =
s->makeWithLocalMatrix(localMatrix);
208 for (
int i = 0;
i < 10;
i++) {
221 static const SkPoint gPts[] = {
253 const SkPoint pts[] = {{ 100, 50 }, { 100.0001f, 50000 }};
265 const SkPoint pts[] = {{ 100, 50 }, { 100, 50 }};
281 const SkPoint pts[] = {{ 179.5f, -179.5f }, { 1074.5f, 715.5f }};
283 const SkScalar pos[] = {0, 0.200000003f, 0.800000012f, 1 };
288 SkRect r = {0, 83, 1254, 620};
322 surface->getCanvas()->scale(100, 100);
355 {0.00784314f, 0.f, 0.f, 0.0627451f},
356 {0.f, 0.00392157f, 0.f, 0.f} };
357 const SkScalar positions[] = {0.00753367f, 8.54792e-44f, 1.46955e-39f};
381 static const SkColor gColors1[] = { 0x30303030, 0x30303030, 0x30303030 };
385 static const SkScalar gMatrix0[9] = {
386 6.40969056e-10f, 0 , 6.40969056e-10f,
387 0 , 4.42539023e-39f, 6.40969056e-10f,
390 static const SkScalar gMatrix1[9] = {
391 -2.75294113f , 6.40969056e-10f, 6.40969056e-10f,
392 6.40969056e-10f, 6.40969056e-10f, -3.32810161e+24f,
393 6.40969056e-10f, 6.40969056e-10f, 0
395 static const SkScalar gMatrix2[9] = {
396 7.93481258e+17f, 6.40969056e-10f, 6.40969056e-10f,
397 6.40969056e-10f, 6.40969056e-10f, 6.40969056e-10f,
398 6.40969056e-10f, 6.40969056e-10f, 0.688235283f
400 static const SkScalar gMatrix3[9] = {
401 1.89180674e+11f, 6.40969056e-10f, 6.40969056e-10f,
402 6.40969056e-10f, 6.40969056e-10f, 6.40969056e-10f,
403 6.40969056e-10f, 11276.0469f , 8.12524808e+20f
406 static const struct {
417 {{0, -2.752941f}, {0, 0}},
427 {{4.42539023e-39f, -4.42539023e-39f}, {9.78041162e-15f, 4.42539023e-39f}},
437 {{4.42539023e-39f, 6.40969056e-10f}, {6.40969056e-10f, 1.49237238e-19f}},
447 {{6.40969056e-10f, 6.40969056e-10f}, {6.40969056e-10f, -0.688235283f}},
471 for (
const auto& config : gConfigs) {
474 if (config.fLocalMatrix) {
476 localMatrix->
set9(config.fLocalMatrix);
486 if (config.fGlobalMatrix) {
488 m.set9(config.fGlobalMatrix);
499 static const SkColor gColors0[] = { 0x30303030, 0x30303030, 0x30303030 };
500 static const SkScalar gPos0[] = { -47919293023455565225163489280.0f, 0, 1 };
501 static const SkScalar gMatrix0[9] = {
502 1.12116716e-13f, 0 , 8.50489682e+16f,
503 4.1917041e-41f , 3.51369881e-23f, -2.54344271e-26f,
504 9.61111907e+17f, -3.35263808e-29f, -1.35659403e+14f
506 static const struct {
526 for (
const auto& config : gConfigs) {
534 if (config.fGlobalMatrix) {
536 m.set9(config.fGlobalMatrix);
552 constexpr float pts[4] = {0.0f, 0.5f, 0.5f, 1.0f};
567 if (!
surface->readPixels(pixmap, 0, 0)) {
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
SkAssertResult(font.textToGlyphs("Hello", 5, SkTextEncoding::kUTF8, glyphs, std::size(glyphs))==count)
static const SkScalar gPos[]
static const SkColor gColors[]
static void TestConstantGradient(skiatest::Reporter *)
void test_sweep_gradient_zero_x(skiatest::Reporter *reporter, SkSurface *surface)
static void test_nearly_vertical(skiatest::Reporter *reporter)
static void linear_gradproc(skiatest::Reporter *reporter, const GradRec &buildRec, const GradRec &checkRec)
void(* GradProc)(skiatest::Reporter *reporter, const GradRec &, const GradRec &)
DEF_TEST(Gradient, reporter)
static void radial_gradproc(skiatest::Reporter *reporter, const GradRec &buildRec, const GradRec &checkRec)
static void conical_gradproc(skiatest::Reporter *reporter, const GradRec &buildRec, const GradRec &checkRec)
static void test_degenerate_linear(skiatest::Reporter *)
static void test_linear_fuzz(skiatest::Reporter *reporter)
static void test_vertical(skiatest::Reporter *reporter)
static void TestGradientShaders(skiatest::Reporter *reporter)
DEF_GANESH_TEST_FOR_RENDERING_CONTEXTS(TestSweepGradientZeroXGanesh, reporter, contextInfo, CtsEnforcement::kNextRelease)
static void test_unsorted_degenerate(skiatest::Reporter *r)
static void test_sweep_fuzzer(skiatest::Reporter *)
static void color_gradproc(skiatest::Reporter *reporter, const GradRec &rec, const GradRec &)
static void none_gradproc(skiatest::Reporter *reporter, const GradRec &, const GradRec &)
static void test_two_point_conical_zero_radius(skiatest::Reporter *reporter)
static void test_clamping_overflow(skiatest::Reporter *)
static void sweep_gradproc(skiatest::Reporter *reporter, const GradRec &buildRec, const GradRec &checkRec)
static void test_big_grad(skiatest::Reporter *reporter)
static void linear_gradproc_matrix(skiatest::Reporter *reporter, const GradRec &buildRec, const GradRec &checkRec)
static void test_linear_fuzzer(skiatest::Reporter *)
static const int points[]
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
#define SkGetPackedR32(packed)
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
constexpr SkColor SK_ColorYELLOW
constexpr SkColor SK_ColorBLUE
constexpr SkColor SK_ColorRED
constexpr SkColor SK_ColorBLACK
constexpr SkColor SK_ColorGREEN
constexpr SkColor SK_ColorWHITE
sk_sp< T > sk_ref_sp(T *obj)
SkShaderBase * as_SB(SkShader *shader)
static constexpr bool SkToBool(const T &x)
static const SkScalar gPos1[]
static const SkScalar gPos0[]
#define REPORTER_ASSERT(r, cond,...)
static sk_sp< GrDirectContext > MakeMock(const GrMockOptions *, const GrContextOptions &)
void allocN32Pixels(int width, int height, bool isOpaque=false)
void drawRect(const SkRect &rect, const SkPaint &paint)
void translate(SkScalar dx, SkScalar dy)
void drawPaint(const SkPaint &paint)
void concat(const SkMatrix &matrix)
static sk_sp< SkColorSpace > MakeSRGB()
static sk_sp< SkShader > MakeTwoPointConical(const SkPoint &start, SkScalar startRadius, const SkPoint &end, SkScalar endRadius, const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, uint32_t flags=0, const SkMatrix *localMatrix=nullptr)
static sk_sp< SkShader > MakeSweep(SkScalar cx, SkScalar cy, const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, SkScalar startAngle, SkScalar endAngle, uint32_t flags, const SkMatrix *localMatrix)
static sk_sp< SkShader > MakeRadial(const SkPoint ¢er, SkScalar radius, const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, uint32_t flags=0, const SkMatrix *localMatrix=nullptr)
static sk_sp< SkShader > MakeLinear(const SkPoint pts[2], const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, uint32_t flags=0, const SkMatrix *localMatrix=nullptr)
static SkMatrix RotateDeg(SkScalar deg)
SkMatrix & set9(const SkScalar buffer[9])
static const SkMatrix & I()
SkColor4f getColor4f(int x, int y) const
T * init(Args &&... args)
const T * getMaybeNull() const
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
const ImageMakerProc gProcs[]
std::unique_ptr< GrFragmentProcessor > Make(const SkMaskFilter *maskfilter, const GrFPArgs &args, const SkMatrix &ctm)
constexpr SkColor4f kBlue
constexpr SkColor4f kYellow
static constexpr skcms_TransferFunction kLinear
unsigned useCenter Optional< SkMatrix > matrix
PODArray< SkColor > colors
SK_API sk_sp< SkShader > Color(SkColor)
SK_API sk_sp< SkShader > Empty()
SK_API sk_sp< SkSurface > Raster(const SkImageInfo &imageInfo, size_t rowBytes, const SkSurfaceProps *surfaceProps)
SK_API sk_sp< SkSurface > RenderTarget(GrRecordingContext *context, skgpu::Budgeted budgeted, const SkImageInfo &imageInfo, int sampleCount, GrSurfaceOrigin surfaceOrigin, const SkSurfaceProps *surfaceProps, bool shouldCreateWithMips=false, bool isProtected=false)
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
void gradCheck(skiatest::Reporter *reporter, const sk_sp< SkShader > &shader, SkShaderBase::GradientInfo *info, SkShaderBase::GradientType gt, const SkMatrix &localMatrix=SkMatrix::I()) const
static constexpr SkISize Make(int32_t w, int32_t h)
static SkImageInfo MakeN32Premul(int width, int height)
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)
static constexpr SkPoint Make(float x, float y)
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)