31constexpr int kNumTextAtlasTextures = 4;
40 :
Flags::kPerformsShading |
Flags::kHasTextures |
Flags::kEmitsCoverage,
65 return "texIndex = half(indexAndFlags.x);"
66 "maskFormat = half(indexAndFlags.y);"
67 "float2 unormTexCoords;"
68 "float4 devPosition = text_vertex_fn(float2(sk_VertexID >> 1, sk_VertexID & 1), "
69 "subRunDeviceMatrix, "
75 "strikeToSourceScale, "
86 for (
unsigned int i = 0;
i < kNumTextAtlasTextures; ++
i) {
97 static_assert(kNumTextAtlasTextures == 4);
98 return "outputCoverage = bitmap_text_coverage_fn(sample_indexed_atlas(textureCoords, "
118 params.order().depthAsFloat());
126 unsigned int numProxies;
127 Recorder* recorder = subRunData.recorder();
130 subRunData.subRun()->maskFormat(), &numProxies);
131 SkASSERT(proxies && numProxies > 0);
135 gatherer->
write(subRunData.deviceToLocal());
136 SkV2 atlasDimensionsInverse = {1.f/proxies[0]->dimensions().width(),
137 1.f/proxies[0]->dimensions().height()};
138 gatherer->
write(atlasDimensionsInverse);
143 for (
unsigned int i = 0;
i < numProxies; ++
i) {
144 gatherer->add(proxies[
i], {kSamplingOptions, kTileModes});
147 for (
unsigned int i = numProxies;
i < kNumTextAtlasTextures; ++
i) {
148 gatherer->add(proxies[0], {kSamplingOptions, kTileModes});
sktext::gpu::AtlasSubRun AtlasSubRun
static bool isLCD(const SkScalerContextRec &rec)
SkDEBUGCODE(SK_SPI) SkThreadID SkGetThreadID()
TextAtlasManager * textAtlasManager() const
~BitmapTextRenderStep() override
const char * fragmentCoverageSkSL() const override
void writeUniformsAndTextures(const DrawParams &, PipelineDataGatherer *) const override
void writeVertices(DrawWriter *, const DrawParams &, skvx::ushort2 ssboIndices) const override
std::string texturesAndSamplersSkSL(const ResourceBindingRequirements &, int *nextBindingIndex) const override
BitmapTextRenderStep(bool isLCD)
std::string vertexSkSL() const override
AtlasProvider * atlasProvider()
SkSpan< const Uniform > uniforms() const
const sktext::gpu::AtlasSubRun * subRun() const
int startGlyphIndex() const
const sk_sp< TextureProxy > * getProxies(MaskFormat format, unsigned int *numActiveProxies)
virtual const VertexFiller & vertexFiller() const =0
virtual unsigned short instanceFlags() const =0
virtual SkSpan< const Glyph * > glyphs() const =0
void fillInstanceData(skgpu::graphite::DrawWriter *dw, int offset, int count, unsigned short flags, skvx::ushort2 ssboIndex, SkSpan< const Glyph * > glyphs, SkScalar depth) const
const EmbeddedViewParams * params
std::string void appendf(std::string *str, const char *fmt,...) SK_PRINTF_LIKE(2
static constexpr DepthStencilSettings kDirectDepthGEqualPass
std::string EmitSamplerLayout(const ResourceBindingRequirements &bindingReqs, int *binding)