Flutter Engine
The Flutter Engine
RandomScalerContext.h
Go to the documentation of this file.
1/*
2 * Copyright 2015 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#ifndef RandomScalerContext_DEFINED
9#define RandomScalerContext_DEFINED
10
13
14/*
15 * This scaler context is for debug only purposes. It will 'randomly' but deterministically return
16 * LCD / A8 / BW / RBGA masks based off of the Glyph ID
17 */
18
20public:
21 SkRandomTypeface(sk_sp<SkTypeface> proxy, const SkPaint&, bool fakeit);
22
23 SkTypeface* proxy() const { return fProxy.get(); }
24 const SkPaint& paint() const { return fPaint; }
25
26protected:
27 std::unique_ptr<SkScalerContext> onCreateScalerContext(const SkScalerContextEffects&,
28 const SkDescriptor*) const override;
29 void onFilterRec(SkScalerContextRec*) const override;
30 void getGlyphToUnicodeMap(SkUnichar*) const override;
31 std::unique_ptr<SkAdvancedTypefaceMetrics> onGetAdvancedMetrics() const override;
32 std::unique_ptr<SkStreamAsset> onOpenStream(int* ttcIndex) const override;
34 void onGetFontDescriptor(SkFontDescriptor*, bool* isLocal) const override;
35
36 void onCharsToGlyphs(const SkUnichar* chars, int count, SkGlyphID glyphs[]) const override;
37 int onCountGlyphs() const override;
38 int onGetUPEM() const override;
39
40 void onGetFamilyName(SkString* familyName) const override;
41 bool onGetPostScriptName(SkString*) const override;
43
44 void getPostScriptGlyphNames(SkString*) const override;
45
46 bool onGlyphMaskNeedsCurrentColor() const override;
48 int coordinateCount) const override;
50 int parameterCount) const override;
51 int onGetTableTags(SkFontTableTag tags[]) const override;
52 size_t onGetTableData(SkFontTableTag, size_t offset, size_t length, void* data) const override;
53
54private:
55 sk_sp<SkTypeface> fProxy;
56 SkPaint fPaint;
57 bool fFakeIt;
58};
59
60#endif
uint16_t glyphs[5]
Definition: FontMgrTest.cpp:46
int count
Definition: FontMgrTest.cpp:50
uint32_t SkFontTableTag
Definition: SkTypeface.h:41
int32_t SkUnichar
Definition: SkTypes.h:175
uint16_t SkGlyphID
Definition: SkTypes.h:179
void getPostScriptGlyphNames(SkString *) const override
SkTypeface::LocalizedStrings * onCreateFamilyNameIterator() const override
int onGetVariationDesignPosition(SkFontArguments::VariationPosition::Coordinate coordinates[], int coordinateCount) const override
void onGetFontDescriptor(SkFontDescriptor *, bool *isLocal) const override
int onGetTableTags(SkFontTableTag tags[]) const override
void onGetFamilyName(SkString *familyName) const override
const SkPaint & paint() const
int onCountGlyphs() const override
std::unique_ptr< SkStreamAsset > onOpenStream(int *ttcIndex) const override
std::unique_ptr< SkAdvancedTypefaceMetrics > onGetAdvancedMetrics() const override
void onFilterRec(SkScalerContextRec *) const override
sk_sp< SkTypeface > onMakeClone(const SkFontArguments &args) const override
std::unique_ptr< SkScalerContext > onCreateScalerContext(const SkScalerContextEffects &, const SkDescriptor *) const override
bool onGetPostScriptName(SkString *) const override
bool onGlyphMaskNeedsCurrentColor() const override
int onGetVariationDesignParameters(SkFontParameters::Variation::Axis parameters[], int parameterCount) const override
void onCharsToGlyphs(const SkUnichar *chars, int count, SkGlyphID glyphs[]) const override
void getGlyphToUnicodeMap(SkUnichar *) const override
SkTypeface * proxy() const
size_t onGetTableData(SkFontTableTag, size_t offset, size_t length, void *data) const override
int onGetUPEM() const override
friend class SkRandomTypeface
Definition: SkTypeface.h:420
T * get() const
Definition: SkRefCnt.h:303
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
size_t length
SeparatedVector2 offset
std::shared_ptr< const fml::Mapping > data
Definition: texture_gles.cc:63