24 static constexpr SkScalar kTextHeight = 36;
29 SkISize getISize()
override {
return {640, 480}; }
31 void onDraw(
SkCanvas* canvas)
override {
33 drawText(canvas,
SkString(
"TEXT: SubpixelTrue LCDRenderTrue"),
35 drawText(canvas,
SkString(
"TEXT: SubpixelTrue LCDRenderFalse"),
37 drawText(canvas,
SkString(
"TEXT: SubpixelFalse LCDRenderTrue"),
39 drawText(canvas,
SkString(
"TEXT: SubpixelFalse LCDRenderFalse"),
44 bool subpixelTextEnabled,
bool lcdRenderTextEnabled) {
47 paint.setDither(
true);
49 if (subpixelTextEnabled) {
50 font.setSubpixel(
true);
52 if (lcdRenderTextEnabled) {
69 m.setScale(sx, sy, px, py);
75 SkISize getISize()
override {
return {320, 120}; }
77 void onDraw(
SkCanvas* canvas)
override {
78 const char* lcd_text =
"LCD";
79 const char* gray_text =
"GRAY";
81 constexpr static float kLCDTextSizeLimit = 48;
89 { { 10, 50 }, kLCDTextSizeLimit - 1, 1, lcd_text },
90 { { 160, 50 }, kLCDTextSizeLimit + 1, 1, gray_text },
91 { { 10, 100 }, kLCDTextSizeLimit / 2, 1.99f, lcd_text },
92 { { 160, 100 }, kLCDTextSizeLimit / 2, 2.01f, gray_text },
102 ScaleAbout(canvas, rec[
i].fScale, rec[
i].fScale, loc.
x(), loc.
y());
109 static constexpr SkScalar kTextHeight = 36;
111 SkString getName()
const override {
return SkString(
"savelayerpreservelcdtext"); }
113 SkISize getISize()
override {
return {620, 300}; }
115 void onDraw(
SkCanvas* canvas)
override {
116 drawText(canvas,
SkString(
"SaveLayer PreserveLCDText"), 50,
118 drawText(canvas,
SkString(
"SaveLayer Default (LCDText not preserved)"), 150, 0);
constexpr SkColor SK_ColorBLACK
constexpr SkColor SK_ColorWHITE
int saveLayer(const SkRect *bounds, const SkPaint *paint)
void drawRect(const SkRect &rect, const SkPaint &paint)
@ kPreserveLCDText_SaveLayerFlag
void concat(const SkMatrix &matrix)
void drawString(const char str[], SkScalar x, SkScalar y, const SkFont &font, const SkPaint &paint)
@ kSubpixelAntiAlias
glyph positioned in pixel using transparency
constexpr SkScalar kTextHeight
SkCanvas::SaveLayerFlags saveLayerFlags
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 float y() const
constexpr float x() const
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)