Lines Matching refs:glyph
192 // Represent a set of x sub-pixel-position glyphs with a glyph id < kMaxGlyphID and
195 // the glyph id and the y position == 0 with a single compare in the following way:
216 "SkPackedGlyphID must be organized: sub-y | glyph id | sub-x");
281 // Keep track of if the glyph draw has been totally satisfied. It could be that this
282 // strike can not draw the glyph, and it must be rejected to be handled by fallback.
283 // For example, if a glyph has canDrawAsMask sent, then that data is on the GPU, and this
284 // strike totally satisfies this result. If canDrawAsMask is false, then this glyph must be
308 // dimension of the glyph.
322 void writeGlyphPath(const SkGlyph& glyph, Serializer* serializer) const;
371 static void writeGlyph(const SkGlyph& glyph, Serializer* serializer) {
372 serializer->write<SkPackedGlyphID>(glyph.getPackedID());
373 serializer->write<float>(glyph.advanceX());
374 serializer->write<float>(glyph.advanceY());
375 serializer->write<uint16_t>(glyph.width());
376 serializer->write<uint16_t>(glyph.height());
377 serializer->write<int16_t>(glyph.top());
378 serializer->write<int16_t>(glyph.left());
379 serializer->write<uint8_t>(glyph.maskFormat());
400 for (SkGlyph& glyph : fMasksToSend) {
401 SkASSERT(SkMask::IsValidFormat(glyph.fMaskFormat));
403 writeGlyph(glyph, serializer);
404 auto imageSize = glyph.imageSize();
405 if (imageSize > 0 && FitsInAtlas(glyph)) {
406 glyph.fImage = serializer->allocate(imageSize, glyph.formatAlignment());
407 fContext->getImage(glyph);
414 for (SkGlyph& glyph : fPathsToSend) {
415 SkASSERT(SkMask::IsValidFormat(glyph.fMaskFormat));
417 writeGlyph(glyph, serializer);
418 writeGlyphPath(glyph, serializer);
440 const SkGlyph& glyph, Serializer* serializer) const {
441 if (glyph.isColor() || glyph.isEmpty()) {
446 const SkPath* path = glyph.path();
468 SkGlyph* glyph = &fMasksToSend.back();
471 {packedID.value(), CanDrawAsMask(*glyph), CanDrawAsSDFT(*glyph)};
501 SkGlyph* glyph = &fMasksToSend.back();
504 {packedID.value(), CanDrawAsMask(*glyph), CanDrawAsSDFT(*glyph)};
537 SkGlyph* glyph = &fPathsToSend.back();
539 uint16_t maxDimensionOrPath = glyph->maxDimension();
541 if (!glyph->isColor() && !glyph->isEmpty()) {
542 glyph->setPath(&fPathAlloc, fContext.get());
543 if (glyph->path() != nullptr) {
548 PathSummary newSummary = {glyph->getGlyphID(), maxDimensionOrPath};
891 static bool ReadGlyph(SkTLazy<SkGlyph>& glyph, Deserializer* deserializer);
911 bool SkStrikeClientImpl::ReadGlyph(SkTLazy<SkGlyph>& glyph, Deserializer* deserializer) {
914 glyph.init(glyphID);
915 if (!deserializer->read<float>(&glyph->fAdvanceX)) return false;
916 if (!deserializer->read<float>(&glyph->fAdvanceY)) return false;
917 if (!deserializer->read<uint16_t>(&glyph->fWidth)) return false;
918 if (!deserializer->read<uint16_t>(&glyph->fHeight)) return false;
919 if (!deserializer->read<int16_t>(&glyph->fTop)) return false;
920 if (!deserializer->read<int16_t>(&glyph->fLeft)) return false;
924 glyph->fMaskFormat = static_cast<SkMask::Format>(maskFormat);
1016 SkTLazy<SkGlyph> glyph;
1017 if (!ReadGlyph(glyph, &deserializer)) READ_FAILURE
1019 if (!glyph->isEmpty() && SkStrikeForGPU::FitsInAtlas(*glyph)) {
1021 deserializer.read(glyph->imageSize(), glyph->formatAlignment());
1023 glyph->fImage = (void*)image;
1026 strike->mergeGlyphAndImage(glyph->getPackedID(), *glyph);
1031 SkTLazy<SkGlyph> glyph;
1032 if (!ReadGlyph(glyph, &deserializer)) READ_FAILURE
1034 SkGlyph* allocatedGlyph = strike->mergeGlyphAndImage(glyph->getPackedID(), *glyph);