Home | History | Annotate | Download | only in text

Lines Matching refs:glyph

57 static inline GrMaskFormat get_packed_glyph_mask_format(const SkGlyph& glyph) {
58 SkMask::Format format = static_cast<SkMask::Format>(glyph.fMaskFormat);
76 static inline bool get_packed_glyph_bounds(SkGlyphCache* cache, const SkGlyph& glyph,
81 cache->findImage(glyph);
83 bounds->setXYWH(glyph.fLeft, glyph.fTop, glyph.fWidth, glyph.fHeight);
88 static inline bool get_packed_glyph_df_bounds(SkGlyphCache* cache, const SkGlyph& glyph,
93 cache->findImage(glyph);
95 bounds->setXYWH(glyph.fLeft, glyph.fTop, glyph.fWidth, glyph.fHeight);
101 // expands each bit in a bitmask to 0 or ~0 of type INT_TYPE. Used to expand a BW glyph mask to
125 static bool get_packed_glyph_image(SkGlyphCache* cache, const SkGlyph& glyph, int width,
128 SkASSERT(glyph.fWidth == width);
129 SkASSERT(glyph.fHeight == height);
130 const void* src = cache->findImage(glyph);
138 if (get_packed_glyph_mask_format(glyph) != expectedMaskFormat) {
147 int srcRB = glyph.rowBytes();
149 // check the glyph's format, not the strike's format, and to be able to convert to any of the
151 if (SkMask::kBW_Format == glyph.fMaskFormat) {
181 static bool get_packed_glyph_df_image(SkGlyphCache* cache, const SkGlyph& glyph,
183 SkASSERT(glyph.fWidth + 2*SK_DistanceFieldPad == width);
184 SkASSERT(glyph.fHeight + 2*SK_DistanceFieldPad == height);
187 const SkPath* path = cache->findPath(glyph);
192 SkDEBUGCODE(SkRect glyphBounds = SkRect::MakeXYWH(glyph.fLeft,
193 glyph.fTop,
194 glyph.fWidth,
195 glyph.fHeight));
201 drawMatrix.setTranslate((SkScalar)-glyph.fLeft, (SkScalar)-glyph.fTop);
210 const void* image = cache->findImage(glyph);
217 SkMask::Format maskFormat = static_cast<SkMask::Format>(glyph.fMaskFormat);
222 glyph.fWidth, glyph.fHeight,
223 glyph.rowBytes());
228 glyph.fWidth, glyph.fHeight,
229 glyph.rowBytes());
277 GrGlyph* glyph = fPool.make<GrGlyph>();
278 glyph->init(packed, bounds, format);
279 fCache.add(glyph);
280 return glyph;
299 GrGlyph* glyph,
302 SkASSERT(glyph);
304 SkASSERT(fCache.find(glyph->fPackedID));
308 size_t size = glyph->fBounds.area() * bytesPerPixel;
311 const SkGlyph& skGlyph = GrToSkGlyph(cache, glyph->fPackedID);
312 if (GrGlyph::kDistance_MaskStyle == GrGlyph::UnpackMaskStyle(glyph->fPackedID)) {
313 if (!get_packed_glyph_df_image(cache, skGlyph, glyph->width(), glyph->height(),
318 if (!get_packed_glyph_image(cache, skGlyph, glyph->width(), glyph->height(),
319 glyph->width() * bytesPerPixel, expectedMaskFormat,
326 &glyph->fID, target, expectedMaskFormat,
327 glyph->width(), glyph->height(),
328 storage.get(), &glyph->fAtlasLocation);
330 SkASSERT(GrDrawOpAtlas::kInvalidAtlasID != glyph->fID);