aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/core/SkDraw.cpp2
-rw-r--r--src/device/xps/SkXPSDevice.cpp2
-rw-r--r--src/gpu/GrTextContext.cpp2
-rw-r--r--src/pdf/SkPDFDevice.cpp6
-rw-r--r--src/pdf/SkPDFDevice.h3
-rw-r--r--src/pdf/SkPDFFont.cpp24
6 files changed, 18 insertions, 21 deletions
diff --git a/src/core/SkDraw.cpp b/src/core/SkDraw.cpp
index 2c9a3dee16..2bd9abb289 100644
--- a/src/core/SkDraw.cpp
+++ b/src/core/SkDraw.cpp
@@ -1694,7 +1694,7 @@ void SkDraw::drawPosText_asPaths(const char text[], size_t byteLength,
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;
diff --git a/src/device/xps/SkXPSDevice.cpp b/src/device/xps/SkXPSDevice.cpp
index d1525479c4..56800d1540 100644
--- a/src/device/xps/SkXPSDevice.cpp
+++ b/src/device/xps/SkXPSDevice.cpp
@@ -1949,7 +1949,7 @@ HRESULT SkXPSDevice::CreateTypefaceUse(const SkPaint& paint,
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);
diff --git a/src/gpu/GrTextContext.cpp b/src/gpu/GrTextContext.cpp
index 90328584a3..f929de69b1 100644
--- a/src/gpu/GrTextContext.cpp
+++ b/src/gpu/GrTextContext.cpp
@@ -218,7 +218,7 @@ void GrTextContext::drawPosTextAsPath(GrRenderTarget* rt,
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;
diff --git a/src/pdf/SkPDFDevice.cpp b/src/pdf/SkPDFDevice.cpp
index d044900ae3..422a895419 100644
--- a/src/pdf/SkPDFDevice.cpp
+++ b/src/pdf/SkPDFDevice.cpp
@@ -1161,7 +1161,7 @@ void SkPDFDevice::drawText(const SkDraw& d, const void* text, size_t len,
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(
@@ -1206,14 +1206,14 @@ void SkPDFDevice::drawPosText(const SkDraw& d, const void* text, size_t len,
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.");
diff --git a/src/pdf/SkPDFDevice.h b/src/pdf/SkPDFDevice.h
index 18be58de43..f58e74cc88 100644
--- a/src/pdf/SkPDFDevice.h
+++ b/src/pdf/SkPDFDevice.h
@@ -273,8 +273,7 @@ private:
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);
diff --git a/src/pdf/SkPDFFont.cpp b/src/pdf/SkPDFFont.cpp
index dd01458981..d8755ae9a3 100644
--- a/src/pdf/SkPDFFont.cpp
+++ b/src/pdf/SkPDFFont.cpp
@@ -894,8 +894,7 @@ SkPDFFont* SkPDFFont::Create(SkPDFCanon* canon,
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 ||
@@ -990,12 +989,11 @@ void SkPDFFont::populateToUnicodeTable(const SkPDFGlyphSet* subset) {
// 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);
}
}
@@ -1005,8 +1003,7 @@ SkPDFFont* SkPDFType0Font::getFontSubset(const SkPDFGlyphSet* subset) {
if (!canSubset()) {
return NULL;
}
- SkPDFType0Font* newSubset =
- new SkPDFType0Font(fontInfo(), typeface());
+ SkPDFType0Font* newSubset = new SkPDFType0Font(fontInfo(), typeface());
newSubset->populate(subset);
return newSubset;
}
@@ -1031,7 +1028,7 @@ bool SkPDFType0Font::populate(const SkPDFGlyphSet* subset) {
descendantFonts->appendObjRef(newCIDFont.detach());
this->insertObject("DescendantFonts", descendantFonts.detach());
- populateToUnicodeTable(subset);
+ this->populateToUnicodeTable(subset);
SkDEBUGCODE(fPopulated = true);
return true;
@@ -1045,7 +1042,7 @@ SkPDFCIDFont::SkPDFCIDFont(const SkAdvancedTypefaceMetrics* info,
SkTypeface* typeface,
const SkPDFGlyphSet* subset)
: SkPDFFont(info, typeface, NULL) {
- populate(subset);
+ this->populate(subset);
}
SkPDFCIDFont::~SkPDFCIDFont() {}
@@ -1202,7 +1199,7 @@ SkPDFType1Font::SkPDFType1Font(const SkAdvancedTypefaceMetrics* info,
uint16_t glyphID,
SkPDFDict* relatedFontDescriptor)
: SkPDFFont(info, typeface, relatedFontDescriptor) {
- populate(glyphID);
+ this->populate(glyphID);
}
SkPDFType1Font::~SkPDFType1Font() {}
@@ -1325,7 +1322,7 @@ SkPDFType3Font::SkPDFType3Font(const SkAdvancedTypefaceMetrics* info,
SkTypeface* typeface,
uint16_t glyphID)
: SkPDFFont(info, typeface, NULL) {
- populate(glyphID);
+ this->populate(glyphID);
}
SkPDFType3Font::~SkPDFType3Font() {}
@@ -1334,7 +1331,8 @@ bool SkPDFType3Font::populate(uint16_t glyphID) {
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) {
@@ -1397,7 +1395,7 @@ bool SkPDFType3Font::populate(uint16_t glyphID) {
this->insertObject("Widths", widthArray.detach());
this->insertName("CIDToGIDMap", "Identity");
- populateToUnicodeTable(NULL);
+ this->populateToUnicodeTable(NULL);
return true;
}