| 105 | } |
| 106 | |
| 107 | void Glyph::computeStyleKey(tgfx::BytesKey* styleKey) const { |
| 108 | auto m = getTotalMatrix(); |
| 109 | styleKey->write(m.getScaleX()); |
| 110 | styleKey->write(m.getSkewX()); |
| 111 | styleKey->write(m.getSkewY()); |
| 112 | styleKey->write(m.getScaleY()); |
| 113 | uint8_t fillValues[] = {fillColor.red, fillColor.green, fillColor.blue, |
| 114 | static_cast<uint8_t>(alpha * 255)}; |
| 115 | styleKey->write(fillValues); |
| 116 | uint8_t strokeValues[] = {strokeColor.red, strokeColor.green, strokeColor.blue, |
| 117 | static_cast<uint8_t>(textStyle)}; |
| 118 | styleKey->write(strokeValues); |
| 119 | styleKey->write(strokeWidth); |
| 120 | auto typeface = getFont().getTypeface(); |
| 121 | styleKey->write(typeface ? typeface->uniqueID() : 0); |
| 122 | } |
| 123 | |
| 124 | bool Glyph::isVisible() const { |
| 125 | return matrix.invertible() && alpha != 0.0f && !getBounds().isEmpty(); |
no test coverage detected