/* * Copyright 2006 The Android Open Source Project * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file.
*/
// Returns the output of e0, and leaves the output of e1 in r,g,b,a staticfloat* append_two_shaders(const SkStageRec& rec, const SkShaders::MatrixRec& mRec,
SkShader* s0,
SkShader* s1) { struct Storage { float fCoords[2 * SkRasterPipeline_kMaxStride]; float fRes0[4 * SkRasterPipeline_kMaxStride];
}; auto storage = rec.fAlloc->make<Storage>();
// Note we cannot simply apply mRec here and then unconditionally store the coordinates. When // building for Android Framework it would interrupt the backwards local matrix concatenation if // mRec had a pending local matrix and either of the children also had a local matrix. // b/256873449 if (mRec.rasterPipelineCoordsAreSeeded()) {
rec.fPipeline->append(SkRasterPipelineOp::store_src_rg, storage->fCoords);
} if (!as_SB(s0)->appendStages(rec, mRec)) { return nullptr;
}
rec.fPipeline->append(SkRasterPipelineOp::store_src, storage->fRes0);
if (mRec.rasterPipelineCoordsAreSeeded()) {
rec.fPipeline->append(SkRasterPipelineOp::load_src_rg, storage->fCoords);
} if (!as_SB(s1)->appendStages(rec, mRec)) { return nullptr;
} return storage->fRes0;
}
if (!src || !dst) { return nullptr;
} if (!blender) { return SkShaders::Blend(SkBlendMode::kSrcOver, std::move(dst), std::move(src));
} if (std::optional<SkBlendMode> mode = as_BB(blender)->asBlendMode()) { return sk_make_sp<SkBlendShader>(mode.value(), std::move(dst), std::move(src));
}
// This isn't a built-in blend mode; we might as well use a runtime effect to evaluate it. const SkRuntimeEffect* blendEffect = GetKnownRuntimeEffect(StableKey::kBlend);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.