216 {
217 if (!fSmallImage) {
219 2*kMaxTextureSize,
220 2*kMaxTextureSize);
222 kSmallSize, kSmallSize);
223 }
224
226 std::vector<SkMatrix> matrices;
227
229
230
234 m.preRotate(15.f, 0,
kBottom + kBlockSpacing);
235 m.preScale(0.71f, 1.22f);
236 matrices.push_back(
m);
237
238
240 matrices.back().mapPoints(corners, 4);
241 m.setTranslate(
std::max({corners[0].
fX, corners[1].
fX, corners[2].
fX, corners[3].
fX}),
242 (corners[0].fY + corners[1].fY + corners[2].fY + corners[3].fY) / 4);
243 m.preScale(0.2f, 0.2f);
244 matrices.push_back(
m);
245
249
251 for (bool antiAlias : {false, true}) {
257
258
259 this->
drawCase1(canvas, kCol0X, kRow0Y, antiAlias, none);
260 this->
drawCase2(canvas, kCol0X, kRow1Y, antiAlias, none);
261 this->
drawCase3(canvas, kCol0X, kRow2Y, antiAlias, none);
262 this->
drawCase4(canvas, kCol0X, kRow3Y, antiAlias, none);
263 this->
drawCase5(canvas, kCol0X, kRow4Y, antiAlias, none);
264
265
266 this->
drawCase1(canvas, kCol1X, kRow0Y, antiAlias, low);
267 this->
drawCase2(canvas, kCol1X, kRow1Y, antiAlias, low);
268 this->
drawCase3(canvas, kCol1X, kRow2Y, antiAlias, low);
269 this->
drawCase4(canvas, kCol1X, kRow3Y, antiAlias, low);
270 this->
drawCase5(canvas, kCol1X, kRow4Y, antiAlias, low);
271
272
273
274
278 this->
drawCase1(canvas, kCol2X, kRow0Y, antiAlias, high);
279 this->
drawCase2(canvas, kCol2X, kRow1Y, antiAlias, high);
280 this->
drawCase3(canvas, kCol2X, kRow2Y, antiAlias, high);
281 this->
drawCase4(canvas, kCol2X, kRow3Y, antiAlias, high);
282 this->
drawCase5(canvas, kCol2X, kRow4Y, antiAlias, high);
283 }
284
286 matrix.mapPoints(innerCorners, 4);
288 innerCorners[2].
fX, innerCorners[3].
fX});
291 }
293 }
294 }
SkAssertResult(font.textToGlyphs("Hello", 5, SkTextEncoding::kUTF8, glyphs, std::size(glyphs))==count)
constexpr SkColor SK_ColorGRAY
std::tuple< sk_sp< SkImage >, SkRect > make_ringed_image(SkCanvas *canvas, int width, int height)
void translate(SkScalar dx, SkScalar dy)
@ kStrict_SrcRectConstraint
sample only inside bounds; slower
void clear(SkColor color)
void concat(const SkMatrix &matrix)
static const SkMatrix & I()
void drawCase4(SkCanvas *canvas, int transX, int transY, bool aa, const SkSamplingOptions &sampling)
void drawCase5(SkCanvas *canvas, int transX, int transY, bool aa, const SkSamplingOptions &sampling)
void drawCase1(SkCanvas *canvas, int transX, int transY, bool aa, const SkSamplingOptions &sampling)
void drawCase3(SkCanvas *canvas, int transX, int transY, bool aa, const SkSamplingOptions &sampling)
void drawCase2(SkCanvas *canvas, int transX, int transY, bool aa, const SkSamplingOptions &sampling)
static float max(float r, float g, float b)
unsigned useCenter Optional< SkMatrix > matrix
static constexpr SkCubicResampler Mitchell()