| 20 | |
| 21 | namespace tgfx { |
| 22 | AtlasTextGeometryProcessor::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 | } |
| 39 | void AtlasTextGeometryProcessor::onComputeProcessorKey(BytesKey* bytesKey) const { |
| 40 | uint32_t flags = aa == AAType::Coverage ? 1 : 0; |
| 41 | flags |= commonColor.has_value() ? 2 : 0; |
nothing calls this directly
no test coverage detected