29 : sk_make_sp<GrColorSpaceXform>(
steps);
41 if (!xform) {
return 0; }
59 if (!
a || !
b ||
a->fSteps.flags.mask() !=
b->fSteps.flags.mask()) {
63 if (
a->fSteps.flags.linearize &&
64 0 != memcmp(&
a->fSteps.srcTF, &
b->fSteps.srcTF,
sizeof(
a->fSteps.srcTF))) {
68 if (
a->fSteps.flags.gamut_transform &&
69 0 != memcmp(&
a->fSteps.src_to_dst_matrix, &
b->fSteps.src_to_dst_matrix,
70 sizeof(
a->fSteps.src_to_dst_matrix))) {
74 if (
a->fSteps.flags.encode &&
75 0 != memcmp(&
a->fSteps.dstTFInv, &
b->fSteps.dstTFInv,
sizeof(
a->fSteps.dstTFInv))) {
90GrColorSpaceXformEffect::GrColorSpaceXformEffect(std::unique_ptr<GrFragmentProcessor> child,
92 :
INHERITED(kGrColorSpaceXformEffect_ClassID, OptFlags(child.
get()))
93 , fColorXform(
std::move(colorXform)) {
94 this->registerChild(std::move(child));
99 , fColorXform(that.fColorXform) {}
114std::unique_ptr<GrFragmentProcessor::ProgramImpl>
115GrColorSpaceXformEffect::onMakeProgramImpl()
const {
118 void emitCode(EmitArgs&
args)
override {
123 fColorSpaceHelper.emitCode(uniformHandler, proc.
colorXform());
128 fragBuilder->appendColorGamutXform(
129 &xformedColor, childColor.
c_str(), &fColorSpaceHelper);
130 fragBuilder->codeAppendf(
"return %s;", xformedColor.
c_str());
137 fColorSpaceHelper.setData(pdman, proc.
colorXform());
143 return std::make_unique<Impl>();
153SkPMColor4f GrColorSpaceXformEffect::constantOutputForConstantInput(
156 return this->fColorXform->
apply(c0.unpremul()).premul();
160 std::unique_ptr<GrFragmentProcessor> child,
167 std::unique_ptr<GrFragmentProcessor> child,
174 std::unique_ptr<GrFragmentProcessor> child,
#define INHERITED(method,...)
SkColorSpace * colorSpace() const
SkAlphaType alphaType() const
static OptimizationFlags ProcessorOptimizationFlags(const GrFragmentProcessor *fp)
GrFragmentProcessor * childProcessor(int index)
@ kPreservesOpaqueInput_OptimizationFlag
@ kCompatibleWithCoverageAsAlpha_OptimizationFlag
@ kConstantOutputForConstantInput_OptimizationFlag
static SkPMColor4f ConstantOutputForConstantInput(const GrFragmentProcessor *fp, const SkPMColor4f &input)
const char * c_str() const
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
const myers::Point & get(const myers::Segment &)
skcms_TFType skcms_TransferFunction_getType(const skcms_TransferFunction *tf)