49 const int yOff = itest.
fTop - iref.
fTop;
51 for (
int y = 0;
y <
test.height(); ++
y) {
52 for (
int x = 0;
x <
test.width(); ++
x) {
57 if (refX >= 0 && refX < ref.
width() &&
58 refY >= 0 && refY < ref.
height())
64 if (refColor != testColor) {
82 create(&origBitmap, origRect);
100 if (!deserializedTypeface) {
106 bool mustSerializeData =
false;
111 create(&deserializedBitmap, origRect);
112 SkCanvas deserializedCanvas(deserializedBitmap);
114 font.setTypeface(deserializedTypeface);
115 drawBG(&deserializedCanvas);
123 std::unique_ptr<SkStreamAsset> fontData = typeface->
openStream(&ttcIndex);
130 if (!streamTypeface) {
137 create(&streamBitmap, origRect);
138 SkCanvas streamCanvas(streamBitmap);
141 bool mustSerializeData =
false;
145 font.setTypeface(streamTypeface);
static void create(SkBitmap *bm, SkIRect bound)
DEF_TEST(FontHostStream, reporter)
static bool compare(const SkBitmap &ref, const SkIRect &iref, const SkBitmap &test, const SkIRect &itest)
static void drawBG(SkCanvas *canvas)
static const SkColor bgColor
#define SkASSERT_RELEASE(cond)
constexpr SkColor SK_ColorGRAY
constexpr SkColor SK_ColorWHITE
#define REPORTER_ASSERT(r, cond,...)
SkColor getColor(int x, int y) const
void allocN32Pixels(int width, int height, bool isOpaque=false)
void drawColor(SkColor color, SkBlendMode mode=SkBlendMode::kSrcOver)
void drawString(const char str[], SkScalar x, SkScalar y, const SkFont &font, const SkPaint &paint)
std::unique_ptr< SkStreamAsset > detachAsStream()
sk_sp< SkTypeface > makeFromStream(std::unique_ptr< SkStreamAsset >, int ttcIndex=0) const
@ kAlias
no transparent pixels on glyph edges
static void PurgeFontCache()
void getFontDescriptor(SkFontDescriptor *desc, bool *isLocal) const
void serialize(SkWStream *, SerializeBehavior=SerializeBehavior::kIncludeDataIfLocal) const
static sk_sp< SkTypeface > MakeDeserialize(SkStream *, sk_sp< SkFontMgr > lastResortMgr)
std::unique_ptr< SkStreamAsset > openStream(int *ttcIndex) const
font
Font Metadata and Metrics.
constexpr int32_t height() const
int32_t fTop
smaller y-axis bounds
constexpr int32_t width() const
static constexpr SkIRect MakeWH(int32_t w, int32_t h)
int32_t fLeft
smaller x-axis bounds
static constexpr SkPoint Make(float x, float y)