29#ifdef SK_ENABLE_VELLO_SHADERS
36#ifdef SK_ENABLE_VELLO_SHADERS
53 static constexpr size_t kRendererSize = offsetof(
RendererProvider, fRenderers) -
55 static_assert(kRendererSize %
sizeof(
Renderer) == 0,
"Renderer declarations are not dense");
60 auto makeFromStep = [&](std::unique_ptr<RenderStep> singleStep,
DrawTypeFlags drawTypes) {
61 std::string
name =
"SingleStep[";
62 name += singleStep->name();
64 fRenderSteps.push_back(std::move(singleStep));
65 return Renderer(
name, drawTypes, fRenderSteps.back().get());
68 fConvexTessellatedWedges =
69 makeFromStep(std::make_unique<TessellateWedgesRenderStep>(
72 fTessellatedStrokes = makeFromStep(
75 for (
bool lcd : {
false,
true}) {
76 fBitmapText[lcd] = makeFromStep(std::make_unique<BitmapTextRenderStep>(lcd),
78 fSDFText[lcd] = lcd ? makeFromStep(std::make_unique<SDFTextLCDRenderStep>(),
80 : makeFromStep(
std::make_unique<SDFTextRenderStep>(),
83 fAnalyticRRect = makeFromStep(std::make_unique<AnalyticRRectRenderStep>(bufferManager),
85 fPerEdgeAAQuad = makeFromStep(std::make_unique<PerEdgeAAQuadRenderStep>(bufferManager),
87 fAnalyticBlur = makeFromStep(std::make_unique<AnalyticBlurRenderStep>(),
90 for (
bool color : {
false,
true}) {
91 for (
bool texCoords : {
false,
true}) {
93 fVertices[index] = makeFromStep(
94 std::make_unique<VerticesRenderStep>(primType,
color, texCoords),
101 auto coverFill = std::make_unique<CoverBoundsRenderStep>(
false);
102 auto coverInverse = std::make_unique<CoverBoundsRenderStep>(
true);
104 for (
bool evenOdd : {
false,
true}) {
106 auto stencilFan = std::make_unique<MiddleOutFanRenderStep>(evenOdd);
107 auto stencilCurve = std::make_unique<TessellateCurvesRenderStep>(
108 evenOdd, infinitySupport, bufferManager);
110 evenOdd ? std::make_unique<TessellateWedgesRenderStep>(
112 :
std::make_unique<TessellateWedgesRenderStep>(
115 for (
bool inverse : {
false,
true}) {
116 static const char* kTessVariants[4] =
117 {
"[winding]",
"[evenodd]",
"[inverse-winding]",
"[inverse-evenodd]"};
119 int index = 2*inverse + evenOdd;
120 std::string variant = kTessVariants[index];
125 const RenderStep* coverStep = inverse ? coverInverse.get() : coverFill.get();
126 fStencilTessellatedCurves[index] = Renderer(
"StencilTessellatedCurvesAndTris" + variant,
132 fStencilTessellatedWedges[index] = Renderer(
"StencilTessellatedWedges" + variant,
138 fRenderSteps.push_back(std::move(stencilFan));
139 fRenderSteps.push_back(std::move(stencilCurve));
140 fRenderSteps.push_back(std::move(stencilWedge));
143 fRenderSteps.push_back(std::move(coverInverse));
144 fRenderSteps.push_back(std::move(coverFill));
148 SkSpan<Renderer> allRenderers = {fStencilTessellatedCurves, kRendererSize /
sizeof(Renderer)};
149 for (
const Renderer& r : allRenderers) {
150 if (r.numRenderSteps() > 0) {
151 fRenderers.push_back(&r);
155#ifdef SK_ENABLE_VELLO_SHADERS
156 fVelloRenderer = std::make_unique<VelloRenderer>(caps);
161 for (
auto&& rs : fRenderSteps) {
162 if (rs->uniqueID() == uniqueID) {
bool computeSupport() const
const SkSL::ShaderCaps * shaderCaps() const
const RenderStep * lookup(uint32_t uniqueID) const
static bool IsVelloRendererSupported(const Caps *)
DEF_SWITCHES_START aot vmservice shared library name
constexpr DepthStencilSettings kWindingStencilPass
static constexpr DepthStencilSettings kDirectDepthGreaterPass
constexpr DepthStencilSettings kEvenOddStencilPass