diff options
Diffstat (limited to 'src/gpu/text/GrAtlasTextBlob_regenInOp.cpp')
-rw-r--r-- | src/gpu/text/GrAtlasTextBlob_regenInOp.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/gpu/text/GrAtlasTextBlob_regenInOp.cpp b/src/gpu/text/GrAtlasTextBlob_regenInOp.cpp index b7911c3eae..778c9faabf 100644 --- a/src/gpu/text/GrAtlasTextBlob_regenInOp.cpp +++ b/src/gpu/text/GrAtlasTextBlob_regenInOp.cpp @@ -39,11 +39,19 @@ inline void regen_vertices(intptr_t vertex, const GrGlyph* glyph, size_t vertexS u1 = u0 + width; v1 = v0 + height; } - // shift to make space for index bits + // We pack the 2bit page index in the low bit of the u and v texture coords + uint32_t pageIndex = glyph->pageIndex(); + SkASSERT(pageIndex < 4); + uint16_t uBit = (pageIndex >> 1) & 0x1; + uint16_t vBit = pageIndex & 0x1; u0 <<= 1; + u0 |= uBit; v0 <<= 1; + v0 |= vBit; u1 <<= 1; + u1 |= uBit; v1 <<= 1; + v1 |= vBit; } // This is a bit wonky, but sometimes we have LCD text, in which case we won't have color |