diff options
author | Hal Canary <halcanary@google.com> | 2017-05-04 14:23:55 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-05-05 13:53:40 +0000 |
commit | 209e4b1b70a5e9c2f504de15f038999ed9ee4ae5 (patch) | |
tree | 137e2b6ce3d37f25c0bd20caf1838676d0fc7c0f /tests | |
parent | 452f92016ba3144f1e58466727074a859d39c072 (diff) |
Revert "Revert "SkTypeface::getAdvancedMetrics(): cleanup""
This reverts commit 59ad782b2b05b07aa6eb961aa4d62e934093cbd1.
- SkAdvancedTypefaceMetrics is a struct not a class
- SkTypeface::PerGlyphInfo is gone
- s/getAdvancedTypefaceMetrics/getAdvancedMetrics/g
- s/onGetAdvancedTypefaceMetrics/onGetAdvancedMetrics/g
- [on]getAdvancedMetrics now return unique_ptr rather than bare ptr.
- [on]getAdvancedMetrics no longer has parameters. (Only caller always
used same arguments.)
- SkAdvancedTypefaceMetrics uses C++11 in-class member initializers.
- SkAdvancedTypefaceMetrics no longer inherits from SkRefCnt
Change-Id: I91b56e60f7d9de7d46c426c6bd34ce124e0cf00e
Reviewed-on: https://skia-review.googlesource.com/15360
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/FontMgrTest.cpp | 12 | ||||
-rw-r--r-- | tests/TypefaceTest.cpp | 7 |
2 files changed, 10 insertions, 9 deletions
diff --git a/tests/FontMgrTest.cpp b/tests/FontMgrTest.cpp index 251eb154a0..ef420f3b1d 100644 --- a/tests/FontMgrTest.cpp +++ b/tests/FontMgrTest.cpp @@ -5,14 +5,14 @@ * found in the LICENSE file. */ +#include "SkAdvancedTypefaceMetrics.h" #include "SkCommandLineFlags.h" +#include "SkFont.h" #include "SkFontMgr.h" +#include "SkPaint.h" #include "SkTypeface.h" #include "Test.h" -#include "SkFont.h" -#include "SkPaint.h" - #include <initializer_list> #include <limits> #include <vector> @@ -133,9 +133,9 @@ static void test_matchStyleCSS3(skiatest::Reporter* reporter) { return nullptr; } void onFilterRec(SkScalerContextRec*) const override { } - virtual SkAdvancedTypefaceMetrics* onGetAdvancedTypefaceMetrics( - PerGlyphInfo, - const uint32_t*, uint32_t) const override { return nullptr; } + std::unique_ptr<SkAdvancedTypefaceMetrics> onGetAdvancedMetrics() const override { + return nullptr; + } void onGetFontDescriptor(SkFontDescriptor*, bool*) const override { } virtual int onCharsToGlyphs(const void* chars, Encoding encoding, uint16_t glyphs[], int glyphCount) const override { diff --git a/tests/TypefaceTest.cpp b/tests/TypefaceTest.cpp index 8d7ac31b99..1da94bb8a6 100644 --- a/tests/TypefaceTest.cpp +++ b/tests/TypefaceTest.cpp @@ -5,6 +5,7 @@ * found in the LICENSE file. */ +#include "SkAdvancedTypefaceMetrics.h" #include "SkData.h" #include "SkFixed.h" #include "SkFontMgr.h" @@ -196,9 +197,9 @@ protected: return nullptr; } void onFilterRec(SkScalerContextRec*) const override { } - virtual SkAdvancedTypefaceMetrics* onGetAdvancedTypefaceMetrics( - PerGlyphInfo, - const uint32_t*, uint32_t) const override { return nullptr; } + std::unique_ptr<SkAdvancedTypefaceMetrics> onGetAdvancedMetrics() const override { + return nullptr; + } void onGetFontDescriptor(SkFontDescriptor*, bool*) const override { } virtual int onCharsToGlyphs(const void* chars, Encoding encoding, uint16_t glyphs[], int glyphCount) const override { |