aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/fonts/SkTestTypeface.h
diff options
context:
space:
mode:
authorGravatar Jim Van Verth <jvanverth@google.com>2018-03-23 14:39:42 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-03-23 14:39:51 +0000
commitaf78a942179143e4646871fc797e2ce17c23a594 (patch)
treee1df52c03c579436005b1098a500a3523c816000 /tools/fonts/SkTestTypeface.h
parent8c53d465e3ceb3898f8037b61046c198bbec2fca (diff)
Revert "Add color fonts."
This reverts commit c912d6133c66df7cde3d64adc76941856a12da64. Reason for revert: Causing TSAN issues. Original change's description: > Add color fonts. > > BUG=skia:7624 > > Change-Id: Id2b7449048591892ff802484d5e3745a7e1402bb > Reviewed-on: https://skia-review.googlesource.com/109521 > Commit-Queue: Ben Wagner <bungeman@google.com> > Reviewed-by: Mike Klein <mtklein@google.com> > Reviewed-by: Herb Derby <herb@google.com> TBR=mtklein@google.com,bungeman@google.com,herb@google.com Change-Id: I2ccd1f00e91bb92b7059323c95da0dd3de954164 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia:7624 Reviewed-on: https://skia-review.googlesource.com/116141 Reviewed-by: Jim Van Verth <jvanverth@google.com> Commit-Queue: Jim Van Verth <jvanverth@google.com>
Diffstat (limited to 'tools/fonts/SkTestTypeface.h')
-rw-r--r--tools/fonts/SkTestTypeface.h116
1 files changed, 0 insertions, 116 deletions
diff --git a/tools/fonts/SkTestTypeface.h b/tools/fonts/SkTestTypeface.h
deleted file mode 100644
index b520fb6e5c..0000000000
--- a/tools/fonts/SkTestTypeface.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Copyright 2014 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#ifndef SkTestTypeface_DEFINED
-#define SkTestTypeface_DEFINED
-
-#include "SkFixed.h"
-#include "SkFontArguments.h"
-#include "SkFontStyle.h"
-#include "SkPaint.h"
-#include "SkRefCnt.h"
-#include "SkScalar.h"
-#include "SkTypeface.h"
-#include "SkTypes.h"
-
-#include <memory>
-
-class SkDescriptor;
-class SkFontDescriptor;
-class SkGlyph;
-class SkPath;
-class SkScalerContext;
-class SkStreamAsset;
-class SkString;
-class SkTestFont;
-struct SkAdvancedTypefaceMetrics;
-struct SkScalerContextEffects;
-struct SkScalerContextRec;
-
-struct SkTestFontData {
- const SkScalar* fPoints;
- const unsigned char* fVerbs;
- const unsigned* fCharCodes;
- const size_t fCharCodesCount;
- const SkFixed* fWidths;
- const SkPaint::FontMetrics& fMetrics;
- const char* fName;
- SkFontStyle fStyle;
- sk_sp<SkTestFont> fCachedFont;
-};
-
-class SkTestFont : public SkRefCnt {
-public:
- SkTestFont(const SkTestFontData& );
- virtual ~SkTestFont();
- int codeToIndex(SkUnichar charCode) const;
- void init(const SkScalar* pts, const unsigned char* verbs);
-private:
- const unsigned* fCharCodes;
- const size_t fCharCodesCount;
- const SkFixed* fWidths;
- const SkPaint::FontMetrics& fMetrics;
- const char* fName;
- SkPath** fPaths;
- friend class SkTestTypeface;
- typedef SkRefCnt INHERITED;
-};
-
-
-class SkTestTypeface : public SkTypeface {
-public:
- SkTestTypeface(sk_sp<SkTestFont>, const SkFontStyle& style);
- void getAdvance(SkGlyph* glyph);
- void getFontMetrics(SkPaint::FontMetrics* metrics);
- void getMetrics(SkGlyph* glyph);
- void getPath(SkGlyphID glyph, SkPath* path);
-protected:
- SkScalerContext* onCreateScalerContext(const SkScalerContextEffects&,
- const SkDescriptor* desc) const override;
- void onFilterRec(SkScalerContextRec* rec) const override;
- std::unique_ptr<SkAdvancedTypefaceMetrics> onGetAdvancedMetrics() const override;
-
- SkStreamAsset* onOpenStream(int* ttcIndex) const override {
- return nullptr;
- }
-
- void onGetFontDescriptor(SkFontDescriptor* desc, bool* isLocal) const override;
-
- int onCharsToGlyphs(const void* chars, Encoding encoding,
- uint16_t glyphs[], int glyphCount) const override;
-
- int onCountGlyphs() const override {
- return (int) fTestFont->fCharCodesCount;
- }
-
- int onGetUPEM() const override {
- return 2048;
- }
-
- void onGetFamilyName(SkString* familyName) const override;
- SkTypeface::LocalizedStrings* onCreateFamilyNameIterator() const override;
-
- int onGetVariationDesignPosition(SkFontArguments::VariationPosition::Coordinate coordinates[],
- int coordinateCount) const override
- {
- return 0;
- }
-
- int onGetTableTags(SkFontTableTag tags[]) const override {
- return 0;
- }
-
- size_t onGetTableData(SkFontTableTag tag, size_t offset,
- size_t length, void* data) const override {
- return 0;
- }
-private:
- sk_sp<SkTestFont> fTestFont;
- friend class SkTestScalerContext;
-};
-
-#endif