aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-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();