53 {
55 matrices.
append()->setAll(1.f, 0.f, 0.f,
56 0.f, 1.f, 0.f,
57 0.f, 0.005f, 1.f);
58 matrices.
append()->setAll(1.f, 0.f, 0.f,
59 0.f, 1.f, 0.f,
60 0.007f, -0.005f, 1.f);
61 matrices[1].preSkew(0.2f, -0.1f);
62 matrices[1].preRotate(-65.f);
63 matrices[1].preScale(1.2f, .8f);
64 matrices[1].postTranslate(0.f, 60.f);
66 int n = 0;
68 for (const auto& img : fImages) {
70 for (
const auto&
m : matrices) {
72 m.mapRect(&temp, imgB);
74 }
75 }
80 kDrawImageRectStrict,
81 kDrawImageRectFast,
82 };
84 {DrawType::kDrawImage, DrawType::kDrawImageRectStrict, DrawType::kDrawImageRectFast}) {
85 for (
const auto&
m : matrices) {
86 for (auto aa : {false, true}) {
87 paint.setAntiAlias(aa);
93 for (const auto& origImage : fImages) {
95 if (img) {
99 3.f * img->
width() / 4.f, 3.f * img->
height() / 4 };
101 3.f / 4.f * img->
width(), 3.f / 4.f * img->
height()};
103 case DrawType::kDrawImage:
105 break;
106 case DrawType::kDrawImageRectStrict:
109 break;
110 case DrawType::kDrawImageRectFast:
113 break;
114 }
116 }
117 ++n;
118 if (n < 8) {
120 } else {
124 n = 0;
125 }
126 }
127 }
128 }
129 }
130 }
132 }
void translate(SkScalar dx, SkScalar dy)
@ kStrict_SrcRectConstraint
sample only inside bounds; slower
@ kFast_SrcRectConstraint
sample outside bounds; faster
void drawImageRect(const SkImage *, const SkRect &src, const SkRect &dst, const SkSamplingOptions &, const SkPaint *, SrcRectConstraint)
void concat(const SkMatrix &matrix)
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
Optional< SkRect > bounds
SkSamplingOptions sampling
SkSamplingOptions(SkFilterMode::kLinear))
static constexpr SkCubicResampler Mitchell()
static constexpr SkRect MakeEmpty()
static constexpr SkRect MakeWH(float w, float h)