aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-03-25 14:55:34 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-03-25 14:55:34 +0000
commita45bcc802229ba5e128d8ae7528b41219507970a (patch)
treed542aa5c17fb55ec629c935652221279c43c7463
parente74f83bbfe4b62fc7c0d2958db1aeac8155e1154 (diff)
make SkFontHost::NextLogicalTypeface private (only called by SkScalerContext)
git-svn-id: http://skia.googlecode.com/svn/trunk@8363 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r--include/core/SkFontHost.h5
-rw-r--r--src/core/SkScalerContext.cpp11
-rw-r--r--src/core/SkScalerContext.h4
3 files changed, 13 insertions, 7 deletions
diff --git a/include/core/SkFontHost.h b/include/core/SkFontHost.h
index f4627ef5da..43aef909bd 100644
--- a/include/core/SkFontHost.h
+++ b/include/core/SkFontHost.h
@@ -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;
};
diff --git a/src/core/SkScalerContext.cpp b/src/core/SkScalerContext.cpp
index 1f04960690..437dc151aa 100644
--- a/src/core/SkScalerContext.cpp
+++ b/src/core/SkScalerContext.cpp
@@ -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;
}
diff --git a/src/core/SkScalerContext.h b/src/core/SkScalerContext.h
index 94371a4720..dceabc18d9 100644
--- a/src/core/SkScalerContext.h
+++ b/src/core/SkScalerContext.h
@@ -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();