Lines Matching refs:glyph

141 void Font::measureCachedGlyph(CachedGlyphInfo *glyph, int x, int y,
143 int width = (int) glyph->mBitmapWidth;
144 int height = (int) glyph->mBitmapHeight;
146 int nPenX = x + glyph->mBitmapLeft;
147 int nPenY = y + glyph->mBitmapTop;
163 void Font::drawCachedGlyph(CachedGlyphInfo* glyph, int x, int y,
165 float width = (float) glyph->mBitmapWidth;
166 float height = (float) glyph->mBitmapHeight;
168 float nPenX = x + glyph->mBitmapLeft;
169 float nPenY = y + glyph->mBitmapTop + height;
171 float u1 = glyph->mBitmapMinU;
172 float u2 = glyph->mBitmapMaxU;
173 float v1 = glyph->mBitmapMinV;
174 float v2 = glyph->mBitmapMaxV;
179 nPenX, nPenY - height, u1, v1, glyph->mCacheTexture);
182 void Font::drawCachedGlyphTransformed(CachedGlyphInfo* glyph, int x, int y,
184 float width = (float) glyph->mBitmapWidth;
185 float height = (float) glyph->mBitmapHeight;
188 p[0].iset(glyph->mBitmapLeft, glyph->mBitmapTop + height);
189 p[1].iset(glyph->mBitmapLeft + width, glyph->mBitmapTop + height);
190 p[2].iset(glyph->mBitmapLeft + width, glyph->mBitmapTop);
191 p[3].iset(glyph->mBitmapLeft, glyph->mBitmapTop);
200 float u1 = glyph->mBitmapMinU;
201 float u2 = glyph->mBitmapMaxU;
202 float v1 = glyph->mBitmapMinV;
203 float v2 = glyph->mBitmapMaxV;
209 p[3].x(), p[3].y(), u1, v1, glyph->mCacheTexture);
212 void Font::drawCachedGlyphBitmap(CachedGlyphInfo* glyph, int x, int y, uint8_t* bitmap,
214 int dstX = x + glyph->mBitmapLeft;
215 int dstY = y + glyph->mBitmapTop;
217 CacheTexture* cacheTexture = glyph->mCacheTexture;
224 uint32_t startY = glyph->mStartY * srcStride;
225 uint32_t endY = startY + (glyph->mBitmapHeight * srcStride);
233 memcpy(&bitmap[bitmapY + dstX], &cacheBuffer[cacheY + glyph->mStartX], glyph->mBitmapWidth);
235 for (uint32_t i = 0; i < glyph->mBitmapWidth; ++i) {
236 bitmap[bitmapY + dstX + i] = cacheBuffer[cacheY + (glyph->mStartX + i)*formatSize + alpha_channel_offset];
243 void Font::drawCachedGlyph(CachedGlyphInfo* glyph, float x, float hOffset, float vOffset,
245 const float halfWidth = glyph->mBitmapWidth * 0.5f;
246 const float height = glyph->mBitmapHeight;
248 vOffset += glyph->mBitmapTop + height;
251 bool ok = measure.getPosTan(x + hOffset + glyph->mBitmapLeft + halfWidth, position, tangent);
266 const float u1 = glyph->mBitmapMinU;
267 const float u2 = glyph->mBitmapMaxU;
268 const float v1 = glyph->mBitmapMinV;
269 const float v2 = glyph->mBitmapMaxV;
280 glyph->mCacheTexture);
286 // Is the glyph still in texture cache?
335 glyph_t glyph = GET_GLYPH(text);
337 if (IS_END_OF_STRING(glyph)) {
341 CachedGlyphInfo* cachedGlyph = getCachedGlyph(paint, glyph);
374 glyph_t glyph = GET_GLYPH(text);
377 if (IS_END_OF_STRING(glyph)) {
381 CachedGlyphInfo* cachedGlyph = getCachedGlyph(paint, glyph, true);
409 glyph_t glyph = GET_GLYPH(text);
412 if (IS_END_OF_STRING(glyph)) {
416 CachedGlyphInfo* cachedGlyph = getCachedGlyph(paint, glyph);
433 SkGlyphCache* skiaGlyphCache, CachedGlyphInfo* glyph, bool precaching) {
434 glyph->mAdvanceX = skiaGlyph.fAdvanceX;
435 glyph->mAdvanceY = skiaGlyph.fAdvanceY;
436 glyph->mBitmapLeft = skiaGlyph.fLeft;
437 glyph->mBitmapTop = skiaGlyph.fTop;
438 glyph->mLsbDelta = skiaGlyph.fLsbDelta;
439 glyph->mRsbDelta = skiaGlyph.fRsbDelta;
444 // Get the bitmap for the glyph
448 mState->cacheBitmap(skiaGlyph, glyph, &startX, &startY, precaching);
450 if (!glyph->mIsValid) {
457 glyph->mStartX = startX;
458 glyph->mStartY = startY;
459 glyph->mBitmapWidth = skiaGlyph.fWidth;
460 glyph->mBitmapHeight = skiaGlyph.fHeight;
464 uint32_t cacheWidth = glyph->mCacheTexture->getWidth();
465 uint32_t cacheHeight = glyph->mCacheTexture->getHeight();
467 glyph->mBitmapMinU = startX / (float) cacheWidth;
468 glyph->mBitmapMinV = startY / (float) cacheHeight;
469 glyph->mBitmapMaxU = endX / (float) cacheWidth;
470 glyph->mBitmapMaxV = endY / (float) cacheHeight;
476 CachedGlyphInfo* Font::cacheGlyph(const SkPaint* paint, glyph_t glyph, bool precaching) {
478 mCachedGlyphs.add(glyph, newGlyph);
481 const SkGlyph& skiaGlyph = GET_METRICS(autoCache.getCache(), glyph);