37 matrix->postTranslate(-1, 0);
46 const SkPoint to[2] = { {0, 0}, {1, 0} };
51 matrix->postConcat(focalMatrix);
68 const SkPoint centers[2] = { startCenter, endCenter };
69 const SkPoint unitvec[2] = { {0, 0}, {1, 0} };
106 const auto dCenter = (c0 - c1).
length();
107 if (!focalData.
set(r0 / dCenter, r1 / dCenter, &gradientMatrix)) {
113 c0, r0, c1, r1,
desc, gradientType, gradientMatrix, focalData);
114 return s->makeWithLocalMatrix(localMatrix ? *localMatrix :
SkMatrix::I());
128 , fRadius1(startRadius)
129 , fRadius2(endRadius)
132 SkASSERT(fCenter1 != fCenter2 || fRadius1 != fRadius2);
150 info->fPoint[0] = fCenter1;
151 info->fPoint[1] = fCenter2;
152 info->fRadius[0] = fRadius1;
153 info->fRadius[1] = fRadius2;
158 return GradientType::kConical;
162 DescriptorScope
desc;
163 SkMatrix legacyLocalMatrix, *lmPtr =
nullptr;
164 if (!
desc.unflatten(
buffer, &legacyLocalMatrix)) {
168 lmPtr = &legacyLocalMatrix;
183 std::move(
desc.fColorSpace),
193 buffer.writePoint(fCenter1);
194 buffer.writePoint(fCenter2);
195 buffer.writeScalar(fRadius1);
196 buffer.writeScalar(fRadius2);
202 const auto dRadius = fRadius2 - fRadius1;
205 p->append(SkRasterPipelineOp::xy_to_radius);
209 auto bias = -fRadius1 / dRadius;
218 ctx->fP0 = scaledR0 * scaledR0;
219 p->append(SkRasterPipelineOp::xy_to_2pt_conical_strip, ctx);
220 p->append(SkRasterPipelineOp::mask_2pt_conical_nan, ctx);
221 postPipeline->
append(SkRasterPipelineOp::apply_vector_mask, &ctx->fMask);
226 ctx->
fP0 = 1 / fFocalData.
fR1;
230 p->append(SkRasterPipelineOp::xy_to_2pt_conical_focal_on_circle);
232 p->append(SkRasterPipelineOp::xy_to_2pt_conical_well_behaved, ctx);
234 p->append(SkRasterPipelineOp::xy_to_2pt_conical_smaller, ctx);
236 p->append(SkRasterPipelineOp::xy_to_2pt_conical_greater, ctx);
240 p->append(SkRasterPipelineOp::mask_2pt_conical_degenerates, ctx);
242 if (1 - fFocalData.
fFocalX < 0) {
243 p->append(SkRasterPipelineOp::negate_x);
246 p->append(SkRasterPipelineOp::alter_2pt_conical_compensate_focal, ctx);
249 p->append(SkRasterPipelineOp::alter_2pt_conical_unswap);
252 postPipeline->
append(SkRasterPipelineOp::apply_vector_mask, &ctx->fMask);
257#define EXPAND_1_COLOR(count) \
261 tmp[0] = tmp[1] = colors[0]; \
279 if (startRadius < 0 || endRadius < 0) {
299 static constexpr SkScalar circlePos[3] = {0, 1, 1};
304 std::move(colorSpace),
321 std::move(colorSpace),
332 if (localMatrix && !localMatrix->
invert(
nullptr)) {
338 colors, std::move(colorSpace),
pos, colorCount,
mode, interpolation);
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
void SkRegisterConicalGradientShaderFlattenable()
#define EXPAND_1_COLOR(count)
#define SK_REGISTER_FLATTENABLE(type)
static constexpr float sk_ieee_float_divide(float numer, float denom)
void swap(sk_sp< T > &a, sk_sp< T > &b)
static bool SkScalarNearlyZero(SkScalar x, SkScalar tolerance=SK_ScalarNearlyZero)
static bool SkScalarNearlyEqual(SkScalar x, SkScalar y, SkScalar tolerance=SK_ScalarNearlyZero)
auto make(Ctor &&ctor) -> decltype(ctor(nullptr))
SkConicalGradient(const SkPoint &c0, SkScalar r0, const SkPoint &c1, SkScalar r1, const Descriptor &, Type, const SkMatrix &, const FocalData &)
SkScalar getCenterX1() const
void flatten(SkWriteBuffer &buffer) const override
static bool MapToUnitX(const SkPoint &startCenter, const SkPoint &endCenter, SkMatrix *dstMatrix)
GradientType asGradient(GradientInfo *info, SkMatrix *localMatrix) const override
void appendGradientStages(SkArenaAlloc *alloc, SkRasterPipeline *tPipeline, SkRasterPipeline *postPipeline) const override
static sk_sp< SkShader > Create(const SkPoint &start, SkScalar startRadius, const SkPoint &end, SkScalar endRadius, const Descriptor &, const SkMatrix *localMatrix)
bool isOpaque() const override
static void Register(const char name[], Factory)
static constexpr SkScalar kDegenerateThreshold
static bool ValidGradient(const SkColor4f colors[], int count, SkTileMode tileMode, const Interpolation &interpolation)
static sk_sp< SkShader > MakeDegenerateGradient(const SkColor4f colors[], const SkScalar pos[], int colorCount, sk_sp< SkColorSpace > colorSpace, SkTileMode mode)
void flatten(SkWriteBuffer &) const override
void commonAsAGradient(GradientInfo *) const
ShaderType type() const final
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 > 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 SkMatrix Scale(SkScalar sx, SkScalar sy)
SkMatrix & postScale(SkScalar sx, SkScalar sy, SkScalar px, SkScalar py)
static SkMatrix Translate(SkScalar dx, SkScalar dy)
bool setPolyToPoly(const SkPoint src[], const SkPoint dst[], int count)
bool invert(SkMatrix *inverse) const
static const SkMatrix & I()
void append(SkRasterPipelineOp, void *=nullptr)
FlutterSemanticsFlag flags
static float max(float r, float g, float b)
unsigned useCenter Optional< SkMatrix > matrix
PODArray< SkColor > colors
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
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 mode
SIN Vec< N, float > sqrt(const Vec< N, float > &x)
bool set(SkScalar r0, SkScalar r1, SkMatrix *matrix)
bool isNativelyFocal() const
bool isWellBehaved() const
bool isFocalOnCircle() const
constexpr float y() const
constexpr float x() const
std::shared_ptr< const fml::Mapping > data