Remove typeface from SkShaper constructor.
It isn't used anymore.
Change-Id: I4079ff9944aa2483a0cd42130d0e69fb98935731
Reviewed-on: https://skia-review.googlesource.com/c/192820
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
diff --git a/modules/skottie/src/SkottieAdapter.cpp b/modules/skottie/src/SkottieAdapter.cpp
index 9c04b9f..648a811 100644
--- a/modules/skottie/src/SkottieAdapter.cpp
+++ b/modules/skottie/src/SkottieAdapter.cpp
@@ -421,7 +421,7 @@
BlobMaker blobMaker(fText.fAlign);
const auto& push_line = [&](const char* start, const char* end) {
- SkShaper shaper(font.refTypeface());
+ SkShaper shaper;
if (!shaper.good()) {
return;
}
diff --git a/modules/skshaper/include/SkShaper.h b/modules/skshaper/include/SkShaper.h
index a6fa72e..ce7b54f 100644
--- a/modules/skshaper/include/SkShaper.h
+++ b/modules/skshaper/include/SkShaper.h
@@ -25,7 +25,7 @@
*/
class SkShaper {
public:
- SkShaper(sk_sp<SkTypeface> face);
+ SkShaper();
~SkShaper();
class RunHandler {
diff --git a/modules/skshaper/src/SkShaper_harfbuzz.cpp b/modules/skshaper/src/SkShaper_harfbuzz.cpp
index cea9fe0..b69a1d9 100644
--- a/modules/skshaper/src/SkShaper_harfbuzz.cpp
+++ b/modules/skshaper/src/SkShaper_harfbuzz.cpp
@@ -787,9 +787,7 @@
} // namespace
struct SkShaper::Impl {
- HBFont fHarfBuzzFont;
HBBuffer fBuffer;
- sk_sp<SkTypeface> fTypeface;
ICUBrk fLineBreakIterator;
ICUBrk fGraphemeBreakIterator;
@@ -825,15 +823,13 @@
const FontRunIterator* font) const;
};
-SkShaper::SkShaper(sk_sp<SkTypeface> tf) : fImpl(new Impl) {
+SkShaper::SkShaper() : fImpl(new Impl) {
#if defined(SK_USING_THIRD_PARTY_ICU)
if (!SkLoadICU()) {
SkDebugf("SkLoadICU() failed!\n");
return;
}
#endif
- fImpl->fTypeface = nullptr;
- fImpl->fHarfBuzzFont = nullptr;
fImpl->fBuffer.reset(hb_buffer_create());
SkASSERT(fImpl->fBuffer);
diff --git a/modules/skshaper/src/SkShaper_primitive.cpp b/modules/skshaper/src/SkShaper_primitive.cpp
index be436e4..9295a62 100644
--- a/modules/skshaper/src/SkShaper_primitive.cpp
+++ b/modules/skshaper/src/SkShaper_primitive.cpp
@@ -13,7 +13,7 @@
#include "SkUTF.h"
struct SkShaper::Impl {};
-SkShaper::SkShaper(sk_sp<SkTypeface> tf) : fImpl(new Impl()) {}
+SkShaper::SkShaper() : fImpl(nullptr) {}
SkShaper::~SkShaper() {}
diff --git a/samplecode/SampleTextBox.cpp b/samplecode/SampleTextBox.cpp
index 8c1c66e..a0eb5b4 100644
--- a/samplecode/SampleTextBox.cpp
+++ b/samplecode/SampleTextBox.cpp
@@ -71,7 +71,7 @@
canvas->clipRect(SkRect::MakeWH(w, h));
canvas->drawColor(bg);
- SkShaper shaper(nullptr);
+ SkShaper shaper;
SkScalar margin = 20;
diff --git a/src/utils/SkLua.cpp b/src/utils/SkLua.cpp
index a6057c9..303558e 100644
--- a/src/utils/SkLua.cpp
+++ b/src/utils/SkLua.cpp
@@ -1873,7 +1873,7 @@
SkRect bounds;
lua2rect(L, 2, &bounds);
- SkShaper shaper(nullptr);
+ SkShaper shaper;
// TODO: restore this logic based on SkFont instead of SkPaint
#if 0
diff --git a/tools/using_skia_and_harfbuzz.cpp b/tools/using_skia_and_harfbuzz.cpp
index 8ca76f2..586b9e84 100644
--- a/tools/using_skia_and_harfbuzz.cpp
+++ b/tools/using_skia_and_harfbuzz.cpp
@@ -208,7 +208,7 @@
if (font_file.size() > 0) {
typeface = SkTypeface::MakeFromFile(font_file.c_str(), 0 /* index */);
}
- SkShaper shaper(typeface);
+ SkShaper shaper;
assert(shaper.good());
//SkString line("This is هذا هو الخط a line.");
//SkString line("This is a line هذا هو الخط.");