34#if defined(SK_GRAPHITE)
39#include <initializer_list>
46 constexpr SkPoint kPts[] = { { 0, 0 }, { 32, 32 } };
48 constexpr SkColor kColors[] = {0x80F00080, 0xF0F08000, 0x800080F0 };
55 memset(
matrix, 0, 20 *
sizeof(
float));
97#if defined(SK_GRAPHITE)
109 *errorMsg =
SkStringPrintf(
"Unable to instantiate emoji test font of format %s.",
116 size_t textLen = strlen(
text);
119 constexpr SkScalar textSizes[] = { 10, 30, 50 };
122 for (
const bool& fakeBold : {
false,
true }) {
123 font.setEmbolden(fakeBold);
124 for (
const SkScalar& textSize : textSizes) {
125 font.setSize(textSize);
126 font.getMetrics(&metrics);
136 font.getMetrics(&metrics);
143 for (
int makeLinear = 0; makeLinear < 2; makeLinear++) {
144 for (
int makeBlur = 0; makeBlur < 2; makeBlur++) {
145 for (
int makeGray = 0; makeGray < 2; makeGray++) {
146 for (
int makeMode = 0; makeMode < 2; ++makeMode) {
147 for (
int alpha = 0; alpha < 2; ++alpha) {
173 shaderFont, shaderPaint);
194 boundsHalfWidth, boundsHalfHeight);
196 boundsHalfWidth, boundsHalfHeight);
198 interiorClip.
inset(boundsQuarterWidth, boundsQuarterHeight);
200 const SkRect clipRects[] = {
bounds, upperLeftClip, lowerRightClip, interiorClip };
211 paint.setAlpha(0x20);
214 paint.setAlphaf(1.0f);
#define SkColorSetRGB(r, g, b)
constexpr SkColor SK_ColorGRAY
constexpr SkColor SK_ColorWHITE
@ kUTF8
uses bytes to represent UTF-8 or ASCII
SK_API SkString SkStringPrintf(const char *format,...) SK_PRINTF_LIKE(1
Creates a new string and writes into it using a printf()-style format.
static constexpr bool SkToBool(const T &x)
void drawRect(const SkRect &rect, const SkPaint &paint)
void clipRect(const SkRect &rect, SkClipOp op, bool doAntiAlias)
void drawSimpleText(const void *text, size_t byteLength, SkTextEncoding encoding, SkScalar x, SkScalar y, const SkFont &font, const SkPaint &paint)
void translate(SkScalar dx, SkScalar dy)
void drawColor(SkColor color, SkBlendMode mode=SkBlendMode::kSrcOver)
static sk_sp< SkColorFilter > Matrix(const SkColorMatrix &)
static sk_sp< SkColorFilter > Lighting(SkColor mul, SkColor add)
void setSize(SkScalar textSize)
SkScalar getMetrics(SkFontMetrics *metrics) const
static sk_sp< SkShader > MakeLinear(const SkPoint pts[2], const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, uint32_t flags=0, const SkMatrix *localMatrix=nullptr)
static sk_sp< SkImageFilter > ColorFilter(sk_sp< SkColorFilter > cf, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
static sk_sp< SkImageFilter > Blur(SkScalar sigmaX, SkScalar sigmaY, SkTileMode tileMode, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
void setStyle(Style style)
void setColor(SkColor color)
void setImageFilter(sk_sp< SkImageFilter > imageFilter)
@ kStroke_Style
set to stroke geometry
void setShader(sk_sp< SkShader > shader)
void setColorFilter(sk_sp< SkColorFilter > colorFilter)
DrawResult onDraw(SkCanvas *canvas, SkString *errorMsg) override
ToolUtils::EmojiTestSample emojiFont
ToolUtils::EmojiFontFormat fFormat
void modifyGrContextOptions(GrContextOptions *ctxOptions) override
SkString getName() const override
void onOnceBeforeDraw() override
SkISize getISize() override
ColorEmojiGM(ToolUtils::EmojiFontFormat format)
GM(SkColor backgroundColor=SK_ColorWHITE)
virtual void modifyGraphiteContextOptions(skgpu::graphite::ContextOptions *) const
static sk_sp< SkImageFilter > make_grayscale(sk_sp< SkImageFilter > input)
static sk_sp< SkShader > MakeLinear()
static sk_sp< SkImageFilter > make_blur(float amount, sk_sp< SkImageFilter > input)
static sk_sp< SkColorFilter > make_color_filter()
uint32_t uint32_t * format
unsigned useCenter Optional< SkMatrix > matrix
Optional< SkRect > bounds
clipRect(r.rect, r.opAA.op(), r.opAA.aa())) template<> void Draw
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.
static constexpr SkPoint kPts[kPtsCount]
DEF_GM(return F(C(clipbox), 0.0f, 0.0f, {})) DEF_GM(return F(C(clipbox)
size_t fGlyphCacheTextureMaximumBytes
SkScalar fLeading
distance to add between lines, typically positive or zero
SkScalar fAscent
distance to reserve above baseline, typically negative
SkScalar fDescent
distance to reserve below baseline, typically positive
static constexpr SkISize Make(int32_t w, int32_t h)
void inset(float dx, float dy)
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)
size_t fGlyphCacheTextureMaximumBytes