47 const int yOff = itest.
fTop - iref.
fTop;
49 for (
int y = 0;
y <
test.height(); ++
y) {
50 for (
int x = 0;
x <
test.width(); ++
x) {
55 if (refX >= 0 && refX < ref.
width() &&
56 refY >= 0 && refY < ref.
height())
62 if (refColor != testColor) {
76 SkCanvas drawTextCanvas(drawTextBitmap);
80 SkCanvas drawDashedTextCanvas(drawDashedTextBitmap);
89 font.setSubpixel(
true);
100 paint.setStrokeWidth(2);
101 constexpr SkScalar bigInterval = 10000;
102 static constexpr SkScalar intervals[] = { 1, bigInterval };
119 auto canvas =
surface->getCanvas();
122 SkScalar oddballs[] = { 0.0f, (
float)INFINITY, (
float)NAN, 34359738368.0f };
124 for (
auto x : oddballs) {
128 for (
auto y : oddballs) {
138 auto canvas =
surface->getCanvas();
148 {10, { 0, 0, 0, 0, 0, 0, 0, 0, 1}},
149 {10, { 0, 0, 0, 0, 1, 0, 0, 0, 1}},
150 {10, { 0, 0, 0, 1, 0, 0, 0, 0, 1}},
151 {10, { 0, 0, 0, 1, 1, 0, 0, 0, 1}},
152 {10, { 0, 1, 0, 0, 1, 0, 0, 0, 1}},
153 {10, { 1, 0, 0, 0, 0, 0, 0, 0, 1}},
154 {10, { 1, 0, 0, 1, 0, 0, 0, 0, 1}},
155 {10, { 1, 1, 0, 0, 0, 0, 0, 0, 1}},
156 {10, { 1, 1, 0, 1, 1, 0, 0, 0, 1}},
158 { 1, {10, 20, 0, 20, 40, 0, 0, 0, 1}},
162 font.setSize(testCase.textSize);
166 canvas->setMatrix(mat);
167 canvas->drawString(
"Hamburgefons", 10, 10,
font,
SkPaint());
175 auto canvas =
surface->getCanvas();
177 auto text =
"Hamburgfons";
181 canvas->drawTextBlob(blob, 10, 10,
SkPaint());
184 "\x0d\xf3\xf2\xf2\xe9\x0d\x0d\x0d\x05\x0d\x0d\xe3\xe3\xe3\xe3\xe3\xe3\xe3\xe3\xe3",
static void create(SkBitmap *bm, SkIRect bound)
static bool compare(const SkBitmap &ref, const SkIRect &iref, const SkBitmap &test, const SkIRect &itest)
DEF_TEST(DrawText_dashout, reporter)
static const SkColor bgColor
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)
static sk_sp< SkPathEffect > Make(const SkScalar intervals[], int count, SkScalar phase)
@ kSubpixelAntiAlias
glyph positioned in pixel using transparency
SkMatrix & setAll(SkScalar scaleX, SkScalar skewX, SkScalar transX, SkScalar skewY, SkScalar scaleY, SkScalar transY, SkScalar persp0, SkScalar persp1, SkScalar persp2)
@ kStroke_Style
set to stroke geometry
static sk_sp< SkTextBlob > MakeFromText(const void *text, size_t byteLength, const SkFont &font, SkTextEncoding encoding=SkTextEncoding::kUTF8)
unsigned useCenter Optional< SkMatrix > matrix
SK_API sk_sp< SkSurface > Raster(const SkImageInfo &imageInfo, size_t rowBytes, const SkSurfaceProps *surfaceProps)
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
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 SkImageInfo MakeN32Premul(int width, int height)
static constexpr SkPoint Make(float x, float y)