paint.setPathEffect(NULL);
SkDrawCacheProc glyphCacheProc = paint.getDrawCacheProc();
- SkAutoGlyphCache autoCache(paint, NULL, NULL);
+ SkAutoGlyphCache autoCache(paint, &fDevice->surfaceProps(), NULL);
SkGlyphCache* cache = autoCache.getCache();
const char* stop = text + byteLength;
newTypefaceUse.fontData = fontData;
newTypefaceUse.xpsFont = xpsFontResource.release();
- SkAutoGlyphCache agc(paint, NULL, &SkMatrix::I());
+ SkAutoGlyphCache agc(paint, &this->surfaceProps(), &SkMatrix::I());
SkGlyphCache* glyphCache = agc.getCache();
unsigned int glyphCount = glyphCache->getGlyphCount();
newTypefaceUse.glyphsUsed = new SkBitSet(glyphCount);
paint.setPathEffect(NULL);
SkDrawCacheProc glyphCacheProc = paint.getDrawCacheProc();
- SkAutoGlyphCache autoCache(paint, NULL, NULL);
+ SkAutoGlyphCache autoCache(paint, &fSurfaceProps, NULL);
SkGlyphCache* cache = autoCache.getCache();
const char* stop = text + byteLength;
SkTDArray<uint16_t> glyphIDsCopy(glyphIDs, numGlyphs);
while (numGlyphs > consumedGlyphCount) {
- updateFont(textPaint, glyphIDs[consumedGlyphCount], content.entry());
+ this->updateFont(textPaint, glyphIDs[consumedGlyphCount], content.entry());
SkPDFFont* font = content.entry()->fState.fFont;
int availableGlyphs = font->glyphsToPDFFontEncoding(
SkDrawCacheProc glyphCacheProc = textPaint.getDrawCacheProc();
content.entry()->fContent.writeText("BT\n");
- updateFont(textPaint, glyphIDs[0], content.entry());
+ this->updateFont(textPaint, glyphIDs[0], content.entry());
for (size_t i = 0; i < numGlyphs; i++) {
SkPDFFont* font = content.entry()->fState.fFont;
uint16_t encodedValue = glyphIDs[i];
if (font->glyphsToPDFFontEncoding(&encodedValue, 1) != 1) {
// The current pdf font cannot encode the current glyph.
// Try to get a pdf font which can encode the current glyph.
- updateFont(textPaint, glyphIDs[i], content.entry());
+ this->updateFont(textPaint, glyphIDs[i], content.entry());
font = content.entry()->fState.fFont;
if (font->glyphsToPDFFontEncoding(&encodedValue, 1) != 1) {
SkDEBUGFAIL("PDF could not encode glyph.");
int addGraphicStateResource(SkPDFObject* gs);
int addXObjectResource(SkPDFObject* xObject);
- void updateFont(const SkPaint& paint, uint16_t glyphID,
- ContentEntry* contentEntry);
+ void updateFont(const SkPaint& paint, uint16_t glyphID, ContentEntry* contentEntry);
int getFontResourceIndex(SkTypeface* typeface, uint16_t glyphID);
void internalDrawPaint(const SkPaint& paint, ContentEntry* contentEntry);
return new SkPDFType0Font(info, typeface);
}
if (type == SkAdvancedTypefaceMetrics::kType1_Font) {
- return new SkPDFType1Font(info, typeface, glyphID,
- relatedFontDescriptor);
+ return new SkPDFType1Font(info, typeface, glyphID, relatedFontDescriptor);
}
SkASSERT(type == SkAdvancedTypefaceMetrics::kCFF_Font ||
// class SkPDFType0Font
///////////////////////////////////////////////////////////////////////////////
-SkPDFType0Font::SkPDFType0Font(const SkAdvancedTypefaceMetrics* info,
- SkTypeface* typeface)
+SkPDFType0Font::SkPDFType0Font(const SkAdvancedTypefaceMetrics* info, SkTypeface* typeface)
: SkPDFFont(info, typeface, NULL) {
SkDEBUGCODE(fPopulated = false);
if (!canSubset()) {
- populate(NULL);
+ this->populate(NULL);
}
}
if (!canSubset()) {
return NULL;
}
- SkPDFType0Font* newSubset =
- new SkPDFType0Font(fontInfo(), typeface());
+ SkPDFType0Font* newSubset = new SkPDFType0Font(fontInfo(), typeface());
newSubset->populate(subset);
return newSubset;
}
descendantFonts->appendObjRef(newCIDFont.detach());
this->insertObject("DescendantFonts", descendantFonts.detach());
- populateToUnicodeTable(subset);
+ this->populateToUnicodeTable(subset);
SkDEBUGCODE(fPopulated = true);
return true;
SkTypeface* typeface,
const SkPDFGlyphSet* subset)
: SkPDFFont(info, typeface, NULL) {
- populate(subset);
+ this->populate(subset);
}
SkPDFCIDFont::~SkPDFCIDFont() {}
uint16_t glyphID,
SkPDFDict* relatedFontDescriptor)
: SkPDFFont(info, typeface, relatedFontDescriptor) {
- populate(glyphID);
+ this->populate(glyphID);
}
SkPDFType1Font::~SkPDFType1Font() {}
SkTypeface* typeface,
uint16_t glyphID)
: SkPDFFont(info, typeface, NULL) {
- populate(glyphID);
+ this->populate(glyphID);
}
SkPDFType3Font::~SkPDFType3Font() {}
SkPaint paint;
paint.setTypeface(typeface());
paint.setTextSize(1000);
- SkAutoGlyphCache autoCache(paint, NULL, NULL);
+ const SkSurfaceProps props(0, kUnknown_SkPixelGeometry);
+ SkAutoGlyphCache autoCache(paint, &props, NULL);
SkGlyphCache* cache = autoCache.getCache();
// If fLastGlyphID isn't set (because there is not fFontInfo), look it up.
if (lastGlyphID() == 0) {
this->insertObject("Widths", widthArray.detach());
this->insertName("CIDToGIDMap", "Identity");
- populateToUnicodeTable(NULL);
+ this->populateToUnicodeTable(NULL);
return true;
}