make SkFontHost::NextLogicalTypeface private (only called by SkScalerContext)

git-svn-id: http://skia.googlecode.com/svn/trunk@8363 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
reed@google.com 2013-03-25 14:55:34 +00:00
parent e74f83bbfe
commit a45bcc8022
3 changed files with 13 additions and 7 deletions

View File

@ -91,6 +91,8 @@ public:
/** @deprecated get from Device. */
static LCDOrder GetSubpixelOrder();
private:
/**
* DEPRECATED -- will be DESTROYED
*
@ -110,8 +112,6 @@ public:
*/
static SkTypeface* NextLogicalTypeface(SkFontID currFontID, SkFontID origFontID);
private:
/** Return a new, closest matching typeface given either an existing family
(specified by a typeface in that family) or by a familyName and a
requested style.
@ -144,6 +144,7 @@ private:
///////////////////////////////////////////////////////////////////////////
friend class SkScalerContext;
friend class SkTypeface;
};

View File

@ -119,8 +119,9 @@ SkScalerContext::~SkScalerContext() {
// Return the context associated with the next logical typeface, or NULL if
// there are no more entries in the fallback chain.
static SkScalerContext* allocNextContext(const SkScalerContext::Rec& rec) {
SkTypeface* newFace = SkFontHost::NextLogicalTypeface(rec.fFontID, rec.fOrigFontID);
SkScalerContext* SkScalerContext::allocNextContext() const {
SkTypeface* newFace = SkFontHost::NextLogicalTypeface(fRec.fFontID,
fRec.fOrigFontID);
if (0 == newFace) {
return NULL;
}
@ -128,13 +129,13 @@ static SkScalerContext* allocNextContext(const SkScalerContext::Rec& rec) {
SkAutoTUnref<SkTypeface> aur(newFace);
uint32_t newFontID = newFace->uniqueID();
SkAutoDescriptor ad(sizeof(rec) + SkDescriptor::ComputeOverhead(1));
SkAutoDescriptor ad(sizeof(fRec) + SkDescriptor::ComputeOverhead(1));
SkDescriptor* desc = ad.getDesc();
desc->init();
SkScalerContext::Rec* newRec =
(SkScalerContext::Rec*)desc->addEntry(kRec_SkDescriptorTag,
sizeof(rec), &rec);
sizeof(fRec), &fRec);
newRec->fFontID = newFontID;
desc->computeChecksum();
@ -149,7 +150,7 @@ SkScalerContext* SkScalerContext::getNextContext() {
// if next is null, then either it isn't cached yet, or we're at the
// end of our possible chain
if (NULL == next) {
next = allocNextContext(fRec);
next = this->allocNextContext();
if (NULL == next) {
return NULL;
}

View File

@ -230,6 +230,10 @@ private:
void internalGetPath(const SkGlyph& glyph, SkPath* fillPath,
SkPath* devPath, SkMatrix* fillToDevMatrix);
// Return the context associated with the next logical typeface, or NULL if
// there are no more entries in the fallback chain.
SkScalerContext* allocNextContext() const;
// return the next context, treating fNextContext as a cache of the answer
SkScalerContext* getNextContext();