31#if defined(SK_GRAPHITE)
57 SkScalar textSizes[] = { 9.0f, 9.0f*2.0f, 9.0f*5.0f, 9.0f*2.0f*5.0f };
58 SkScalar scales[] = { 2.0f*5.0f, 5.0f, 2.0f, 1.0f };
62#if defined(SK_GRAPHITE)
63 auto recorder = inputCanvas->
recorder();
76#if defined(SK_GRAPHITE)
88 canvas->
scale(1.05f, 1.05f);
89 canvas->
clear(0xffffffff);
92 paint.setAntiAlias(
true);
95 font.setSubpixel(
true);
97 const char*
text =
"Hamburgefons";
98 const size_t textLen = strlen(
text);
106 canvas->
scale(scales[
i], scales[
i]);
107 font.setSize(textSizes[
i]);
109 y +=
font.getMetrics(
nullptr)*scales[
i];
113 for (
size_t i = 0;
i < 5; ++
i) {
120 for (
int ps = 6; ps <= 32; ps += 3) {
123 rotY +=
font.getMetrics(
nullptr);
132 for (
size_t i = 0;
i < arraySize; ++
i) {
136 canvas->
scale(scaleFactor, scaleFactor);
137 font.setSize(textSizes[
i]);
139 y +=
font.getMetrics(
nullptr)*scaleFactor;
146 canvas->
scale(2.0f, 2.0f);
151 font.setSize(textSizes[0]);
163 0xFFFFFF00, 0xFFFF00FF, 0xFF00FFFF,
164 0xFFFF0000, 0xFF00FF00, 0xFF0000FF,
168 paint.setColor(0xFFF7F3F7);
179 y +=
font.getMetrics(
nullptr);
182 paint.setColor(0xFF181C18);
193 y +=
font.getMetrics(
nullptr);
200 canvas->
skew(0.0f, 0.151515f);
207 canvas->
skew(0.5f, 0.0f);
217 persp.
setAll(0.9839f, 0, 0,
219 0.0002352f, -0.0003844f, 1);
226 font.setSubpixel(
false);
230 persp.
setAll(0.9839f, 0, 0,
232 0.0002352f, -0.0003844f, 1);
235 canvas->
scale(375, 375);
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
@ kUTF8
uses bytes to represent UTF-8 or ASCII
@ kGlyphID
uses two byte words to represent glyph indices
#define SkScalarInvert(x)
constexpr int SkToInt(S x)
void onDraw(SkCanvas *inputCanvas) override
SkString getName() const override
void onOnceBeforeDraw() override
SkISize getISize() override
bool getProps(SkSurfaceProps *props) const
void drawRect(const SkRect &rect, const SkPaint &paint)
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)
SkMatrix getLocalToDeviceAs3x3() const
virtual GrRecordingContext * recordingContext() const
virtual skgpu::graphite::Recorder * recorder() const
virtual SkISize getBaseLayerSize() const
void clear(SkColor color)
void rotate(SkScalar degrees)
void setMatrix(const SkM44 &matrix)
void scale(SkScalar sx, SkScalar sy)
void concat(const SkMatrix &matrix)
SkImageInfo imageInfo() const
void skew(SkScalar sx, SkScalar sy)
void drawTextBlob(const SkTextBlob *blob, SkScalar x, SkScalar y, const SkPaint &paint)
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
void setSubpixel(bool subpixel)
void setTypeface(sk_sp< SkTypeface > tf)
void setSize(SkScalar textSize)
@ kAntiAlias
may have transparent pixels on glyph edges
@ kAlias
no transparent pixels on glyph edges
@ 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)
@ kUseDeviceIndependentFonts_Flag
SkPixelGeometry pixelGeometry() const
static sk_sp< SkTextBlob > MakeFromPosText(const void *text, size_t byteLength, const SkPoint pos[], const SkFont &font, SkTextEncoding encoding=SkTextEncoding::kUTF8)
SK_API sk_sp< SkSurface > RenderTarget(GrRecordingContext *context, skgpu::Budgeted budgeted, const SkImageInfo &imageInfo, int sampleCount, GrSurfaceOrigin surfaceOrigin, const SkSurfaceProps *surfaceProps, bool shouldCreateWithMips=false, bool isProtected=false)
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 SkISize Make(int32_t w, int32_t h)
sk_sp< SkColorSpace > refColorSpace() const
static SkImageInfo MakeN32(int width, int height, SkAlphaType at)
static constexpr SkRect MakeLTRB(float l, float t, float r, float b)