Loading libs/hwui/font/Font.cpp +12 −9 Original line number Diff line number Diff line Loading @@ -140,12 +140,12 @@ void Font::invalidateTextureCache(CacheTexture* cacheTexture) { void Font::measureCachedGlyph(CachedGlyphInfo *glyph, int x, int y, uint8_t* bitmap, uint32_t bitmapW, uint32_t bitmapH, Rect* bounds, const float* pos) { int nPenX = x + glyph->mBitmapLeft; int nPenY = y + glyph->mBitmapTop; int width = (int) glyph->mBitmapWidth; int height = (int) glyph->mBitmapHeight; int nPenX = x + glyph->mBitmapLeft; int nPenY = y + glyph->mBitmapTop; if (bounds->bottom > nPenY) { bounds->bottom = nPenY; } Loading @@ -162,12 +162,12 @@ void Font::measureCachedGlyph(CachedGlyphInfo *glyph, int x, int y, void Font::drawCachedGlyph(CachedGlyphInfo* glyph, int x, int y, uint8_t* bitmap, uint32_t bitmapW, uint32_t bitmapH, Rect* bounds, const float* pos) { float nPenX = x + glyph->mBitmapLeft; float nPenY = y + glyph->mBitmapTop + glyph->mBitmapHeight; float width = (float) glyph->mBitmapWidth; float height = (float) glyph->mBitmapHeight; float nPenX = x + glyph->mBitmapLeft; float nPenY = y + glyph->mBitmapTop + height; float u1 = glyph->mBitmapMinU; float u2 = glyph->mBitmapMaxU; float v1 = glyph->mBitmapMinV; Loading @@ -181,10 +181,13 @@ void Font::drawCachedGlyph(CachedGlyphInfo* glyph, int x, int y, void Font::drawCachedGlyphTransformed(CachedGlyphInfo* glyph, int x, int y, uint8_t* bitmap, uint32_t bitmapW, uint32_t bitmapH, Rect* bounds, const float* pos) { float width = (float) glyph->mBitmapWidth; float height = (float) glyph->mBitmapHeight; SkPoint p[4]; p[0].iset(glyph->mBitmapLeft, glyph->mBitmapTop + glyph->mBitmapHeight); p[1].iset(glyph->mBitmapLeft + glyph->mBitmapWidth, glyph->mBitmapTop + glyph->mBitmapHeight); p[2].iset(glyph->mBitmapLeft + glyph->mBitmapWidth, glyph->mBitmapTop); p[0].iset(glyph->mBitmapLeft, glyph->mBitmapTop + height); p[1].iset(glyph->mBitmapLeft + width, glyph->mBitmapTop + height); p[2].iset(glyph->mBitmapLeft + width, glyph->mBitmapTop); p[3].iset(glyph->mBitmapLeft, glyph->mBitmapTop); mDescription.mInverseLookupTransform.mapPoints(p, 4); Loading Loading
libs/hwui/font/Font.cpp +12 −9 Original line number Diff line number Diff line Loading @@ -140,12 +140,12 @@ void Font::invalidateTextureCache(CacheTexture* cacheTexture) { void Font::measureCachedGlyph(CachedGlyphInfo *glyph, int x, int y, uint8_t* bitmap, uint32_t bitmapW, uint32_t bitmapH, Rect* bounds, const float* pos) { int nPenX = x + glyph->mBitmapLeft; int nPenY = y + glyph->mBitmapTop; int width = (int) glyph->mBitmapWidth; int height = (int) glyph->mBitmapHeight; int nPenX = x + glyph->mBitmapLeft; int nPenY = y + glyph->mBitmapTop; if (bounds->bottom > nPenY) { bounds->bottom = nPenY; } Loading @@ -162,12 +162,12 @@ void Font::measureCachedGlyph(CachedGlyphInfo *glyph, int x, int y, void Font::drawCachedGlyph(CachedGlyphInfo* glyph, int x, int y, uint8_t* bitmap, uint32_t bitmapW, uint32_t bitmapH, Rect* bounds, const float* pos) { float nPenX = x + glyph->mBitmapLeft; float nPenY = y + glyph->mBitmapTop + glyph->mBitmapHeight; float width = (float) glyph->mBitmapWidth; float height = (float) glyph->mBitmapHeight; float nPenX = x + glyph->mBitmapLeft; float nPenY = y + glyph->mBitmapTop + height; float u1 = glyph->mBitmapMinU; float u2 = glyph->mBitmapMaxU; float v1 = glyph->mBitmapMinV; Loading @@ -181,10 +181,13 @@ void Font::drawCachedGlyph(CachedGlyphInfo* glyph, int x, int y, void Font::drawCachedGlyphTransformed(CachedGlyphInfo* glyph, int x, int y, uint8_t* bitmap, uint32_t bitmapW, uint32_t bitmapH, Rect* bounds, const float* pos) { float width = (float) glyph->mBitmapWidth; float height = (float) glyph->mBitmapHeight; SkPoint p[4]; p[0].iset(glyph->mBitmapLeft, glyph->mBitmapTop + glyph->mBitmapHeight); p[1].iset(glyph->mBitmapLeft + glyph->mBitmapWidth, glyph->mBitmapTop + glyph->mBitmapHeight); p[2].iset(glyph->mBitmapLeft + glyph->mBitmapWidth, glyph->mBitmapTop); p[0].iset(glyph->mBitmapLeft, glyph->mBitmapTop + height); p[1].iset(glyph->mBitmapLeft + width, glyph->mBitmapTop + height); p[2].iset(glyph->mBitmapLeft + width, glyph->mBitmapTop); p[3].iset(glyph->mBitmapLeft, glyph->mBitmapTop); mDescription.mInverseLookupTransform.mapPoints(p, 4); Loading