aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/fonts
diff options
context:
space:
mode:
Diffstat (limited to 'src/fonts')
-rw-r--r--src/fonts/SkGScalerContext.cpp10
-rw-r--r--src/fonts/SkRandomScalerContext.cpp12
-rw-r--r--src/fonts/SkTestScalerContext.cpp10
-rw-r--r--src/fonts/SkTestScalerContext.h2
4 files changed, 17 insertions, 17 deletions
diff --git a/src/fonts/SkGScalerContext.cpp b/src/fonts/SkGScalerContext.cpp
index 53d385437e..9da05492e6 100644
--- a/src/fonts/SkGScalerContext.cpp
+++ b/src/fonts/SkGScalerContext.cpp
@@ -53,7 +53,7 @@ protected:
void generateAdvance(SkGlyph*) override;
void generateMetrics(SkGlyph*) override;
void generateImage(const SkGlyph&) override;
- void generatePath(const SkGlyph&, SkPath*) override;
+ void generatePath(SkGlyphID, SkPath*) override;
void generateFontMetrics(SkPaint::FontMetrics*) override;
private:
@@ -89,7 +89,7 @@ void SkGScalerContext::generateMetrics(SkGlyph* glyph) {
glyph->fAdvanceY = SkScalarToFloat(advance.fY);
SkPath path;
- fProxy->getPath(*glyph, &path);
+ fProxy->getPath(glyph->getPackedID(), &path);
path.transform(fMatrix);
SkRect storage;
@@ -109,7 +109,7 @@ void SkGScalerContext::generateMetrics(SkGlyph* glyph) {
void SkGScalerContext::generateImage(const SkGlyph& glyph) {
if (SkMask::kARGB32_Format == glyph.fMaskFormat) {
SkPath path;
- fProxy->getPath(glyph, &path);
+ fProxy->getPath(glyph.getPackedID(), &path);
SkBitmap bm;
bm.installPixels(SkImageInfo::MakeN32Premul(glyph.fWidth, glyph.fHeight),
@@ -126,8 +126,8 @@ void SkGScalerContext::generateImage(const SkGlyph& glyph) {
}
}
-void SkGScalerContext::generatePath(const SkGlyph& glyph, SkPath* path) {
- fProxy->getPath(glyph, path);
+void SkGScalerContext::generatePath(SkGlyphID glyph, SkPath* path) {
+ fProxy->getPath(SkPackedGlyphID(glyph), path);
path->transform(fMatrix);
}
diff --git a/src/fonts/SkRandomScalerContext.cpp b/src/fonts/SkRandomScalerContext.cpp
index 96a2619876..55c7fb30d4 100644
--- a/src/fonts/SkRandomScalerContext.cpp
+++ b/src/fonts/SkRandomScalerContext.cpp
@@ -25,7 +25,7 @@ protected:
void generateAdvance(SkGlyph*) override;
void generateMetrics(SkGlyph*) override;
void generateImage(const SkGlyph&) override;
- void generatePath(const SkGlyph&, SkPath*) override;
+ void generatePath(SkGlyphID, SkPath*) override;
void generateFontMetrics(SkPaint::FontMetrics*) override;
private:
@@ -84,7 +84,7 @@ void SkRandomScalerContext::generateMetrics(SkGlyph* glyph) {
}
if (SkMask::kARGB32_Format == format) {
SkPath path;
- fProxy->getPath(*glyph, &path);
+ fProxy->getPath(glyph->getPackedID(), &path);
SkRect storage;
const SkPaint& paint = this->getRandomTypeface()->paint();
@@ -101,7 +101,7 @@ void SkRandomScalerContext::generateMetrics(SkGlyph* glyph) {
SkPath devPath, fillPath;
SkMatrix fillToDevMatrix;
- this->internalGetPath(*glyph, &fillPath, &devPath, &fillToDevMatrix);
+ this->internalGetPath(glyph->getPackedID(), &fillPath, &devPath, &fillToDevMatrix);
// just use devPath
const SkIRect ir = devPath.getBounds().roundOut();
@@ -154,7 +154,7 @@ void SkRandomScalerContext::generateImage(const SkGlyph& glyph) {
if (!fFakeIt) {
if (SkMask::kARGB32_Format == glyph.fMaskFormat) {
SkPath path;
- fProxy->getPath(glyph, &path);
+ fProxy->getPath(glyph.getPackedID(), &path);
SkBitmap bm;
bm.installPixels(SkImageInfo::MakeN32Premul(glyph.fWidth, glyph.fHeight),
@@ -175,8 +175,8 @@ void SkRandomScalerContext::generateImage(const SkGlyph& glyph) {
}
}
-void SkRandomScalerContext::generatePath(const SkGlyph& glyph, SkPath* path) {
- fProxy->getPath(glyph, path);
+void SkRandomScalerContext::generatePath(SkGlyphID glyph, SkPath* path) {
+ fProxy->generatePath(glyph, path);
}
void SkRandomScalerContext::generateFontMetrics(SkPaint::FontMetrics* metrics) {
diff --git a/src/fonts/SkTestScalerContext.cpp b/src/fonts/SkTestScalerContext.cpp
index 7a97ca8bba..d84571d310 100644
--- a/src/fonts/SkTestScalerContext.cpp
+++ b/src/fonts/SkTestScalerContext.cpp
@@ -137,8 +137,8 @@ void SkTestTypeface::getMetrics(SkGlyph* glyph) {
glyph->fAdvanceY = 0;
}
-void SkTestTypeface::getPath(const SkGlyph& glyph, SkPath* path) {
- *path = *fTestFont->fPaths[glyph.getGlyphID()];
+void SkTestTypeface::getPath(SkGlyphID glyph, SkPath* path) {
+ *path = *fTestFont->fPaths[glyph];
}
void SkTestTypeface::onFilterRec(SkScalerContextRec* rec) const {
@@ -236,7 +236,7 @@ protected:
glyph->fAdvanceY = SkScalarToFloat(advance.fY);
SkPath path;
- this->getTestTypeface()->getPath(*glyph, &path);
+ this->getTestTypeface()->getPath(glyph->getGlyphID(), &path);
path.transform(fMatrix);
SkRect storage;
@@ -254,7 +254,7 @@ protected:
void generateImage(const SkGlyph& glyph) override {
SkPath path;
- this->getTestTypeface()->getPath(glyph, &path);
+ this->getTestTypeface()->getPath(glyph.getGlyphID(), &path);
SkBitmap bm;
bm.installPixels(SkImageInfo::MakeN32Premul(glyph.fWidth, glyph.fHeight),
@@ -270,7 +270,7 @@ protected:
canvas.drawPath(path, paint);
}
- void generatePath(const SkGlyph& glyph, SkPath* path) override {
+ void generatePath(SkGlyphID glyph, SkPath* path) override {
this->getTestTypeface()->getPath(glyph, path);
path->transform(fMatrix);
}
diff --git a/src/fonts/SkTestScalerContext.h b/src/fonts/SkTestScalerContext.h
index 90945970fa..217e57c2a4 100644
--- a/src/fonts/SkTestScalerContext.h
+++ b/src/fonts/SkTestScalerContext.h
@@ -60,7 +60,7 @@ public:
void getAdvance(SkGlyph* glyph);
void getFontMetrics(SkPaint::FontMetrics* metrics);
void getMetrics(SkGlyph* glyph);
- void getPath(const SkGlyph& glyph, SkPath* path);
+ void getPath(SkGlyphID glyph, SkPath* path);
protected:
SkScalerContext* onCreateScalerContext(const SkScalerContextEffects&,
const SkDescriptor* desc) const override;