aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
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 /src
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
Diffstat (limited to 'src')
-rw-r--r--src/core/SkScalerContext.cpp11
-rw-r--r--src/core/SkScalerContext.h4
2 files changed, 10 insertions, 5 deletions
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();