74#define RETURN_ON_NULL(ptr) do { if (nullptr == (ptr)) return; } while (0)
75#define RETURN_ON_FALSE(pred) do { if (!(pred)) return; } while (0)
98 auto overrideOpacity = (
flags & PredrawFlags::kOpaqueShaderOverride) ?
100 (
flags & PredrawFlags::kNonOpaqueShaderOverride) ?
110 const SkDevice* top = this->topDevice();
114 if (!
root->isClipWideOpen()) {
137 if (
paint->getMaskFilter() ||
paint->getPathEffect() ||
paint->getImageFilter()) {
146bool SkCanvas::predrawNotify(
bool willOverwritesEntireSurface) {
148 if (!fSurfaceBase->aboutToDraw(willOverwritesEntireSurface
165 if (fSurfaceBase->outstandingImageSnapshot()) {
170 if (!fSurfaceBase->aboutToDraw(
mode)) {
180 FilterSpan imageFilters,
184 , fImageFilters(imageFilters.
data(), imageFilters.
size())
186 , fIsCoverage(isCoverage)
195 :fImage(img), fLoc(loc) {}
196SkCanvas::BackImage::BackImage(
const BackImage&) =
default;
197SkCanvas::BackImage::BackImage(BackImage&&) =
default;
198SkCanvas::BackImage& SkCanvas::BackImage::operator=(
const BackImage&) =
default;
199SkCanvas::BackImage::~BackImage() =
default;
209SkCanvas::MCRec::~MCRec() {}
214 bool layerIsCoverage) {
217 std::make_unique<Layer>(std::move(layerDevice), filters, restorePaint, layerIsCoverage);
218 fDevice = fLayer->fDevice.get();
234 fCanvas->validateClip();
237 fCanvas->fQuickRejectBounds = fCanvas->computeDeviceClipBounds();
239 fCanvas->validateClip();
253std::optional<AutoLayerForImageFilter> SkCanvas::aboutToDraw(
257 if (
flags & PredrawFlags::kCheckForOverwrite) {
258 if (!this->predrawNotify(rawBounds, &
paint,
flags)) {
262 if (!this->predrawNotify()) {
268 const bool skipMaskFilterLayer = (
flags & PredrawFlags::kSkipMaskFilterAutoLayer) ||
270 return std::optional<AutoLayerForImageFilter>(
271 std::in_place,
this,
paint, rawBounds, skipMaskFilterLayer);
274std::optional<AutoLayerForImageFilter> SkCanvas::aboutToDraw(
276 const SkRect* rawBounds) {
277 return this->aboutToDraw(
paint, rawBounds, PredrawFlags::kNone);
290 fRootDevice = sk_make_sp<SkNoPixelsDevice>(
bounds,
295 fMCRec->reset(fRootDevice.
get());
296 fQuickRejectBounds = this->computeDeviceClipBounds();
303 static_assert(
sizeof(MCRec) <= kMCRecSize);
318 fSurfaceBase =
nullptr;
319 fRootDevice = std::move(
device);
320 fScratchGlyphRunBuilder = std::make_unique<sktext::GlyphRunBuilder>();
321 fQuickRejectBounds = this->computeDeviceClipBounds();
329 : fMCStack(sizeof(MCRec), fMCRecStorage, sizeof(fMCRecStorage))
331 this->init(sk_make_sp<SkNoPixelsDevice>(
336 : fMCStack(sizeof(MCRec), fMCRecStorage, sizeof(fMCRecStorage)) {
338 this->init(sk_make_sp<SkNoPixelsDevice>(r, fProps));
342 : fMCStack(sizeof(MCRec), fMCRecStorage, sizeof(fMCRecStorage))
343 , fProps(
device->surfaceProps()) {
344 this->init(std::move(
device));
351 MCRec* rec = (MCRec*)iter.
next();
356 rec->fLayer->fDiscard =
true;
362 this->internalRestore();
373SkDevice* SkCanvas::topDevice()
const {
375 return fMCRec->fDevice;
383 return this->
readPixels({ dstInfo, dstP, rowBytes},
x,
y);
393 if (
bitmap.peekPixels(&pm)) {
406 if (!srcRect.
intersect({0, 0, device->width(), device->height()})) {
411 const bool completeOverwrite = srcRect.
size() ==
device->imageInfo().dimensions();
412 if (!this->predrawNotify(completeOverwrite)) {
420 return device->writePixels({srcInfo, pixels, rowBytes},
x,
y);
425void SkCanvas::checkForDeferredSave() {
426 if (fMCRec->fDeferredSaveCount > 0) {
436 const MCRec* rec = (
const MCRec*)iter.
next();
440 count += 1 + rec->fDeferredSaveCount;
449 fMCRec->fDeferredSaveCount += 1;
453void SkCanvas::doSave() {
456 SkASSERT(fMCRec->fDeferredSaveCount > 0);
457 fMCRec->fDeferredSaveCount -= 1;
458 this->internalSave();
462 if (fMCRec->fDeferredSaveCount > 0) {
465 fMCRec->fDeferredSaveCount -= 1;
468 if (fMCStack.
count() > 1) {
472 this->internalRestore();
485 for (
int i = 0;
i < n; ++
i) {
490void SkCanvas::internalSave() {
491 fMCRec =
new (fMCStack.
push_back()) MCRec(fMCRec);
509 this->internalSaveLayer(rec, strategy);
514int SkCanvas::only_axis_aligned_saveBehind(
const SkRect*
bounds) {
522 this->internalSave();
524 this->internalSaveBehind(
bounds);
539 if (!contentBounds) {
567static std::optional<std::pair<skif::Mapping, skif::LayerSpace<SkIRect>>>
576 !localToDst.
invert(&dstToLocal)) {
589 capability =
std::min(capability,
as_IFB(filter)->getCTMCapability());
597 if (scaleFactor != 1.0f &&
607 static const int kMinDimThreshold = 2048;
609 SkIRect(targetOutput).height64())),
617 if (!baseLayerBounds.intersect(knownBounds)) {
623 if (!filters.empty()) {
625 return filters[i] ? as_IFB(filters[i])
626 ->getInputBounds(mapping, targetOutput, contentBounds)
631 if (layerBounds.
width() > maxLayerDim || layerBounds.
height() > maxLayerDim) {
636 idealMapping, targetOutput, contentBounds);
638 idealLayerBounds.height()),
644 if (baseLayerBounds.isEmpty()) {
647 layerBounds = baseLayerBounds;
650 if (layerBounds.
width() > maxLayerDim || layerBounds.
height() > maxLayerDim) {
660 layerBounds = newLayerBounds;
664 return std::make_pair(mapping, layerBounds);
675 return kN32_SkColorType;
687 if (
paint.getAlphaf() < 1.f) {
692 if (
paint.getColorFilter()) {
698void SkCanvas::internalDrawDeviceWithFilter(
SkDevice*
src,
702 DeviceCompatibleWithFilter compat,
705 bool srcIsCoverageLayer) {
730 if (compat == DeviceCompatibleWithFilter::kYes) {
742 dst->getRelativeTransform(*
src),
750 filters,
dst->localToDevice(), outputBounds, {},
SkTPin(scaleFactor, 0.f, 1.f));
751 if (!mappingAndBounds) {
755 std::tie(mapping, requiredInput) = *mappingAndBounds;
757 if (!requiredInput.
isEmpty()) {
762 if (!localToSrc.
invert(&srcToLocal)) {
775 auto backend =
dst->createImageFilteringBackend(
src ?
src->surfaceProps() :
dst->surfaceProps(),
782 filterColorSpace.
get(),
786 if (
src && !requiredInput.isEmpty()) {
793 ctx.markNewSurface();
798 if (
SkMatrix(srcToLayer).isScaleTranslate()) {
802 auto requiredSubset = srcToLayer.
mapRect(availSrc);
803 if (requiredSubset.width() == availSrc.width() &&
804 requiredSubset.height() == availSrc.height()) {
809 SkASSERT(compat == DeviceCompatibleWithFilter::kUnknown);
811 SkISize(requiredSubset.size())),
812 requiredSubset.topLeft()};
813 ctx.markNewSurface();
817 if (compat == DeviceCompatibleWithFilter::kYes) {
820 if (!filters.empty()) {
827 }
else if (!requiredInput.isEmpty()) {
836 source =
source.applyCrop(ctx.withNewDesiredOutput(srcSubset),
845 ctx = ctx.withNewDesiredOutput(mapping.
deviceToLayer(outputBounds))
855 if (srcIsCoverageLayer) {
856 SkASSERT(
dst->useDrawCoverageMaskForMaskFilters());
859 auto [coverageMask, origin] =
result.imageAndOffset(ctx);
862 deviceMatrixWithOffset.
preTranslate(origin.x(), origin.y());
863 dst->drawCoverageMask(
864 coverageMask.get(), deviceMatrixWithOffset,
result.sampling(),
paint);
875void SkCanvas::internalSaveLayer(
const SaveLayerRec& rec,
876 SaveLayerStrategy strategy,
881 this->internalSave();
912 bool filtersPriorDevice = rec.fBackdrop;
913#if !defined(SK_LEGACY_INITWITHPREV_LAYER_SIZING)
919 (!filters.empty() || cf || blender || restorePaint.
getAlphaf() < 1.f));
927 const bool drawDeviceMustFillClip = filters.empty() &&
930 const bool trivialRestore = !filtersPriorDevice && !drawDeviceMustFillClip;
933 SkDevice* priorDevice = this->topDevice();
938 std::optional<skif::ParameterSpace<SkRect>> contentBounds;
940 if (rec.fBounds && trivialRestore) {
945 filters, priorDevice->
localToDevice(), outputBounds, contentBounds);
947 auto abortLayer = [
this]() {
951 AutoUpdateQRBounds aqr(
this);
955 if (!mappingAndBounds) {
960 std::tie(newLayerMapping, layerBounds) = *mappingAndBounds;
970 if (rec.fColorSpace) {
973 this->internalDrawDeviceWithFilter(
nullptr, priorDevice, filters, restorePaint,
974 DeviceCompatibleWithFilter::kUnknown,
987 if (!filters.empty()) {
1011 rec.fColorSpace ?
sk_ref_sp(rec.fColorSpace)
1019 newDevice = priorDevice->
createDevice(createInfo, rec.fPaint);
1030 fProps, this->imageInfo().refColorSpace());
1031 initBackdrop =
false;
1036 if (!filters.empty()) {
1060 bool scaleBackdrop = rec.fExperimentalBackdropScale != 1.0f;
1061 auto compat = (!filters.empty() || rec.fBackdrop || scaleBackdrop)
1062 ? DeviceCompatibleWithFilter::kUnknown : DeviceCompatibleWithFilter::kYes;
1064 this->internalDrawDeviceWithFilter(priorDevice,
1070 rec.fExperimentalBackdropScale);
1073 fMCRec->newLayer(std::move(newDevice), filters, restorePaint, coverageOnly);
1074 fQuickRejectBounds = this->computeDeviceClipBounds();
1078 if (alpha >= 1.0f) {
1079 return this->
saveLayer(bounds,
nullptr);
1083 return this->
saveLayer(bounds, &tmpPaint);
1087void SkCanvas::internalSaveBehind(
const SkRect* localBounds) {
1095 device->localToDevice().mapRect(&tmp, *localBounds);
1100 devBounds =
device->devClipBounds();
1110 auto backImage =
device->snapSpecial(devBounds,
true);
1116 this->checkForDeferredSave();
1118 fMCRec->fBackImage =
1119 std::make_unique<BackImage>(BackImage{std::move(backImage), devBounds.
topLeft()});
1123 this->drawClippedToSaveBehind(
paint);
1126void SkCanvas::internalRestore() {
1130 std::unique_ptr<Layer> layer = std::move(fMCRec->fLayer);
1131 std::unique_ptr<BackImage> backImage = std::move(fMCRec->fBackImage);
1136 fMCRec = (MCRec*) fMCStack.
back();
1149 this->topDevice()->
drawSpecial(backImage->fImage.get(),
1157 if (layer && !layer->fDevice->isNoPixelsDevice() && !layer->fDiscard) {
1158 layer->fDevice->setImmutable();
1162 if (this->predrawNotify()) {
1163 SkDevice* dstDev = this->topDevice();
1164 if (!layer->fImageFilters.empty()) {
1165 this->internalDrawDeviceWithFilter(layer->fDevice.get(),
1167 layer->fImageFilters,
1169 DeviceCompatibleWithFilter::kYes,
1170 layer->fDevice->imageInfo().colorInfo(),
1172 layer->fIsCoverage);
1185 if (this->
getSaveCount() < fClipRestrictionSaveCount) {
1187 fClipRestrictionSaveCount = -1;
1191 fQuickRejectBounds = this->computeDeviceClipBounds();
1192 this->validateClip();
1196 if (
nullptr == props) {
1263 if (this->topDevice()->isPixelAlignedToGlobal()) {
1264 *origin = this->topDevice()->
getOrigin();
1280 this->checkForDeferredSave();
1281 fMCRec->fMatrix.preTranslate(
dx, dy);
1290 if (sx != 1 || sy != 1) {
1291 this->checkForDeferredSave();
1292 fMCRec->fMatrix.preScale(sx, sy);
1302 m.setRotate(degrees);
1308 m.setRotate(degrees, px, py);
1319 if (
matrix.isIdentity()) {
1325void SkCanvas::internalConcat44(
const SkM44&
m) {
1326 this->checkForDeferredSave();
1328 fMCRec->fMatrix.preConcat(
m);
1334 this->internalConcat44(
m);
1339void SkCanvas::internalSetMatrix(
const SkM44&
m) {
1340 fMCRec->fMatrix =
m;
1350 this->checkForDeferredSave();
1351 this->internalSetMatrix(
m);
1362 if (!
rect.isFinite()) {
1365 this->checkForDeferredSave();
1401 SkASSERT(this->topDevice() == this->rootDevice());
1403 SkASSERT(fClipRestrictionSaveCount < 0 && fClipRestrictionRect.
isEmpty());
1405 if (fClipRestrictionSaveCount < 0 && !
rect.isEmpty()) {
1406 fClipRestrictionRect =
rect;
1411 this->checkForDeferredSave();
1419void SkCanvas::internal_private_resetClip() {
1420 this->checkForDeferredSave();
1426 if (fClipRestrictionSaveCount >= 0 && this->topDevice() == this->rootDevice()) {
1430 if (!deviceRestriction.
intersect(fClipRestrictionRect)) {
1436 this->topDevice()->
replaceClip(deviceRestriction);
1440 this->checkForDeferredSave();
1457 this->checkForDeferredSave();
1460 if (!
path.isInverseFillType() && fMCRec->fMatrix.asM33().rectStaysRect()) {
1462 if (
path.isRect(&r)) {
1467 if (
path.isOval(&r)) {
1490 if (
sh->isOpaque()) {
1499 this->checkForDeferredSave();
1511 this->checkForDeferredSave();
1520void SkCanvas::validateClip()
const {
1522 SkRect tmp = this->computeDeviceClipBounds();
1526 SkASSERT(tmp == fQuickRejectBounds);
1531bool SkCanvas::androidFramework_isClipAA()
const {
1539 device->android_utils_clipAsRgn(rgn);
1541 if (origin.
x() | origin.
y()) {
1560 this->validateClip();
1573 if (!
bounds.isFinite() ||
paint.nothingToDraw()) {
1577 if (
paint.canComputeFastBounds()) {
1594 if (!fMCRec->fMatrix.asM33().invert(&inverse)) {
1600 const int margin = 1;
1608 return this->computeDeviceClipBounds(
false).
roundOut();
1611SkRect SkCanvas::computeDeviceClipBounds(
bool outsetForAA)
const {
1612 const SkDevice* dev = this->topDevice();
1621 devClipBounds.
outset(1.f, 1.f);
1623 return devClipBounds;
1630 return fMCRec->fMatrix.asM33();
1634 return fMCRec->fMatrix;
1642 return this->topDevice()->
recorder();
1680void SkCanvas::drawClippedToSaveBehind(
const SkPaint&
paint) {
1727#ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
1790 if (
dst.isEmpty()) {
1795 Lattice latticePlusBounds = lattice;
1796 if (!latticePlusBounds.
fBounds) {
1839 if (!this->predrawNotify()) {
1862 if (
paint &&
paint->getImageFilter() && cnt == 1) {
1863 const auto& entry = imageSet[0];
1870 if (!entry.fHasClip && canMapDstRect) {
1872 if (entry.fMatrixIndex >= 0) {
1895 this->internalDrawPaint(
paint);
1898void SkCanvas::internalDrawPaint(
const SkPaint&
paint) {
1901 if (
paint.nothingToDraw() || this->isClipEmpty()) {
1905 auto layer = this->aboutToDraw(
paint,
nullptr, PredrawFlags::kCheckForOverwrite);
1907 this->topDevice()->
drawPaint(layer->paint());
1913 if ((
long)
count <= 0 ||
paint.nothingToDraw()) {
1921 bounds.set(pts[0], pts[1]);
1929 if (this->internalQuickReject(
bounds, strokePaint)) {
1933 auto layer = this->aboutToDraw(strokePaint, &
bounds);
1940 if (
paint.getPathEffect()) {
1960 return blurMaskFilter;
1963std::optional<AutoLayerForImageFilter> SkCanvas::attemptBlurredRRectDraw(
1965 SkASSERT(!(
flags & PredrawFlags::kSkipMaskFilterAutoLayer));
1968 if (!this->topDevice()->useDrawCoverageMaskForMaskFilters()) {
1981 if (!blurMaskFilter) {
1986 auto layer = this->aboutToDraw(
paint, &
bounds,
flags | PredrawFlags::kSkipMaskFilterAutoLayer);
1989 return std::nullopt;
1993 if (this->topDevice()->drawBlurredRRect(
rrect, layer->paint(), deviceSigma)) {
1995 return std::nullopt;
2000 layer->addMaskFilterLayer(&
bounds);
2006 if (this->internalQuickReject(r,
paint)) {
2011 std::optional<AutoLayerForImageFilter> layer = this->attemptBlurredRRectDraw(
2015 this->topDevice()->
drawRect(r, layer->paint());
2040 const MCRec* rec = (
const MCRec*)iter.
prev();
2044 if (rec->fBackImage) {
2049 rec->fBackImage->fImage->width(),
2050 rec->fBackImage->fImage->height());
2067 auto layer = this->aboutToDraw(
paint);
2069 this->topDevice()->
drawPaint(layer->paint());
2077 if (this->internalQuickReject(
oval,
paint)) {
2082 std::optional<AutoLayerForImageFilter> layer =
2094 if (this->internalQuickReject(
oval,
paint)) {
2098 auto layer = this->aboutToDraw(
paint, &
oval);
2124 std::optional<AutoLayerForImageFilter> layer =
2125 this->attemptBlurredRRectDraw(
rrect,
paint, PredrawFlags::kNone);
2140 this->topDevice()->
drawDRRect(outer, inner, layer->paint());
2145 if (!
path.isFinite()) {
2150 if (!
path.isInverseFillType() && this->internalQuickReject(pathBounds,
paint)) {
2153 if (
path.isInverseFillType() && pathBounds.
width() <= 0 && pathBounds.
height() <= 0) {
2154 this->internalDrawPaint(
paint);
2158 auto layer = this->aboutToDraw(
paint,
path.isInverseFillType() ?
nullptr : &pathBounds);
2179 paint.setMaskFilter(
nullptr);
2180 paint.setPathEffect(
nullptr);
2210 if (this->internalQuickReject(
dst, realPaint)) {
2214 if (this->topDevice()->shouldDrawAsTiledImageRect()) {
2215 if (this->topDevice()->drawAsTiledImageRect(
2216 this,
image, &
src,
dst, realSampling, realPaint, constraint)) {
2243 if (!mappingAndBounds) {
2246 if (!this->predrawNotify()) {
2256 auto [mapping, srcBounds] = *mappingAndBounds;
2262 device->imageInfo().colorSpace(),
2273 ctx = ctx.withNewDesiredOutput(mapping.
deviceToLayer(outputBounds))
2277 stats.reportStats();
2283 if (realPaint.
getMaskFilter() && this->topDevice()->useDrawCoverageMaskForMaskFilters()) {
2291 this->
drawRect(drawDst, realPaint);
2296 auto layer = this->aboutToDraw(realPaint, &
dst,
2297 PredrawFlags::kCheckForOverwrite |
2299 : PredrawFlags::kNonOpaqueShaderOverride));
2310 if (this->internalQuickReject(
dst, realPaint)) {
2314 auto layer = this->aboutToDraw(realPaint, &
dst);
2352 auto glyphRunList = fScratchGlyphRunBuilder->blobToGlyphRunList(*blob, {
x,
y});
2366 auto layer = this->aboutToDraw(
paint, &
bounds, PredrawFlags::kSkipMaskFilterAutoLayer);
2375 auto glyphRunList = fScratchGlyphRunBuilder->blobToGlyphRunList(blob, origin);
2386 auto layer = this->aboutToDraw(
paint, &
bounds, PredrawFlags::kSkipMaskFilterAutoLayer);
2406 auto layer = this->aboutToDraw(
paint, &
bounds, PredrawFlags::kSkipMaskFilterAutoLayer);
2408 this->topDevice()->
drawSlug(
this, slug, layer->paint());
2419 fScratchGlyphRunBuilder->textToGlyphRunList(
2421 if (!glyphRunList.
empty()) {
2428 const uint32_t* clusters,
int textByteCount,
const char* utf8text,
2430 if (
count <= 0) {
return; }
2436 SkSpan(utf8text, textByteCount),
2442 glyphRun,
paint, origin);
2448 if (
count <= 0) {
return; }
2460 glyphRun,
paint, origin);
2466 if (
count <= 0) {
return; }
2468 auto [positions, rotateScales] =
2480 glyphRun,
paint, origin);
2493 int totalGlyphCount = 0;
2497 while (
i.next(&r)) {
2511 if (this->internalQuickReject(
bounds, simplePaint)) {
2515 auto layer = this->aboutToDraw(simplePaint, &
bounds);
2523 auto layer = this->aboutToDraw(simplePaint,
nullptr);
2533 if (
nullptr == cubics) {
2550 if (this->internalQuickReject(
bounds, simplePaint)) {
2554 auto layer = this->aboutToDraw(simplePaint, &
bounds);
2562#ifndef SK_BUILD_FOR_ANDROID_FRAMEWORK
2575#ifndef SK_BUILD_FOR_ANDROID_FRAMEWORK
2588 if (this->predrawNotify()) {
2601 if (cull && this->internalQuickReject(*cull, realPaint)) {
2608 auto layer = this->aboutToDraw(realPaint);
2618 if (this->predrawNotify()) {
2629 if (this->internalQuickReject(r,
paint)) {
2633 if (this->predrawNotify()) {
2655 bool setBoundsValid =
count == 1 || needsAutoLayer;
2657 if (imageSet[0].fMatrixIndex >= 0) {
2661 if (needsAutoLayer) {
2664 if (imageSet[
i].fMatrixIndex >= 0) {
2672 if (setBoundsValid && this->internalQuickReject(setBounds, realPaint)) {
2676 auto layer = this->aboutToDraw(realPaint, setBoundsValid ? &setBounds :
nullptr);
2679 realSampling, layer->paint(), constraint);
2713 r.
setLTRB(cx - radius, cy - radius, cx + radius, cy + radius);
2719 if (rx > 0 && ry > 0) {
2739#ifdef SK_DISABLE_SKPICTURE
2781 const SkRect& dstRect,
int matrixIndex,
float alpha,
2782 unsigned aaFlags,
bool hasClip)
2786 , fMatrixIndex(matrixIndex)
2789 , fHasClip(hasClip) {}
2792 const SkRect& dstRect,
float alpha,
unsigned aaFlags)
2797 , fAAFlags(aaFlags) {}
2808 if (!
bitmap.installPixels(
info, pixels, rowBytes)) {
2813 std::make_unique<SkCanvas>(
bitmap, *props) :
2814 std::make_unique<SkCanvas>(
bitmap);
2842 const SkDevice* dev = this->topDevice();
2846 if (!
clip.intersect({0, 0, dev->width(), dev->height()})) {
2870std::unique_ptr<SkCanvas>
2884 hndl = alloc->allocBitmap(
info, &bm);
2886 return hndl ? std::unique_ptr<SkCanvas>(
new SkCanvas(bm, std::move(alloc), hndl, props))
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
constexpr int kMaxGlyphCount
static float prev(float f)
static void Union(SkRegion *rgn, const SkIRect &rect)
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
@ kDstOver
r = d + (1-da)*s
SkBlenderBase * as_BB(SkBlender *blend)
@ kNormal_SkBlurStyle
fuzzy inside and outside
constexpr int kMaxPictureOpsToUnrollInsteadOfRef
#define RETURN_ON_NULL(ptr)
static SkPaint clean_paint_for_drawImage(const SkPaint *paint)
static bool install(SkBitmap *bm, const SkImageInfo &info, const SkRasterHandleAllocator::Rec &rec)
static SkPaint clean_paint_for_drawVertices(SkPaint paint)
static SkSamplingOptions clean_sampling_for_constraint(const SkSamplingOptions &sampling, SkCanvas::SrcRectConstraint constraint)
static SkPaint clean_paint_for_lattice(const SkPaint *paint)
static std::optional< std::pair< skif::Mapping, skif::LayerSpace< SkIRect > > > get_layer_mapping_and_bounds(SkCanvas::FilterSpan filters, const SkMatrix &localToDst, const skif::DeviceSpace< SkIRect > &targetOutput, std::optional< skif::ParameterSpace< SkRect > > contentBounds={}, SkScalar scaleFactor=1.0f)
static skif::FilterResult apply_alpha_and_colorfilter(const skif::Context &ctx, const skif::FilterResult &image, const SkPaint &paint)
static SkColorType image_filter_color_type(const SkColorInfo &dstInfo)
static bool fillable(const SkRect &r)
static skif::ParameterSpace< SkPoint > compute_decomposition_center(const SkMatrix &dstToLocal, std::optional< skif::ParameterSpace< SkRect > > contentBounds, const skif::DeviceSpace< SkIRect > &targetOutput)
static const SkBlurMaskFilterImpl * can_attempt_blurred_rrect_draw(const SkPaint &paint)
#define RETURN_ON_FALSE(pred)
static SkColorFilterBase * as_CFB(SkColorFilter *filter)
@ kBGRA_8888_SkColorType
pixel with 8 bits for blue, green, red, alpha; in 32-bit word
@ kRGBA_F16_SkColorType
pixel with half floats for red, green, blue, alpha;
@ kAlpha_8_SkColorType
pixel with alpha in 8-bit byte
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
#define SK_MAKE_BITMASK_OPS(E)
static bool SkIsFinite(T x, Pack... values)
static SkImageFilter_Base * as_IFB(SkImageFilter *filter)
SkRect SkModifyPaintAndDstForDrawImageRect(const SkImage *image, const SkSamplingOptions &, SkRect src, SkRect dst, bool strictSrcSubset, SkPaint *paint)
static void sk_msan_assert_initialized(const void *begin, const void *end)
SkMaskFilterBase * as_MFB(SkMaskFilter *mf)
static SkPath clip(const SkPath &path, const SkHalfPlane &plane)
sk_sp< T > sk_ref_sp(T *obj)
static constexpr int32_t Sk64_pin_to_s32(int64_t x)
SkSpan(Container &&) -> SkSpan< std::remove_pointer_t< decltype(std::data(std::declval< Container >()))> >
static SkSurfaceProps SkSurfacePropsCopyOrDefault(const SkSurfaceProps *props)
bool SkSurfaceValidateRasterInfo(const SkImageInfo &, size_t rb=kIgnoreRowBytesValue)
constexpr size_t kIgnoreRowBytesValue
@ kUnknown_SkPixelGeometry
static constexpr const T & SkTPin(const T &x, const T &lo, const T &hi)
void sk_ignore_unused_variable(const T &)
constexpr int SkToInt(S x)
static constexpr bool SkToBool(const T &x)
static SkScalar center(float pos0, float pos1)
bool installPixels(const SkImageInfo &info, void *pixels, size_t rowBytes, void(*releaseProc)(void *addr, void *context), void *context)
bool peekPixels(SkPixmap *pixmap) const
bool affectsTransparentBlack() const
static sk_sp< SkBlender > Mode(SkBlendMode mode)
SkBlurStyle blurStyle() const
SkScalar computeXformedSigma(const SkMatrix &ctm) const
AutoUpdateQRBounds(SkCanvas *canvas)
virtual void onDrawDrawable(SkDrawable *drawable, const SkMatrix *matrix)
virtual void onDrawImage2(const SkImage *, SkScalar dx, SkScalar dy, const SkSamplingOptions &, const SkPaint *)
int saveLayer(const SkRect *bounds, const SkPaint *paint)
bool getProps(SkSurfaceProps *props) const
virtual void onDrawDRRect(const SkRRect &outer, const SkRRect &inner, const SkPaint &paint)
SkRasterHandleAllocator::Handle accessTopRasterHandle() const
SkSpan< sk_sp< SkImageFilter > > FilterSpan
void drawRect(const SkRect &rect, const SkPaint &paint)
SkSurface * getSurface() const
void drawOval(const SkRect &oval, const SkPaint &paint)
void clipRect(const SkRect &rect, SkClipOp op, bool doAntiAlias)
virtual void onDrawPath(const SkPath &path, const SkPaint &paint)
bool peekPixels(SkPixmap *pixmap)
void drawPoints(PointMode mode, size_t count, const SkPoint pts[], const SkPaint &paint)
virtual void onDrawAtlas2(const SkImage *, const SkRSXform[], const SkRect src[], const SkColor[], int count, SkBlendMode, const SkSamplingOptions &, const SkRect *cull, const SkPaint *)
virtual bool isClipEmpty() const
SkSurfaceProps getTopProps() const
void drawPatch(const SkPoint cubics[12], const SkColor colors[4], const SkPoint texCoords[4], SkBlendMode mode, const SkPaint &paint)
void drawPoint(SkScalar x, SkScalar y, const SkPaint &paint)
virtual bool onPeekPixels(SkPixmap *pixmap)
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)
sk_sp< SkSurface > makeSurface(const SkImageInfo &info, const SkSurfaceProps *props=nullptr)
virtual SkImageInfo onImageInfo() const
virtual void onDrawImageLattice2(const SkImage *, const Lattice &, const SkRect &dst, SkFilterMode, const SkPaint *)
void drawImageNine(const SkImage *image, const SkIRect ¢er, const SkRect &dst, SkFilterMode filter, const SkPaint *paint=nullptr)
void drawColor(SkColor color, SkBlendMode mode=SkBlendMode::kSrcOver)
virtual void onDrawPicture(const SkPicture *picture, const SkMatrix *matrix, const SkPaint *paint)
void androidFramework_setDeviceClipRestriction(const SkIRect &rect)
virtual void onDrawAnnotation(const SkRect &rect, const char key[], SkData *value)
virtual void onDrawPaint(const SkPaint &paint)
virtual void onDrawBehind(const SkPaint &paint)
bool writePixels(const SkImageInfo &info, const void *pixels, size_t rowBytes, int x, int y)
SkRect getLocalClipBounds() const
virtual GrRecordingContext * recordingContext() const
virtual void onClipShader(sk_sp< SkShader >, SkClipOp)
virtual sk_sp< sktext::gpu::Slug > onConvertGlyphRunListToSlug(const sktext::GlyphRunList &glyphRunList, const SkPaint &paint)
virtual void didScale(SkScalar, SkScalar)
virtual void didSetM44(const SkM44 &)
virtual bool isClipRect() const
virtual void didRestore()
virtual void onDrawTextBlob(const SkTextBlob *blob, SkScalar x, SkScalar y, const SkPaint &paint)
virtual skgpu::graphite::Recorder * recorder() const
void drawPaint(const SkPaint &paint)
void drawLine(SkScalar x0, SkScalar y0, SkScalar x1, SkScalar y1, const SkPaint &paint)
void private_draw_shadow_rec(const SkPath &, const SkDrawShadowRec &)
void drawDrawable(SkDrawable *drawable, const SkMatrix *matrix=nullptr)
virtual void onDrawRect(const SkRect &rect, const SkPaint &paint)
virtual void onDrawEdgeAAImageSet2(const ImageSetEntry imageSet[], int count, const SkPoint dstClips[], const SkMatrix preViewMatrices[], const SkSamplingOptions &, const SkPaint *, SrcRectConstraint)
void drawAnnotation(const SkRect &rect, const char key[], SkData *value)
virtual SkISize getBaseLayerSize() const
virtual void onDrawRegion(const SkRegion ®ion, const SkPaint &paint)
virtual bool onAccessTopLayerPixels(SkPixmap *pixmap)
virtual void onDrawShadowRec(const SkPath &, const SkDrawShadowRec &)
static constexpr int kMaxFiltersPerLayer
virtual SaveLayerStrategy getSaveLayerStrategy(const SaveLayerRec &)
virtual void onClipRect(const SkRect &rect, SkClipOp op, ClipEdgeStyle edgeStyle)
friend class SkNoDrawCanvas
virtual void onResetClip()
virtual void onDrawMesh(const SkMesh &, sk_sp< SkBlender >, const SkPaint &)
@ kStrict_SrcRectConstraint
sample only inside bounds; slower
@ kFast_SrcRectConstraint
sample outside bounds; faster
void drawGlyphs(int count, const SkGlyphID glyphs[], const SkPoint positions[], const uint32_t clusters[], int textByteCount, const char utf8text[], SkPoint origin, const SkFont &font, const SkPaint &paint)
SkM44 getLocalToDevice() const
void clipRegion(const SkRegion &deviceRgn, SkClipOp op=SkClipOp::kIntersect)
void experimental_DrawEdgeAAQuad(const SkRect &rect, const SkPoint clip[4], QuadAAFlags aaFlags, const SkColor4f &color, SkBlendMode mode)
@ kFullLayer_SaveLayerStrategy
@ kNoLayer_SaveLayerStrategy
void drawMesh(const SkMesh &mesh, sk_sp< SkBlender > blender, const SkPaint &paint)
virtual void onDrawSlug(const sktext::gpu::Slug *slug, const SkPaint &paint)
void drawIRect(const SkIRect &rect, const SkPaint &paint)
virtual void willRestore()
void experimental_DrawEdgeAAImageSet(const ImageSetEntry imageSet[], int cnt, const SkPoint dstClips[], const SkMatrix preViewMatrices[], const SkSamplingOptions &, const SkPaint *paint=nullptr, SrcRectConstraint constraint=kStrict_SrcRectConstraint)
void rotate(SkScalar degrees)
virtual void onDrawPatch(const SkPoint cubics[12], const SkColor colors[4], const SkPoint texCoords[4], SkBlendMode mode, const SkPaint &paint)
void restoreToCount(int saveCount)
virtual void didTranslate(SkScalar, SkScalar)
void drawRRect(const SkRRect &rrect, const SkPaint &paint)
SkMatrix getTotalMatrix() const
virtual void onDrawVerticesObject(const SkVertices *vertices, SkBlendMode mode, const SkPaint &paint)
void drawRoundRect(const SkRect &rect, SkScalar rx, SkScalar ry, const SkPaint &paint)
void drawArc(const SkRect &oval, SkScalar startAngle, SkScalar sweepAngle, bool useCenter, const SkPaint &paint)
void drawImageLattice(const SkImage *image, const Lattice &lattice, const SkRect &dst, SkFilterMode filter, const SkPaint *paint=nullptr)
void clipPath(const SkPath &path, SkClipOp op, bool doAntiAlias)
SkIRect getDeviceClipBounds() const
@ kPreserveLCDText_SaveLayerFlag
@ kInitWithPrevious_SaveLayerFlag
initializes with previous contents
virtual void onDrawOval(const SkRect &rect, const SkPaint &paint)
void drawRegion(const SkRegion ®ion, const SkPaint &paint)
virtual void didConcat44(const SkM44 &)
virtual bool onGetProps(SkSurfaceProps *props, bool top) const
void drawImageRect(const SkImage *, const SkRect &src, const SkRect &dst, const SkSamplingOptions &, const SkPaint *, SrcRectConstraint)
void drawPath(const SkPath &path, const SkPaint &paint)
void drawAtlas(const SkImage *atlas, const SkRSXform xform[], const SkRect tex[], const SkColor colors[], int count, SkBlendMode mode, const SkSamplingOptions &sampling, const SkRect *cullRect, const SkPaint *paint)
void setMatrix(const SkM44 &matrix)
virtual void onClipRRect(const SkRRect &rrect, SkClipOp op, ClipEdgeStyle edgeStyle)
void temporary_internal_getRgnClip(SkRegion *region)
virtual void onClipPath(const SkPath &path, SkClipOp op, ClipEdgeStyle edgeStyle)
void drawDRRect(const SkRRect &outer, const SkRRect &inner, const SkPaint &paint)
void scale(SkScalar sx, SkScalar sy)
void concat(const SkMatrix &matrix)
virtual bool onDoSaveBehind(const SkRect *)
virtual void onDrawGlyphRunList(const sktext::GlyphRunList &glyphRunList, const SkPaint &paint)
SkSurfaceProps getBaseProps() const
void drawPicture(const SkPicture *picture)
virtual void onDrawImageRect2(const SkImage *, const SkRect &src, const SkRect &dst, const SkSamplingOptions &, const SkPaint *, SrcRectConstraint)
void clipShader(sk_sp< SkShader >, SkClipOp=SkClipOp::kIntersect)
static std::unique_ptr< SkCanvas > MakeRasterDirect(const SkImageInfo &info, void *pixels, size_t rowBytes, const SkSurfaceProps *props=nullptr)
void drawVertices(const SkVertices *vertices, SkBlendMode mode, const SkPaint &paint)
virtual sk_sp< SkSurface > onNewSurface(const SkImageInfo &info, const SkSurfaceProps &props)
SkImageInfo imageInfo() const
void * accessTopLayerPixels(SkImageInfo *info, size_t *rowBytes, SkIPoint *origin=nullptr)
@ kLines_PointMode
draw each pair of points as a line segment
@ kPoints_PointMode
draw each point separately
bool readPixels(const SkImageInfo &dstInfo, void *dstPixels, size_t dstRowBytes, int srcX, int srcY)
virtual void onDrawEdgeAAQuad(const SkRect &rect, const SkPoint clip[4], QuadAAFlags aaFlags, const SkColor4f &color, SkBlendMode mode)
virtual void onDrawPoints(PointMode mode, size_t count, const SkPoint pts[], const SkPaint &paint)
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)
bool quickReject(const SkRect &rect) const
virtual void onDrawRRect(const SkRRect &rrect, const SkPaint &paint)
virtual void onClipRegion(const SkRegion &deviceRgn, SkClipOp op)
void clipRRect(const SkRRect &rrect, SkClipOp op, bool doAntiAlias)
int saveLayerAlphaf(const SkRect *bounds, float alpha)
void drawCircle(SkScalar cx, SkScalar cy, SkScalar radius, const SkPaint &paint)
virtual void onDrawArc(const SkRect &rect, SkScalar startAngle, SkScalar sweepAngle, bool useCenter, const SkPaint &paint)
bool affectsTransparentBlack() const
static sk_sp< SkColorFilter > Blend(const SkColor4f &c, sk_sp< SkColorSpace >, SkBlendMode mode)
int bytesPerPixel() const
SkColorInfo makeColorSpace(sk_sp< SkColorSpace > cs) const
sk_sp< SkColorSpace > refColorSpace() const
SkColorType colorType() const
const void * back() const
const SkImageInfo & imageInfo() const
virtual sk_sp< SkDevice > createDevice(const CreateInfo &, const SkPaint *)
virtual void drawVertices(const SkVertices *, sk_sp< SkBlender >, const SkPaint &, bool skipColorXform=false)=0
virtual void drawRRect(const SkRRect &rr, const SkPaint &paint)=0
virtual void drawEdgeAAQuad(const SkRect &rect, const SkPoint clip[4], SkCanvas::QuadAAFlags aaFlags, const SkColor4f &color, SkBlendMode mode)
virtual void drawPoints(SkCanvas::PointMode mode, size_t count, const SkPoint[], const SkPaint &paint)=0
virtual void drawRegion(const SkRegion &r, const SkPaint &paint)
SkIPoint getOrigin() const
virtual void drawAtlas(const SkRSXform[], const SkRect[], const SkColor[], int count, sk_sp< SkBlender >, const SkPaint &)
virtual void clipPath(const SkPath &path, SkClipOp op, bool aa)=0
bool readPixels(const SkPixmap &dst, int x, int y)
virtual bool isClipEmpty() const =0
void clipShader(sk_sp< SkShader > sh, SkClipOp op)
virtual void drawShadow(const SkPath &, const SkDrawShadowRec &)
virtual bool isClipRect() const =0
virtual void clipRegion(const SkRegion ®ion, SkClipOp op)=0
void drawGlyphRunList(SkCanvas *, const sktext::GlyphRunList &glyphRunList, const SkPaint &paint)
virtual void drawEdgeAAImageSet(const SkCanvas::ImageSetEntry[], int count, const SkPoint dstClips[], const SkMatrix preViewMatrices[], const SkSamplingOptions &, const SkPaint &, SkCanvas::SrcRectConstraint)
const SkM44 & globalToDevice() const
virtual void drawDRRect(const SkRRect &outer, const SkRRect &inner, const SkPaint &)
virtual void * getRasterHandle() const
virtual void popClipStack()=0
virtual void pushClipStack()=0
bool accessPixels(SkPixmap *pmap)
const SkMatrix & localToDevice() const
virtual void drawSlug(SkCanvas *, const sktext::gpu::Slug *slug, const SkPaint &paint)
virtual GrRecordingContext * recordingContext() const
virtual void drawSpecial(SkSpecialImage *, const SkMatrix &localToDevice, const SkSamplingOptions &, const SkPaint &, SkCanvas::SrcRectConstraint constraint=SkCanvas::kStrict_SrcRectConstraint)
virtual void drawDevice(SkDevice *, const SkSamplingOptions &, const SkPaint &)
virtual void clipRRect(const SkRRect &rrect, SkClipOp op, bool aa)=0
virtual SkIRect devClipBounds() const =0
const SkSurfaceProps & surfaceProps() const
virtual void clipRect(const SkRect &rect, SkClipOp op, bool aa)=0
const SkM44 & deviceToGlobal() const
virtual void drawDrawable(SkCanvas *, SkDrawable *, const SkMatrix *)
virtual skgpu::graphite::Recorder * recorder() const
void setDeviceCoordinateSystem(const SkM44 &deviceToGlobal, const SkM44 &globalToDevice, const SkM44 &localToDevice, int bufferOriginX, int bufferOriginY)
void setGlobalCTM(const SkM44 &ctm)
virtual sk_sp< sktext::gpu::Slug > convertGlyphRunListToSlug(const sktext::GlyphRunList &glyphRunList, const SkPaint &paint)
bool peekPixels(SkPixmap *)
virtual sk_sp< SkSurface > makeSurface(const SkImageInfo &, const SkSurfaceProps &)
virtual void drawPaint(const SkPaint &paint)=0
virtual void drawMesh(const SkMesh &mesh, sk_sp< SkBlender >, const SkPaint &)=0
virtual bool isClipAntiAliased() const =0
virtual bool useDrawCoverageMaskForMaskFilters() const
virtual void drawPatch(const SkPoint cubics[12], const SkColor colors[4], const SkPoint texCoords[4], sk_sp< SkBlender >, const SkPaint &paint)
virtual void drawRect(const SkRect &r, const SkPaint &paint)=0
virtual void drawImageRect(const SkImage *, const SkRect *src, const SkRect &dst, const SkSamplingOptions &, const SkPaint &, SkCanvas::SrcRectConstraint)=0
virtual void drawArc(const SkArc &arc, const SkPaint &paint)
virtual void drawAnnotation(const SkRect &, const char[], SkData *)
virtual void drawPath(const SkPath &path, const SkPaint &paint, bool pathIsMutable=false)=0
virtual void drawOval(const SkRect &oval, const SkPaint &paint)=0
virtual bool isNoPixelsDevice() const
virtual void replaceClip(const SkIRect &rect)=0
virtual void drawImageLattice(const SkImage *, const SkCanvas::Lattice &, const SkRect &dst, SkFilterMode, const SkPaint &)
skif::LayerSpace< SkIRect > getInputBounds(const skif::Mapping &mapping, const skif::DeviceSpace< SkIRect > &desiredOutput, std::optional< skif::ParameterSpace< SkRect > > knownContentBounds) const
skif::FilterResult filterImage(const skif::Context &context) const
sk_sp< SkShader > makeShader(SkTileMode tmx, SkTileMode tmy, const SkSamplingOptions &, const SkMatrix *localMatrix=nullptr) const
static bool Valid(int imageWidth, int imageHeight, const SkCanvas::Lattice &lattice)
virtual Type type() const =0
static SkRect MapRect(const SkM44 &m, const SkRect &r)
static SkMatrix Scale(SkScalar sx, SkScalar sy)
static SkMatrix Translate(SkScalar dx, SkScalar dy)
@ kFill_ScaleToFit
scales in x and y to fill destination SkRect
void mapPoints(SkPoint dst[], const SkPoint src[], int count) const
static SkMatrix Concat(const SkMatrix &a, const SkMatrix &b)
bool invert(SkMatrix *inverse) const
static const SkMatrix & I()
SkMatrix & preTranslate(SkScalar dx, SkScalar dy)
void mapRectScaleTranslate(SkRect *dst, const SkRect &src) const
static SkMatrix MakeRectToRect(const SkRect &src, const SkRect &dst, ScaleToFit stf)
bool mapRect(SkRect *dst, const SkRect &src, SkApplyPerspectiveClip pc=SkApplyPerspectiveClip::kYes) const
bool onDoSaveBehind(const SkRect *) override
SaveLayerStrategy getSaveLayerStrategy(const SaveLayerRec &rec) override
bool resetForNextPicture(const SkIRect &bounds)
static bool Overwrites(const SkPaint *paint, ShaderOverrideOpacity)
@ kNone_ShaderOverrideOpacity
there is no overriding shader (bitmap or image)
@ kOpaque_ShaderOverrideOpacity
the overriding shader is opaque
@ kNotOpaque_ShaderOverrideOpacity
the overriding shader may not be opaque
void setStyle(Style style)
void setAntiAlias(bool aa)
void setImageFilter(sk_sp< SkImageFilter > imageFilter)
const SkRect & computeFastBounds(const SkRect &orig, SkRect *storage) const
SkColorFilter * getColorFilter() const
@ kStroke_Style
set to stroke geometry
@ kFill_Style
set to fill geometry
@ kStrokeAndFill_Style
sets to stroke and fill geometry
void setMaskFilter(sk_sp< SkMaskFilter > maskFilter)
bool nothingToDraw() const
SkMaskFilter * getMaskFilter() const
void setShader(sk_sp< SkShader > shader)
void setPathEffect(sk_sp< SkPathEffect > pathEffect)
SkBlender * getBlender() const
SkImageFilter * getImageFilter() const
const SkRect & getBounds() const
virtual SkRect cullRect() const =0
virtual void playback(SkCanvas *canvas, AbortCallback *callback=nullptr) const =0
virtual int approximateOpCount(bool nested=false) const =0
const SkImageInfo & info() const
void * writable_addr() const
const void * addr() const
static SkRRect MakeOval(const SkRect &oval)
static SkRRect MakeRect(const SkRect &r)
void setOval(const SkRect &oval)
void setRectXY(const SkRect &rect, SkScalar xRad, SkScalar yRad)
const SkRect & getBounds() const
static std::unique_ptr< SkCanvas > MakeCanvas(std::unique_ptr< SkRasterHandleAllocator >, const SkImageInfo &, const Rec *rec=nullptr, const SkSurfaceProps *props=nullptr)
virtual bool allocHandle(const SkImageInfo &, Rec *)=0
void translate(int dx, int dy)
@ kIntersect_Op
target intersected with operand
@ kDifference_Op
target minus operand
const SkIRect & getBounds() const
constexpr bool empty() const
SkPixelGeometry pixelGeometry() const
@ kDiscard_ContentChangeMode
discards surface on change
@ kRetain_ContentChangeMode
preserves surface on change
const SkRect & bounds() const
SkVertices::VertexMode mode() const
bool hasTexCoords() const
const SkRect & bounds() const
@ kTriangleFan_VertexMode
static FilterResult MakeFromImage(const Context &ctx, sk_sp< SkImage > image, SkRect srcRect, ParameterSpace< SkRect > dstRect, const SkSamplingOptions &sampling)
void outset(const LayerSpace< SkISize > &delta)
LayerSpace< SkIRect > relevantSubset(const LayerSpace< SkIRect > dstRect, SkTileMode) const
LayerSpace< SkRect > mapRect(const LayerSpace< SkRect > &r) const
bool inverseMapRect(const LayerSpace< SkRect > &r, LayerSpace< SkRect > *out) const
const SkMatrix & deviceToLayer() const
const SkMatrix & layerToDevice() const
bool decomposeCTM(const SkMatrix &ctm, const SkImageFilter *filter, const skif::ParameterSpace< SkPoint > &representativePt)
const SkMatrix & layerMatrix() const
LayerSpace< T > paramToLayer(const ParameterSpace< T > ¶mGeometry) const
bool adjustLayerSpace(const SkMatrix &layer)
auto empty() const -> decltype(fGlyphRuns.empty())
SkRect sourceBoundsWithOrigin() const
virtual SkRect sourceBoundsWithOrigin() const =0
FlutterSemanticsFlag flags
static float max(float r, float g, float b)
static float min(float r, float g, float b)
sk_sp< const SkImage > atlas
unsigned useCenter Optional< SkMatrix > matrix
Optional< SkRect > bounds
PODArray< SkPoint > dstClips
sk_sp< const SkImage > image
ClipOpAndAA opAA SkRegion region
sk_sp< const SkPicture > picture
PODArray< SkRSXform > xforms
sk_sp< SkBlender > blender SkRect rect
PODArray< SkMatrix > preViewMatrices
PODArray< SkColor > colors
SkSamplingOptions sampling
skia_private::AutoTArray< sk_sp< SkImageFilter > > filters TypedMatrix matrix TypedMatrix matrix SkScalar dx
SK_API sk_sp< SkShader > Empty()
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
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
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.
SkSamplingOptions(SkFilterMode::kLinear))
sk_sp< SkImageFilter > fFilter
FilterToSpan(const SkImageFilter *filter)
static SkArc Make(const SkRect &oval, SkScalar startAngleDegrees, SkScalar sweepAngleDegrees, Type type)
ImageSetEntry & operator=(const ImageSetEntry &)
int fYCount
number of y-coordinates
const SkIRect * fBounds
source bounds to draw from
const int * fYDivs
y-axis values dividing bitmap
int fXCount
number of x-coordinates
const RectType * fRectTypes
array of fill types
const SkColor * fColors
array of colors
const int * fXDivs
x-axis values dividing bitmap
constexpr int32_t y() const
constexpr int32_t x() const
SkIRect makeOutset(int32_t dx, int32_t dy) const
bool intersect(const SkIRect &r)
constexpr SkISize size() const
static constexpr SkIRect MakeSize(const SkISize &size)
static constexpr SkIRect MakeEmpty()
static constexpr SkIRect MakeWH(int32_t w, int32_t h)
constexpr SkIPoint topLeft() const
static constexpr SkIRect MakeXYWH(int32_t x, int32_t y, int32_t w, int32_t h)
SkIRect makeInset(int32_t dx, int32_t dy) const
static constexpr SkISize Make(int32_t w, int32_t h)
const SkColorInfo & colorInfo() const
sk_sp< SkColorSpace > refColorSpace() const
SkISize dimensions() const
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)
void set(float x, float y)
void(* fReleaseProc)(void *pixels, void *ctx)
SkRect makeSorted() const
static SkRect Make(const SkISize &size)
static constexpr SkRect MakeEmpty()
constexpr SkRect makeOffset(float dx, float dy) const
void joinPossiblyEmptyRect(const SkRect &r)
static SkRect MakeIWH(int w, int h)
void outset(float dx, float dy)
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)
bool intersects(const SkRect &r) const
bool contains(SkScalar x, SkScalar y) const
void roundOut(SkIRect *dst) const
void round(SkIRect *dst) const
constexpr float height() const
void setLTRB(float left, float top, float right, float bottom)
constexpr float width() const
static constexpr SkRect MakeWH(float w, float h)
const SkFilterMode filter
const SkMipmapMode mipmap
std::shared_ptr< const fml::Mapping > data
#define TRACE_EVENT0(category_group, name)