staticvoid load_color(SkRasterPipeline_UniformColorCtx* ctx, constfloat rgba[]) { // only need one of these. can I query the pipeline to know if its lowp or highp?
ctx->rgba[0] = SkScalarRoundToInt(rgba[0]*255); ctx->r = rgba[0];
ctx->rgba[1] = SkScalarRoundToInt(rgba[1]*255); ctx->g = rgba[1];
ctx->rgba[2] = SkScalarRoundToInt(rgba[2]*255); ctx->b = rgba[2];
ctx->rgba[3] = SkScalarRoundToInt(rgba[3]*255); ctx->a = rgba[3];
}
SkPaint p(paint);
p.setAntiAlias(false); // we never respect this for drawAtlas(or drawVertices)
p.setStyle(SkPaint::kFill_Style);
p.setShader(nullptr);
p.setMaskFilter(nullptr);
// The RSXForms can't contain perspective - only the CTM can. constbool perspective = fCTM->hasPerspective();
auto transformShader = alloc.make<SkTransformShader>(*as_SB(atlasShader), perspective);
SkRasterPipeline pipeline(&alloc);
SkSurfaceProps props = SkSurfacePropsCopyOrDefault(fProps);
SkStageRec rec = {&pipeline, &alloc, fDst.colorType(), fDst.colorSpace(),
p.getColor4f(), props}; // We pass an identity matrix here rather than the CTM. The CTM gets folded into the // per-triangle matrix. if (!as_SB(transformShader)->appendRootStages(rec, SkMatrix::I())) { return;
}
SkRasterPipeline_UniformColorCtx* uniformCtx = nullptr;
SkColorSpaceXformSteps steps(sk_srgb_singleton(), kUnpremul_SkAlphaType,
rec.fDstCS, kUnpremul_SkAlphaType); if (colors) { // we will late-bind the values in ctx, once for each color in the loop
uniformCtx = alloc.make<SkRasterPipeline_UniformColorCtx>();
rec.fPipeline->append(SkRasterPipelineOp::uniform_color_dst, uniformCtx);
std::optional<SkBlendMode> bm = as_BB(blender)->asBlendMode(); if (!bm.has_value()) { return;
}
SkBlendMode_AppendStages(*bm, rec.fPipeline);
}
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.