Flutter Engine
The Flutter Engine
SkDraw.cpp
Go to the documentation of this file.
1/*
2 * Copyright 2006 The Android Open Source Project
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
14#include "include/core/SkRect.h"
25#include "src/base/SkTLazy.h"
27#include "src/core/SkBlitter.h"
28#include "src/core/SkDraw.h"
33#include "src/core/SkRectPriv.h"
34#include "src/core/SkScan.h"
35
36#if defined(SK_SUPPORT_LEGACY_ALPHA_BITMAP_AS_COVERAGE)
38#endif
39
40using namespace skia_private;
41
42static SkPaint make_paint_with_image(const SkPaint& origPaint, const SkBitmap& bitmap,
44 SkMatrix* matrix = nullptr) {
45 SkPaint paint(origPaint);
49 return paint;
50}
51
54}
55
56struct PtProcRec {
61
62 // computed values
65
66 typedef void (*Proc)(const PtProcRec&, const SkPoint devPts[], int count,
67 SkBlitter*);
68
69 bool init(SkCanvas::PointMode, const SkPaint&, const SkMatrix* matrix,
70 const SkRasterClip*);
71 Proc chooseProc(SkBlitter** blitter);
72
73private:
75};
76
77static void bw_pt_hair_proc(const PtProcRec& rec, const SkPoint devPts[],
78 int count, SkBlitter* blitter) {
79 for (int i = 0; i < count; i++) {
80 int x = SkScalarFloorToInt(devPts[i].fX);
81 int y = SkScalarFloorToInt(devPts[i].fY);
82 if (rec.fClip->contains(x, y)) {
83 blitter->blitH(x, y, 1);
84 }
85 }
86}
87
88static void bw_line_hair_proc(const PtProcRec& rec, const SkPoint devPts[],
89 int count, SkBlitter* blitter) {
90 for (int i = 0; i < count; i += 2) {
91 SkScan::HairLine(&devPts[i], 2, *rec.fRC, blitter);
92 }
93}
94
95static void bw_poly_hair_proc(const PtProcRec& rec, const SkPoint devPts[],
96 int count, SkBlitter* blitter) {
97 SkScan::HairLine(devPts, count, *rec.fRC, blitter);
98}
99
100// aa versions
101
102static void aa_line_hair_proc(const PtProcRec& rec, const SkPoint devPts[],
103 int count, SkBlitter* blitter) {
104 for (int i = 0; i < count; i += 2) {
105 SkScan::AntiHairLine(&devPts[i], 2, *rec.fRC, blitter);
106 }
107}
108
109static void aa_poly_hair_proc(const PtProcRec& rec, const SkPoint devPts[],
110 int count, SkBlitter* blitter) {
111 SkScan::AntiHairLine(devPts, count, *rec.fRC, blitter);
112}
113
114// square procs (strokeWidth > 0 but matrix is square-scale (sx == sy)
115
117 return {
118 center.fX - radius, center.fY - radius,
119 center.fX + radius, center.fY + radius
120 };
121}
122
123static SkXRect make_xrect(const SkRect& r) {
125 return {
128 };
129}
130
131static void bw_square_proc(const PtProcRec& rec, const SkPoint devPts[],
132 int count, SkBlitter* blitter) {
133 for (int i = 0; i < count; i++) {
134 SkRect r = make_square_rad(devPts[i], rec.fRadius);
135 if (r.intersect(rec.fClipBounds)) {
136 SkScan::FillXRect(make_xrect(r), *rec.fRC, blitter);
137 }
138 }
139}
140
141static void aa_square_proc(const PtProcRec& rec, const SkPoint devPts[],
142 int count, SkBlitter* blitter) {
143 for (int i = 0; i < count; i++) {
144 SkRect r = make_square_rad(devPts[i], rec.fRadius);
145 if (r.intersect(rec.fClipBounds)) {
146 SkScan::AntiFillXRect(make_xrect(r), *rec.fRC, blitter);
147 }
148 }
149}
150
151// If this returns true, then chooseProc() must return a valid proc
153 const SkMatrix* matrix, const SkRasterClip* rc) {
154 if ((unsigned)mode > (unsigned)SkCanvas::kPolygon_PointMode) {
155 return false;
156 }
157 if (paint.getPathEffect() || paint.getMaskFilter()) {
158 return false;
159 }
160 SkScalar width = paint.getStrokeWidth();
161 SkScalar radius = -1; // sentinel value, a "valid" value must be > 0
162
163 if (0 == width) {
164 radius = 0.5f;
165 } else if (paint.getStrokeCap() != SkPaint::kRound_Cap &&
166 matrix->isScaleTranslate() && SkCanvas::kPoints_PointMode == mode) {
169 if (SkScalarNearlyZero(sx - sy)) {
170 radius = SkScalarHalf(width * SkScalarAbs(sx));
171 }
172 }
173 if (radius > 0) {
174 SkRect clipBounds = SkRect::Make(rc->getBounds());
175 // if we return true, the caller may assume that the constructed shapes can be represented
176 // using SkFixed (after clipping), so we preflight that here.
177 if (!SkRectPriv::FitsInFixed(clipBounds)) {
178 return false;
179 }
180 fMode = mode;
181 fPaint = &paint;
182 fClip = nullptr;
183 fRC = rc;
184 fClipBounds = clipBounds;
185 fRadius = radius;
186 return true;
187 }
188 return false;
189}
190
192 Proc proc = nullptr;
193
194 SkBlitter* blitter = *blitterPtr;
195 if (fRC->isBW()) {
196 fClip = &fRC->bwRgn();
197 } else {
198 fWrapper.init(*fRC, blitter);
199 fClip = &fWrapper.getRgn();
200 blitter = fWrapper.getBlitter();
201 *blitterPtr = blitter;
202 }
203
204 // for our arrays
208 SkASSERT((unsigned)fMode <= (unsigned)SkCanvas::kPolygon_PointMode);
209
210 if (fPaint->isAntiAlias()) {
211 if (0 == fPaint->getStrokeWidth()) {
212 static const Proc gAAProcs[] = {
214 };
215 proc = gAAProcs[fMode];
216 } else if (fPaint->getStrokeCap() != SkPaint::kRound_Cap) {
218 proc = aa_square_proc;
219 }
220 } else { // BW
221 if (fRadius <= 0.5f) { // small radii and hairline
222 static const Proc gBWProcs[] = {
224 };
225 proc = gBWProcs[fMode];
226 } else {
227 proc = bw_square_proc;
228 }
229 }
230 return proc;
231}
232
233// each of these costs 8-bytes of stack space, so don't make it too large
234// must be even for lines/polygon to work
235#define MAX_DEV_PTS 32
236
238 const SkPoint pts[], const SkPaint& paint,
239 SkDevice* device) const {
240 // if we're in lines mode, force count to be even
242 count &= ~(size_t)1;
243 }
244
245 SkASSERT(pts != nullptr);
246 SkDEBUGCODE(this->validate();)
247
248 // nothing to draw
249 if (!count || fRC->isEmpty()) {
250 return;
251 }
252
253 PtProcRec rec;
254 if (!device && rec.init(mode, paint, fCTM, fRC)) {
255 SkAutoBlitterChoose blitter(*this, nullptr, paint);
256
257 SkPoint devPts[MAX_DEV_PTS];
258 SkBlitter* bltr = blitter.get();
259 PtProcRec::Proc proc = rec.chooseProc(&bltr);
260 // we have to back up subsequent passes if we're in polygon mode
261 const size_t backup = (SkCanvas::kPolygon_PointMode == mode);
262
263 do {
264 int n = SkToInt(count);
265 if (n > MAX_DEV_PTS) {
266 n = MAX_DEV_PTS;
267 }
268 fCTM->mapPoints(devPts, pts, n);
269 if (!SkIsFinite(&devPts[0].fX, n * 2)) {
270 return;
271 }
272 proc(rec, devPts, n, bltr);
273 pts += n - backup;
274 SkASSERT(SkToInt(count) >= n);
275 count -= n;
276 if (count > 0) {
277 count += backup;
278 }
279 } while (count != 0);
280 } else {
281 this->drawDevicePoints(mode, count, pts, paint, device);
282 }
283}
284
285static bool clipped_out(const SkMatrix& m, const SkRasterClip& c,
286 const SkRect& srcR) {
287 SkRect dstR;
288 m.mapRect(&dstR, srcR);
289 return c.quickReject(dstR.roundOut());
290}
291
292static bool clipped_out(const SkMatrix& matrix, const SkRasterClip& clip,
293 int width, int height) {
294 SkRect r;
295 r.setIWH(width, height);
296 return clipped_out(matrix, clip, r);
297}
298
299static bool clipHandlesSprite(const SkRasterClip& clip, int x, int y, const SkPixmap& pmap) {
300 return clip.isBW() || clip.quickContains(SkIRect::MakeXYWH(x, y, pmap.width(), pmap.height()));
301}
302
303void SkDraw::drawBitmap(const SkBitmap& bitmap, const SkMatrix& prematrix,
304 const SkRect* dstBounds, const SkSamplingOptions& sampling,
305 const SkPaint& origPaint) const {
306 SkDEBUGCODE(this->validate();)
307
308 // nothing to draw
309 if (fRC->isEmpty() ||
310 bitmap.width() == 0 || bitmap.height() == 0 ||
311 bitmap.colorType() == kUnknown_SkColorType) {
312 return;
313 }
314
316 if (origPaint.getStyle() != SkPaint::kFill_Style) {
317 paint.writable()->setStyle(SkPaint::kFill_Style);
318 }
319
320 SkMatrix matrix = *fCTM * prematrix;
321
322 if (clipped_out(matrix, *fRC, bitmap.width(), bitmap.height())) {
323 return;
324 }
325
326 if (!SkColorTypeIsAlphaOnly(bitmap.colorType()) &&
327 SkTreatAsSprite(matrix, bitmap.dimensions(), sampling, paint->isAntiAlias())) {
328 //
329 // It is safe to call lock pixels now, since we know the matrix is
330 // (more or less) identity.
331 //
332 SkPixmap pmap;
333 if (!bitmap.peekPixels(&pmap)) {
334 return;
335 }
336 int ix = SkScalarRoundToInt(matrix.getTranslateX());
337 int iy = SkScalarRoundToInt(matrix.getTranslateY());
338 if (clipHandlesSprite(*fRC, ix, iy, pmap)) {
340 // blitter will be owned by the allocator.
341 SkBlitter* blitter = SkBlitter::ChooseSprite(fDst, *paint, pmap, ix, iy, &allocator,
342 fRC->clipShader());
343 if (blitter) {
344 SkScan::FillIRect(SkIRect::MakeXYWH(ix, iy, pmap.width(), pmap.height()),
345 *fRC, blitter);
346 return;
347 }
348 // if !blitter, then we fall-through to the slower case
349 }
350 }
351
352 // now make a temp draw on the stack, and use it
353 //
354 SkDraw draw(*this);
355 draw.fCTM = &matrix;
356
357 // For a long time, the CPU backend treated A8 bitmaps as coverage, rather than alpha. This was
358 // inconsistent with the GPU backend (skbug.com/9692). When this was fixed, it altered behavior
359 // for some Android apps (b/231400686). Thus: keep the old behavior in the framework.
360#if defined(SK_SUPPORT_LEGACY_ALPHA_BITMAP_AS_COVERAGE)
361 if (bitmap.colorType() == kAlpha_8_SkColorType && !paint->getColorFilter()) {
362 draw.drawBitmapAsMask(bitmap, sampling, *paint);
363 return;
364 }
365#endif
366
367 SkPaint paintWithShader = make_paint_with_image(*paint, bitmap, sampling);
368 const SkRect srcBounds = SkRect::MakeIWH(bitmap.width(), bitmap.height());
369 if (dstBounds) {
370 this->drawRect(srcBounds, paintWithShader, &prematrix, dstBounds);
371 } else {
372 draw.drawRect(srcBounds, paintWithShader);
373 }
374}
375
376void SkDraw::drawSprite(const SkBitmap& bitmap, int x, int y, const SkPaint& origPaint) const {
377 SkDEBUGCODE(this->validate();)
378
379 // nothing to draw
380 if (fRC->isEmpty() ||
381 bitmap.width() == 0 || bitmap.height() == 0 ||
382 bitmap.colorType() == kUnknown_SkColorType) {
383 return;
384 }
385
386 const SkIRect bounds = SkIRect::MakeXYWH(x, y, bitmap.width(), bitmap.height());
387
388 if (fRC->quickReject(bounds)) {
389 return; // nothing to draw
390 }
391
392 SkPaint paint(origPaint);
393 paint.setStyle(SkPaint::kFill_Style);
394
395 SkPixmap pmap;
396 if (!bitmap.peekPixels(&pmap)) {
397 return;
398 }
399
400 if (nullptr == paint.getColorFilter() && clipHandlesSprite(*fRC, x, y, pmap)) {
401 // blitter will be owned by the allocator.
403 SkBlitter* blitter = SkBlitter::ChooseSprite(fDst, paint, pmap, x, y, &allocator,
404 fRC->clipShader());
405 if (blitter) {
406 SkScan::FillIRect(bounds, *fRC, blitter);
407 return;
408 }
409 }
410
412 SkRect r;
413
414 // get a scalar version of our rect
415 r.set(bounds);
416
417 // create shader with offset
418 matrix.setTranslate(r.fLeft, r.fTop);
420 SkDraw draw(*this);
421 draw.fCTM = &SkMatrix::I();
422 // call ourself with a rect
423 draw.drawRect(r, paintWithShader);
424}
425
426#if defined(SK_SUPPORT_LEGACY_ALPHA_BITMAP_AS_COVERAGE)
427void SkDraw::drawDevMask(const SkMask& srcM, const SkPaint& paint) const {
428 if (srcM.fBounds.isEmpty()) {
429 return;
430 }
431
432 const SkMask* mask = &srcM;
433
434 SkMaskBuilder dstM;
435 if (paint.getMaskFilter() &&
436 as_MFB(paint.getMaskFilter())->filterMask(&dstM, srcM, *fCTM, nullptr)) {
437 mask = &dstM;
438 }
439 SkAutoMaskFreeImage ami(dstM.image());
440
441 SkAutoBlitterChoose blitterChooser(*this, nullptr, paint);
442 SkBlitter* blitter = blitterChooser.get();
443
445 const SkRegion* clipRgn;
446
447 if (fRC->isBW()) {
448 clipRgn = &fRC->bwRgn();
449 } else {
450 wrapper.init(*fRC, blitter);
451 clipRgn = &wrapper.getRgn();
452 blitter = wrapper.getBlitter();
453 }
454 blitter->blitMaskRegion(*mask, *clipRgn);
455}
456
457void SkDraw::drawBitmapAsMask(const SkBitmap& bitmap, const SkSamplingOptions& sampling,
458 const SkPaint& paint) const {
459 SkASSERT(bitmap.colorType() == kAlpha_8_SkColorType);
460
461 // nothing to draw
462 if (fRC->isEmpty()) {
463 return;
464 }
465
466 if (SkTreatAsSprite(*fCTM, bitmap.dimensions(), sampling, paint.isAntiAlias()))
467 {
470
471 SkPixmap pmap;
472 if (!bitmap.peekPixels(&pmap)) {
473 return;
474 }
475 SkMask mask(pmap.addr8(0, 0),
476 SkIRect::MakeXYWH(ix, iy, pmap.width(), pmap.height()),
477 SkToU32(pmap.rowBytes()),
479
480 this->drawDevMask(mask, paint);
481 } else { // need to xform the bitmap first
482 SkRect r;
483 SkMaskBuilder mask;
484
485 r.setIWH(bitmap.width(), bitmap.height());
486 fCTM->mapRect(&r);
487 r.round(&mask.bounds());
488
489 // set the mask's bounds to the transformed bitmap-bounds,
490 // clipped to the actual device and further limited by the clip bounds
491 {
493 SkIRect devBounds = fDst.bounds();
494 devBounds.intersect(fRC->getBounds().makeOutset(1, 1));
495 // need intersect(l, t, r, b) on irect
496 if (!mask.bounds().intersect(devBounds)) {
497 return;
498 }
499 }
500
501 mask.format() = SkMask::kA8_Format;
502 mask.rowBytes() = SkAlign4(mask.fBounds.width());
503 size_t size = mask.computeImageSize();
504 if (0 == size) {
505 // the mask is too big to allocated, draw nothing
506 return;
507 }
508
509 // allocate (and clear) our temp buffer to hold the transformed bitmap
510 AutoTMalloc<uint8_t> storage(size);
511 mask.image() = storage.get();
512 memset(mask.image(), 0, size);
513
514 // now draw our bitmap(src) into mask(dst), transformed by the matrix
515 {
517 device.installPixels(SkImageInfo::MakeA8(mask.fBounds.width(), mask.fBounds.height()),
518 mask.image(), mask.fRowBytes);
519
520 SkCanvas c(device);
521 // need the unclipped top/left for the translate
522 c.translate(-SkIntToScalar(mask.fBounds.fLeft),
523 -SkIntToScalar(mask.fBounds.fTop));
524 c.concat(*fCTM);
525
526 // We can't call drawBitmap, or we'll infinitely recurse. Instead
527 // we manually build a shader and draw that into our new mask
528 SkPaint tmpPaint;
529 tmpPaint.setAntiAlias(paint.isAntiAlias());
530 tmpPaint.setDither(paint.isDither());
531 SkPaint paintWithShader = make_paint_with_image(tmpPaint, bitmap, sampling);
532 SkRect rr;
533 rr.setIWH(bitmap.width(), bitmap.height());
534 c.drawRect(rr, paintWithShader);
535 }
536 this->drawDevMask(mask, paint);
537 }
538}
539#endif
int count
Definition: FontMgrTest.cpp:50
static constexpr T SkAlign4(T x)
Definition: SkAlign.h:16
#define SkASSERT(cond)
Definition: SkAssert.h:116
@ kAlpha_8_SkColorType
pixel with alpha in 8-bit byte
Definition: SkColorType.h:21
@ kUnknown_SkColorType
uninitialized
Definition: SkColorType.h:20
static void aa_poly_hair_proc(const PtProcRec &rec, const SkPoint devPts[], int count, SkBlitter *blitter)
Definition: SkDraw.cpp:109
#define MAX_DEV_PTS
Definition: SkDraw.cpp:235
static bool clipHandlesSprite(const SkRasterClip &clip, int x, int y, const SkPixmap &pmap)
Definition: SkDraw.cpp:299
static void bw_pt_hair_proc(const PtProcRec &rec, const SkPoint devPts[], int count, SkBlitter *blitter)
Definition: SkDraw.cpp:77
static SkPaint make_paint_with_image(const SkPaint &origPaint, const SkBitmap &bitmap, const SkSamplingOptions &sampling, SkMatrix *matrix=nullptr)
Definition: SkDraw.cpp:42
static void bw_line_hair_proc(const PtProcRec &rec, const SkPoint devPts[], int count, SkBlitter *blitter)
Definition: SkDraw.cpp:88
static bool clipped_out(const SkMatrix &m, const SkRasterClip &c, const SkRect &srcR)
Definition: SkDraw.cpp:285
static void aa_line_hair_proc(const PtProcRec &rec, const SkPoint devPts[], int count, SkBlitter *blitter)
Definition: SkDraw.cpp:102
static SkXRect make_xrect(const SkRect &r)
Definition: SkDraw.cpp:123
static void bw_square_proc(const PtProcRec &rec, const SkPoint devPts[], int count, SkBlitter *blitter)
Definition: SkDraw.cpp:131
static void aa_square_proc(const PtProcRec &rec, const SkPoint devPts[], int count, SkBlitter *blitter)
Definition: SkDraw.cpp:141
static void bw_poly_hair_proc(const PtProcRec &rec, const SkPoint devPts[], int count, SkBlitter *blitter)
Definition: SkDraw.cpp:95
static SkRect make_square_rad(SkPoint center, SkScalar radius)
Definition: SkDraw.cpp:116
#define SkScalarToFixed(x)
Definition: SkFixed.h:125
static bool SkIsFinite(T x, Pack... values)
static bool SkColorTypeIsAlphaOnly(SkColorType ct)
@ kNever_SkCopyPixelsMode
never copy src pixels (even if they are marked mutable)
Definition: SkImagePriv.h:20
sk_sp< SkShader > SkMakeBitmapShaderForPaint(const SkPaint &paint, const SkBitmap &src, SkTileMode, SkTileMode, const SkSamplingOptions &, const SkMatrix *localMatrix, SkCopyPixelsMode)
SkMaskFilterBase * as_MFB(SkMaskFilter *mf)
std::unique_ptr< uint8_t, SkFunctionObject< SkMaskBuilder::FreeImage > > SkAutoMaskFreeImage
Definition: SkMask.h:316
bool SkTreatAsSprite(const SkMatrix &mat, const SkISize &size, const SkSamplingOptions &sampling, bool isAntiAlias)
Definition: SkMatrix.cpp:1614
static SkPath clip(const SkPath &path, const SkHalfPlane &plane)
Definition: SkPath.cpp:3892
static bool SkScalarNearlyZero(SkScalar x, SkScalar tolerance=SK_ScalarNearlyZero)
Definition: SkScalar.h:101
#define SkScalarHalf(a)
Definition: SkScalar.h:75
#define SkScalarRoundToInt(x)
Definition: SkScalar.h:37
#define SkIntToScalar(x)
Definition: SkScalar.h:57
#define SkScalarFloorToInt(x)
Definition: SkScalar.h:35
#define SkScalarAbs(x)
Definition: SkScalar.h:39
SkDEBUGCODE(SK_SPI) SkThreadID SkGetThreadID()
constexpr int SkToInt(S x)
Definition: SkTo.h:29
constexpr uint32_t SkToU32(S x)
Definition: SkTo.h:26
static SkScalar center(float pos0, float pos1)
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition: aaclip.cpp:27
void init(const SkRasterClip &, SkBlitter *)
const SkRegion & getRgn() const
Definition: SkRasterClip.h:175
SkBlitter * getBlitter()
Definition: SkRasterClip.h:179
SkBlitter * get() const
int width() const
Definition: SkBitmap.h:149
static SkBlitter * ChooseSprite(const SkPixmap &dst, const SkPaint &, const SkPixmap &src, int left, int top, SkArenaAlloc *, sk_sp< SkShader > clipShader)
static SkBlitter * Choose(const SkPixmap &dst, const SkMatrix &ctm, const SkPaint &paint, SkArenaAlloc *, bool drawCoverage, sk_sp< SkShader > clipShader, const SkSurfaceProps &props)
Definition: SkBlitter.cpp:685
virtual void blitH(int x, int y, int width)=0
Blit a horizontal run of one or more pixels.
@ kLines_PointMode
draw each pair of points as a line segment
Definition: SkCanvas.h:1242
@ kPolygon_PointMode
draw the array of points as a open polygon
Definition: SkCanvas.h:1243
@ kPoints_PointMode
draw each point separately
Definition: SkCanvas.h:1241
BlitterChooser * fBlitterChooser
Definition: SkDrawBase.h:154
const SkRasterClip * fRC
Definition: SkDrawBase.h:156
void drawRect(const SkRect &prePaintRect, const SkPaint &, const SkMatrix *paintMatrix, const SkRect *postPaintRect) const
Definition: SkDrawBase.cpp:159
SkPixmap fDst
Definition: SkDrawBase.h:153
void validate() const
Definition: SkDrawBase.h:162
const SkMatrix * fCTM
Definition: SkDrawBase.h:155
void drawDevicePoints(SkCanvas::PointMode, size_t count, const SkPoint[], const SkPaint &, SkDevice *) const
Definition: SkDrawBase.cpp:597
Definition: SkDraw.h:38
SkDraw()
Definition: SkDraw.cpp:52
void drawPoints(SkCanvas::PointMode, size_t count, const SkPoint[], const SkPaint &, SkDevice *) const
Definition: SkDraw.cpp:237
void drawSprite(const SkBitmap &, int x, int y, const SkPaint &) const
Definition: SkDraw.cpp:376
void drawBitmap(const SkBitmap &, const SkMatrix &, const SkRect *dstOrNull, const SkSamplingOptions &, const SkPaint &) const override
Definition: SkDraw.cpp:303
virtual bool filterMask(SkMaskBuilder *dst, const SkMask &src, const SkMatrix &, SkIPoint *margin) const =0
static constexpr int kMScaleX
horizontal scale factor
Definition: SkMatrix.h:353
SkScalar getTranslateY() const
Definition: SkMatrix.h:452
void mapPoints(SkPoint dst[], const SkPoint src[], int count) const
Definition: SkMatrix.cpp:770
static const SkMatrix & I()
Definition: SkMatrix.cpp:1544
static constexpr int kMScaleY
vertical scale factor
Definition: SkMatrix.h:357
bool mapRect(SkRect *dst, const SkRect &src, SkApplyPerspectiveClip pc=SkApplyPerspectiveClip::kYes) const
Definition: SkMatrix.cpp:1141
SkScalar getTranslateX() const
Definition: SkMatrix.h:445
@ kRound_Cap
adds circle
Definition: SkPaint.h:335
Style getStyle() const
Definition: SkPaint.h:204
void setAntiAlias(bool aa)
Definition: SkPaint.h:170
void setDither(bool dither)
Definition: SkPaint.h:182
@ kFill_Style
set to fill geometry
Definition: SkPaint.h:193
bool isAntiAlias() const
Definition: SkPaint.h:162
SkScalar getStrokeWidth() const
Definition: SkPaint.h:300
Cap getStrokeCap() const
Definition: SkPaint.h:372
const uint8_t * addr8() const
Definition: SkPixmap.h:326
SkIRect bounds() const
Definition: SkPixmap.h:207
size_t rowBytes() const
Definition: SkPixmap.h:145
int width() const
Definition: SkPixmap.h:160
int height() const
Definition: SkPixmap.h:166
const SkIRect & getBounds() const
Definition: SkRasterClip.h:60
const SkRegion & bwRgn() const
Definition: SkRasterClip.h:44
sk_sp< SkShader > clipShader() const
Definition: SkRasterClip.h:95
bool isBW() const
Definition: SkRasterClip.h:42
bool isEmpty() const
Definition: SkRasterClip.h:47
bool quickReject(const SkIRect &rect) const
Definition: SkRasterClip.h:85
static bool FitsInFixed(const SkRect &r)
Definition: SkRectPriv.h:56
bool contains(int32_t x, int32_t y) const
Definition: SkRegion.cpp:364
static void HairLine(const SkPoint[], int count, const SkRasterClip &, SkBlitter *)
static void FillXRect(const SkXRect &, const SkRasterClip &, SkBlitter *)
Definition: SkScan.cpp:80
static void AntiHairLine(const SkPoint[], int count, const SkRasterClip &, SkBlitter *)
static void FillIRect(const SkIRect &, const SkRasterClip &, SkBlitter *)
Definition: SkScan.cpp:65
static void AntiFillXRect(const SkXRect &, const SkRasterClip &, SkBlitter *)
const Paint & paint
Definition: color_source.cc:38
VkDevice device
Definition: main.cc:53
float SkScalar
Definition: extension.cpp:12
double y
double x
unsigned useCenter Optional< SkMatrix > matrix
Definition: SkRecords.h:258
Optional< SkRect > bounds
Definition: SkRecords.h:189
SkSamplingOptions sampling
Definition: SkRecords.h:337
Definition: bitmap.py:1
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 mode
Definition: switches.h:228
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
Definition: switches.h:259
SkSamplingOptions(SkFilterMode::kLinear))
int32_t height
int32_t width
const SkPaint * fPaint
Definition: SkDraw.cpp:58
void(* Proc)(const PtProcRec &, const SkPoint devPts[], int count, SkBlitter *)
Definition: SkDraw.cpp:66
const SkRasterClip * fRC
Definition: SkDraw.cpp:60
SkScalar fRadius
Definition: SkDraw.cpp:64
bool init(SkCanvas::PointMode, const SkPaint &, const SkMatrix *matrix, const SkRasterClip *)
Definition: SkDraw.cpp:152
Proc chooseProc(SkBlitter **blitter)
Definition: SkDraw.cpp:191
SkRect fClipBounds
Definition: SkDraw.cpp:63
const SkRegion * fClip
Definition: SkDraw.cpp:59
SkCanvas::PointMode fMode
Definition: SkDraw.cpp:57
Definition: SkRect.h:32
SkIRect makeOutset(int32_t dx, int32_t dy) const
Definition: SkRect.h:350
bool intersect(const SkIRect &r)
Definition: SkRect.h:513
constexpr int32_t height() const
Definition: SkRect.h:165
int32_t fTop
smaller y-axis bounds
Definition: SkRect.h:34
constexpr int32_t width() const
Definition: SkRect.h:158
bool isEmpty() const
Definition: SkRect.h:202
static constexpr SkIRect MakeXYWH(int32_t x, int32_t y, int32_t w, int32_t h)
Definition: SkRect.h:104
int32_t fLeft
smaller x-axis bounds
Definition: SkRect.h:33
bool contains(int32_t x, int32_t y) const
Definition: SkRect.h:463
static SkImageInfo MakeA8(int width, int height)
Format & format()
Definition: SkMask.h:239
uint32_t & rowBytes()
Definition: SkMask.h:238
SkIRect & bounds()
Definition: SkMask.h:237
uint8_t *& image()
Definition: SkMask.h:236
Definition: SkMask.h:25
const uint32_t fRowBytes
Definition: SkMask.h:43
@ kA8_Format
8bits per pixel mask (e.g. antialiasing)
Definition: SkMask.h:28
const SkIRect fBounds
Definition: SkMask.h:42
size_t computeImageSize() const
Definition: SkMask.cpp:30
static SkRect Make(const SkISize &size)
Definition: SkRect.h:669
SkScalar fBottom
larger y-axis bounds
Definition: extension.cpp:17
bool intersect(const SkRect &r)
Definition: SkRect.cpp:114
SkScalar fLeft
smaller x-axis bounds
Definition: extension.cpp:14
static SkRect MakeIWH(int w, int h)
Definition: SkRect.h:623
SkScalar fRight
larger x-axis bounds
Definition: extension.cpp:16
void roundOut(SkIRect *dst) const
Definition: SkRect.h:1241
void round(SkIRect *dst) const
Definition: SkRect.h:1228
void setIWH(int32_t width, int32_t height)
Definition: SkRect.h:950
void set(const SkIRect &src)
Definition: SkRect.h:849
SkScalar fTop
smaller y-axis bounds
Definition: extension.cpp:15