27 const float* srcA = matrix + 15;
36 memcpy(fMatrix, array, 20 *
sizeof(
float));
40 SkASSERT(
sizeof(fMatrix) /
sizeof(
float) == 20);
41 buffer.writeScalarArray(fMatrix, 20);
59 memcpy(
matrix, fMatrix, 20 *
sizeof(
float));
65 const bool willStayOpaque = shaderIsOpaque && fAlphaIsUnchanged,
69 if (!shaderIsOpaque) {
70 p->append(SkRasterPipelineOp::unpremul);
73 p->append(SkRasterPipelineOp::rgb_to_hsl);
76 p->append(SkRasterPipelineOp::matrix_4x5, fMatrix);
79 p->append(SkRasterPipelineOp::hsl_to_rgb);
82 p->append(SkRasterPipelineOp::clamp_01);
84 if (!willStayOpaque) {
85 p->append(SkRasterPipelineOp::premul);
96 return sk_make_sp<SkMatrixColorFilter>(array, domain);
static bool is_rgba(SkColorType colorType)
#define SK_REGISTER_FLATTENABLE(type)
static bool SkIsFinite(T x, Pack... values)
void SkRegisterMatrixColorFilterFlattenable()
static bool is_alpha_unchanged(const float matrix[20])
static sk_sp< SkColorFilter > MakeMatrix(const float array[20], SkMatrixColorFilter::Domain domain)
static bool SkScalarNearlyZero(SkScalar x, SkScalar tolerance=SK_ScalarNearlyZero)
static bool SkScalarNearlyEqual(SkScalar x, SkScalar y, SkScalar tolerance=SK_ScalarNearlyZero)
static sk_sp< SkColorFilter > Matrix(const SkColorMatrix &)
static sk_sp< SkColorFilter > HSLAMatrix(const SkColorMatrix &)
static void Register(const char name[], Factory)
bool appendStages(const SkStageRec &rec, bool shaderIsOpaque) const override
SkMatrixColorFilter(const float array[20], Domain)
const float * matrix() const
bool onAsAColorMatrix(float matrix[20]) const override
void flatten(SkWriteBuffer &) const override
static const uint8_t buffer[]
SkRasterPipeline * fPipeline