MCPcopy Create free account
hub / github.com/Tencent/tgfx / AtlasTextGeometryProcessor

Method AtlasTextGeometryProcessor

src/gpu/processors/AtlasTextGeometryProcessor.cpp:22–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20
21namespace tgfx {
22AtlasTextGeometryProcessor::AtlasTextGeometryProcessor(std::shared_ptr<TextureProxy> textureProxy,
23 AAType aa, std::optional<Color> commonColor,
24 const SamplingOptions& sampling)
25 : GeometryProcessor(ClassID()), textureProxy(std::move(textureProxy)), commonColor(commonColor),
26 samplerState(sampling) {
27 position = {"aPosition", VertexFormat::Float2};
28 if (aa == AAType::Coverage) {
29 coverage = {"inCoverage", VertexFormat::Float};
30 }
31 maskCoord = {"maskCoord", VertexFormat::Float2};
32 if (!commonColor.has_value()) {
33 color = {"inColor", VertexFormat::UByte4Normalized};
34 }
35 setVertexAttributes(&position, 4);
36 textures.emplace_back(this->textureProxy->getTextureView()->getTexture());
37 setTextureSamplerCount(textures.size());
38}
39void AtlasTextGeometryProcessor::onComputeProcessorKey(BytesKey* bytesKey) const {
40 uint32_t flags = aa == AAType::Coverage ? 1 : 0;
41 flags |= commonColor.has_value() ? 2 : 0;

Callers

nothing calls this directly

Calls 3

getTextureMethod · 0.45
getTextureViewMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected