Definition at line 525 of file SkImageFilterTypes.cpp.
◆ AutoSurface()
skif::FilterResult::AutoSurface::AutoSurface |
( |
const Context & |
ctx, |
|
|
const LayerSpace< SkIRect > & |
dstBounds, |
|
|
PixelBoundary |
boundary, |
|
|
bool |
renderInParameterSpace, |
|
|
const SkSurfaceProps * |
props = nullptr |
|
) |
| |
|
inline |
Definition at line 527 of file SkImageFilterTypes.cpp.
532 : fDstBounds(dstBounds)
533 , fBoundary(boundary) {
534
535
536
537
539 if (!dstBounds.isEmpty()) {
540 fDstBounds.
outset(LayerSpace<SkISize>({this->padding(), this->padding()}));
542 ctx.refColorSpace(),
543 props);
544 }
545
547 return;
548 }
549
550
551
552
553 ctx.markNewSurface();
554 fCanvas.emplace(std::move(
device));
555 fCanvas->translate(-fDstBounds.
left(), -fDstBounds.
top());
557 if (fBoundary == PixelBoundary::kTransparent) {
558
559
560 fCanvas->clipIRect(
SkIRect(dstBounds));
561 } else {
562
563
564
565 fCanvas->clipIRect(
SkIRect(fDstBounds));
566 }
567
568 if (renderInParameterSpace) {
569 fCanvas->concat(
SkMatrix(ctx.mapping().layerMatrix()));
570 }
571 }
void outset(const LayerSpace< SkISize > &delta)
LayerSpace< SkISize > size() const
constexpr SkColor4f kTransparent
◆ canvas()
SkCanvas * skif::FilterResult::AutoSurface::canvas |
( |
| ) |
|
|
inline |
◆ device()
SkDevice * skif::FilterResult::AutoSurface::device |
( |
| ) |
|
|
inline |
◆ operator bool()
skif::FilterResult::AutoSurface::operator bool |
( |
| ) |
const |
|
inlineexplicit |
◆ operator->()
SkCanvas * skif::FilterResult::AutoSurface::operator-> |
( |
| ) |
|
|
inline |
◆ snap()
Definition at line 579 of file SkImageFilterTypes.cpp.
579 {
580 if (fCanvas.has_value()) {
581
582
583 fCanvas->restoreToCount(0);
585
586
589 fCanvas.reset();
590
591 if (
image && fBoundary != PixelBoundary::kUnknown) {
592
593 const int padding = this->padding();
595 LayerSpace<SkIPoint> origin{{fDstBounds.
left() + padding,
596 fDstBounds.
top() + padding}};
598 } else {
599
600 return {
image, fDstBounds.
topLeft(), PixelBoundary::kUnknown};
601 }
602 } else {
603 return {};
604 }
605 }
virtual void setImmutable()
virtual sk_sp< SkSpecialImage > snapSpecial(const SkIRect &subset, bool forceCopy=false)
sk_sp< SkSpecialImage > makeSubset(const SkIRect &subset) const
SkISize dimensions() const
const SkSpecialImage * image() const
LayerSpace< SkIPoint > topLeft() const
static constexpr SkIRect MakeSize(const SkISize &size)
static constexpr SkIRect MakeWH(int32_t w, int32_t h)
SkIRect makeInset(int32_t dx, int32_t dy) const
The documentation for this class was generated from the following file: