8#ifndef SurfaceDrawContext_v1_DEFINED
9#define SurfaceDrawContext_v1_DEFINED
81 std::string_view label,
105 std::string_view label);
163 const GrStyle* style =
nullptr);
191 this->drawFilledQuad(
clip, std::move(
paint), &quad);
202 const SkRect* optionalLocalRect =
nullptr) {
205 (optionalLocalRect) ? *optionalLocalRect : rect);
208 const SkRect& localRect = optionalLocalRect ? *optionalLocalRect : rect;
210 this->drawFilledQuad(
clip, std::move(
paint), &quad);
227 const SkPoint optionalLocalPoints[4]) {
228 const SkPoint* localPoints = optionalLocalPoints ? optionalLocalPoints :
points;
231 this->drawFilledQuad(
clip, std::move(
paint), &quad);
280 this->drawTexturedQuad(
clip, std::move(view), srcAlphaType, std::move(texXform), filter, mm,
281 color, mode, &quad, subset);
379 bool skipColorXform =
false);
483 std::unique_ptr<SkLatticeIter>,
509 int numClipAnalyticElements);
515 int numClipAnalyticElements);
518 this->internalStencilClear(&scissor, insideStencilMask);
530 const SkMatrix* localMatrix =
nullptr) {
536 this->drawFilledQuad(
clip, std::move(
paint), &quad, ss);
579 const std::function<WillAddOpFn>& = std::function<WillAddOpFn>());
589 bool deleteSemaphoresAfterWait);
601 return GrAA(
paint.isAntiAlias() || this->alwaysAntialias());
605 if (this->
numSamples() > 1 || fCanUseDynamicMSAA) {
618#if defined(GR_TEST_UTILS)
619 void testingOnly_SetPreserveOpsOnFullClear() { fPreserveOpsOnFullClear_TestingOnly =
true; }
631 void setNeedsStencil();
633 void internalStencilClear(
const SkIRect* scissor,
bool insideStencilMask);
668 const SkRect* subset =
nullptr);
685 [[nodiscard]]
bool setupDstProxyView(
const SkRect& opBounds,
689 OpsTask* replaceOpsTaskIfModifiesColor();
692 const bool fCanUseDynamicMSAA;
694 bool fNeedsStencil =
false;
696#if defined(GR_TEST_UTILS)
697 bool fPreserveOpsOnFullClear_TestingOnly =
false;
@ kBottomLeft_GrSurfaceOrigin
static const int points[]
static SkPath clip(const SkPath &path, const SkHalfPlane &plane)
std::unique_ptr< GrOp > Owner
static GrQuad MakeFromRect(const SkRect &, const SkMatrix &)
static GrQuad MakeFromSkQuad(const SkPoint pts[4], const SkMatrix &)
bool wrapsVkSecondaryCB() const
bool refsWrappedObjects() const
UniqueID uniqueID() const
GrRenderTarget * peekRenderTarget() const
static const SkMatrix & I()
GrSurfaceProxy * asSurfaceProxy()
SkISize dimensions() const
GrRenderTargetProxy * asRenderTargetProxy()
skgpu::Swizzle readSwizzle() const
void willReplaceOpsTask(OpsTask *prevTask, OpsTask *nextTask) override
bool stencilPath(const GrHardClip *, GrAA doStencilMSAA, const SkMatrix &viewMatrix, const SkPath &)
bool canUseDynamicMSAA() const
void clearStencilClip(const SkIRect &scissor, bool insideStencilMask)
bool drawFastShadow(const GrClip *, const SkMatrix &viewMatrix, const SkPath &path, const SkDrawShadowRec &rec)
void drawOval(const GrClip *, GrPaint &&paint, GrAA, const SkMatrix &viewMatrix, const SkRect &oval, const GrStyle &style)
void fillQuadWithEdgeAA(const GrClip *clip, GrPaint &&paint, GrQuadAAFlags edgeAA, const SkMatrix &viewMatrix, const SkPoint points[4], const SkPoint optionalLocalPoints[4])
void(GrOp *, uint32_t opsTaskID) WillAddOpFn
bool wrapsVkSecondaryCB() const
void fillPixelsWithLocalMatrix(const GrClip *clip, GrPaint &&paint, const SkIRect &bounds, const SkMatrix &localMatrix)
void drawShape(const GrClip *, GrPaint &&, GrAA, const SkMatrix &viewMatrix, GrStyledShape &&)
void fillRectWithEdgeAA(const GrClip *clip, GrPaint &&paint, GrQuadAAFlags edgeAA, const SkMatrix &viewMatrix, const SkRect &rect, const SkRect *optionalLocalRect=nullptr)
void drawDrawable(std::unique_ptr< SkDrawable::GpuDrawHandler >, const SkRect &bounds)
void drawAtlas(const GrClip *, GrPaint &&paint, const SkMatrix &viewMatrix, int spriteCount, const SkRSXform xform[], const SkRect texRect[], const SkColor colors[])
GrSurfaceProxy::UniqueID uniqueID() const
int maxWindowRectangles() const
void drawTextureSet(const GrClip *, GrTextureSetEntry[], int cnt, int proxyRunCnt, GrSamplerState::Filter, GrSamplerState::MipmapMode, SkBlendMode mode, SkCanvas::SrcRectConstraint, const SkMatrix &viewMatrix, sk_sp< GrColorSpaceXform > texXform)
void setLastClip(uint32_t clipStackGenID, const SkIRect &devClipBounds, int numClipAnalyticElements)
skgpu::Budgeted isBudgeted() const
void drawMesh(const GrClip *, GrPaint &&paint, const SkMatrix &viewMatrix, const SkMesh &mesh, skia_private::TArray< std::unique_ptr< GrFragmentProcessor > > children)
void drawArc(const GrClip *, GrPaint &&paint, GrAA, const SkMatrix &viewMatrix, const SkRect &oval, SkScalar startAngle, SkScalar sweepAngle, bool useCenter, const GrStyle &style)
bool alwaysAntialias() const
void addDrawOp(const GrClip *, GrOp::Owner, const std::function< WillAddOpFn > &=std::function< WillAddOpFn >())
bool waitOnSemaphores(int numSemaphores, const GrBackendSemaphore waitSemaphores[], bool deleteSemaphoresAfterWait)
void drawQuadSet(const GrClip *clip, GrPaint &&paint, const SkMatrix &viewMatrix, const GrQuadSetEntry[], int cnt)
void drawImageLattice(const GrClip *, GrPaint &&, const SkMatrix &viewMatrix, GrSurfaceProxyView, SkAlphaType alphaType, sk_sp< GrColorSpaceXform >, GrSamplerState::Filter, std::unique_ptr< SkLatticeIter >, const SkRect &dst)
void drawPath(const GrClip *, GrPaint &&, GrAA, const SkMatrix &viewMatrix, const SkPath &, const GrStyle &)
bool drawAndStencilPath(const GrHardClip *, const GrUserStencilSettings *, SkRegion::Op op, bool invert, GrAA doStencilMSAA, const SkMatrix &viewMatrix, const SkPath &)
bool mustRenderClip(uint32_t clipStackGenID, const SkIRect &devClipBounds, int numClipAnalyticElements)
void drawTextureQuad(const GrClip *clip, GrSurfaceProxyView view, GrColorType srcColorType, SkAlphaType srcAlphaType, GrSamplerState::Filter filter, GrSamplerState::MipmapMode mm, SkBlendMode mode, const SkPMColor4f &color, const SkPoint srcQuad[4], const SkPoint dstQuad[4], GrQuadAAFlags edgeAA, const SkRect *subset, const SkMatrix &viewMatrix, sk_sp< GrColorSpaceXform > texXform)
bool refsWrappedObjects() const
void addDrawOp(GrOp::Owner op)
void drawRRect(const GrClip *, GrPaint &&, GrAA, const SkMatrix &viewMatrix, const SkRRect &rrect, const GrStyle &style)
void drawPaint(const GrClip *, GrPaint &&, const SkMatrix &viewMatrix)
void drawRegion(const GrClip *, GrPaint &&paint, GrAA aa, const SkMatrix &viewMatrix, const SkRegion ®ion, const GrStyle &style, const GrUserStencilSettings *ss=nullptr)
~SurfaceDrawContext() override
static std::unique_ptr< SurfaceDrawContext > MakeFromBackendTexture(GrRecordingContext *, GrColorType, sk_sp< SkColorSpace >, const GrBackendTexture &, int sampleCnt, GrSurfaceOrigin, const SkSurfaceProps &, sk_sp< skgpu::RefCntedCallback > releaseHelper)
GrAA chooseAA(const SkPaint &paint)
void stencilRect(const GrClip *clip, const GrUserStencilSettings *ss, GrPaint &&paint, GrAA doStencilMSAA, const SkMatrix &viewMatrix, const SkRect &rect, const SkMatrix *localMatrix=nullptr)
const SkSurfaceProps & surfaceProps() const
OpsTask::CanDiscardPreviousOps canDiscardPreviousOpsOnFullClear() const override
static std::unique_ptr< SurfaceDrawContext > Make(GrRecordingContext *, GrColorType, sk_sp< GrSurfaceProxy >, sk_sp< SkColorSpace >, GrSurfaceOrigin, const SkSurfaceProps &)
void drawRect(const GrClip *, GrPaint &&paint, GrAA, const SkMatrix &viewMatrix, const SkRect &, const GrStyle *style=nullptr)
static std::unique_ptr< SurfaceDrawContext > MakeWithFallback(GrRecordingContext *, GrColorType, sk_sp< SkColorSpace >, SkBackingFit, SkISize dimensions, const SkSurfaceProps &, int sampleCnt, skgpu::Mipmapped, skgpu::Protected, GrSurfaceOrigin=kBottomLeft_GrSurfaceOrigin, skgpu::Budgeted=skgpu::Budgeted::kYes)
GrRenderTarget * accessRenderTarget()
void drawGlyphRunList(SkCanvas *, const GrClip *, const SkMatrix &viewMatrix, const sktext::GlyphRunList &glyphRunList, SkStrikeDeviceInfo strikeDeviceInfo, const SkPaint &paint)
void fillRectToRect(const GrClip *, GrPaint &&, GrAA, const SkMatrix &, const SkRect &rectToDraw, const SkRect &localRect)
void drawVertices(const GrClip *, GrPaint &&paint, const SkMatrix &viewMatrix, sk_sp< SkVertices > vertices, GrPrimitiveType *overridePrimType=nullptr, bool skipColorXform=false)
void drawTexture(const GrClip *, GrSurfaceProxyView, SkAlphaType, GrSamplerState::Filter, GrSamplerState::MipmapMode, SkBlendMode, const SkPMColor4f &, const SkRect &srcRect, const SkRect &dstRect, GrQuadAAFlags, SkCanvas::SrcRectConstraint, const SkMatrix &, sk_sp< GrColorSpaceXform >)
GrAAType chooseAAType(GrAA aa)
void drawStrokedLine(const GrClip *, GrPaint &&, GrAA, const SkMatrix &, const SkPoint[2], const SkStrokeRec &)
static SkRect Make(const SkISize &size)