diff options
author | robertphillips <robertphillips@google.com> | 2015-05-15 11:30:41 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-05-15 11:30:41 -0700 |
commit | 465706820d0d373f76ab4831c286115ee0d86b7a (patch) | |
tree | f9fc8bd24b4e517292b7d6eedc9d17863acce670 /src/core/SkFontDescriptor.h | |
parent | daa57bfd4204f5a7d304c580bcf5ad99d0121e1f (diff) |
Revert of Font variations. (patchset #26 id:500001 of https://codereview.chromium.org/1027373002/)
Reason for revert:
Appears to be breaking Linux ARM bots:
FAILED:
/usr/local/google/home/mosaic-role/slave/repo_clients/chromium_tot/chromium/src/../../prebuilt/toolchain/armv7a/bin/armv7a-cros-linux-gnueabi-g++
... -o obj/third_party/skia/src/ports/skia_library.SkFontHost_FreeType.o
../../third_party/skia/src/ports/SkFontHost_FreeType.cpp:37:31: fatal error:
freetype/ftmm.h: No such file or directory
#include FT_MULTIPLE_MASTERS_H
^
compilation terminated.
Original issue's description:
> Font variations.
>
> Multiple Master and TrueType fonts support variation axes.
> This implements back-end support for axes on platforms which
> support it.
>
> Committed: https://skia.googlesource.com/skia/+/05773ed30920c0214d1433c07cf6360a05476c97
>
> Committed: https://skia.googlesource.com/skia/+/3489ee0f4fa34f124f9de090d12bdc2107d52aa9
TBR=reed@google.com,mtklein@google.com,djsollen@google.com,halcanary@google.com,bungeman@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Review URL: https://codereview.chromium.org/1139123008
Diffstat (limited to 'src/core/SkFontDescriptor.h')
-rw-r--r-- | src/core/SkFontDescriptor.h | 50 |
1 files changed, 10 insertions, 40 deletions
diff --git a/src/core/SkFontDescriptor.h b/src/core/SkFontDescriptor.h index 933a36a095..66707ddd3c 100644 --- a/src/core/SkFontDescriptor.h +++ b/src/core/SkFontDescriptor.h @@ -12,42 +12,7 @@ #include "SkString.h" #include "SkTypeface.h" -class SkFontData { -public: - /** This takes ownership of 'stream'. Makes a copy of the data in 'axis'. */ - SkFontData(SkStreamAsset* stream, int index, const SkFixed axis[], int axisCount) - : fStream(stream), fIndex(index), fAxisCount(axisCount), fAxis(axisCount) - { - for (int i = 0; i < axisCount; ++i) { - fAxis[i] = axis[i]; - } - } - SkFontData(const SkFontData& that) - : fStream(that.fStream->duplicate()) - , fIndex(that.fIndex) - , fAxisCount(that.fAxisCount) - , fAxis(fAxisCount) - { - for (int i = 0; i < fAxisCount; ++i) { - fAxis[i] = that.fAxis[i]; - } - } - bool hasStream() const { return fStream.get() != NULL; } - SkStreamAsset* duplicateStream() const { return fStream->duplicate(); } - SkStreamAsset* detachStream() { return fStream.detach(); } - SkStreamAsset* getStream() { return fStream.get(); } - int getIndex() const { return fIndex; } - int getAxisCount() const { return fAxisCount; } - const SkFixed* getAxis() const { return fAxis.get(); } - -private: - SkAutoTDelete<SkStreamAsset> fStream; - int fIndex; - int fAxisCount; - SkAutoSTMalloc<4, SkFixed> fAxis; -}; - -class SkFontDescriptor : SkNoncopyable { +class SkFontDescriptor { public: SkFontDescriptor(SkTypeface::Style = SkTypeface::kNormal); // Does not affect ownership of SkStream. @@ -62,20 +27,25 @@ public: const char* getFullName() const { return fFullName.c_str(); } const char* getPostscriptName() const { return fPostscriptName.c_str(); } bool hasFontData() const { return fFontData.get() != NULL; } - SkFontData* detachFontData() { return fFontData.detach(); } + // Transfers ownership to the caller. + SkStreamAsset* transferFontData() { return fFontData.detach(); } + int getFontIndex() const { return fFontIndex; } void setFamilyName(const char* name) { fFamilyName.set(name); } void setFullName(const char* name) { fFullName.set(name); } void setPostscriptName(const char* name) { fPostscriptName.set(name); } /** Set the font data only if it is necessary for serialization. - * This method takes ownership of the font data. */ - void setFontData(SkFontData* data) { fFontData.reset(data); } + * This method takes ownership of the stream (both reference and cursor). + */ + void setFontData(SkStreamAsset* stream) { fFontData.reset(stream); } + void setFontIndex(int index) { fFontIndex = index; } private: SkString fFamilyName; SkString fFullName; SkString fPostscriptName; - SkAutoTDelete<SkFontData> fFontData; + SkAutoTDelete<SkStreamAsset> fFontData; + int fFontIndex; SkTypeface::Style fStyle; }; |