17#define ASSERT_SINGLE_OWNER SKGPU_ASSERT_SINGLE_OWNER(this->singleOwner())
18#define RETURN_IF_ABANDONED if (fContext->abandoned()) { return; }
42 , fWriteView(
std::move(writeView)) {
48 SkDEBUGCODE(this->validate();)
53 SkDEBUGCODE(this->validate();)
55 if (!fOpsTask || fOpsTask->isClosed()) {
59 return fOpsTask.get();
65 SkDEBUGCODE(this->validate();)
76 SkDEBUGCODE(this->validate();)
87 std::unique_ptr<GrFragmentProcessor>
fp) {
90 SkDEBUGCODE(this->validate();)
96 paint.setColorFragmentProcessor(std::move(
fp));
100 this->addDrawOp(std::move(op));
105 std::unique_ptr<GrFragmentProcessor>
fp) {
115 SkIPoint clippedDstPoint = dstPoint;
116 SkIRect clippedSrcRect = srcRect;
139 fOpsTask = std::move(newOpsTask);
140 return fOpsTask.get();
145 if (
color[3] == 1.f) {
165void SurfaceFillContext::addDrawOp(
GrOp::Owner owner) {
176 if (!
bounds.intersect(this->asSurfaceProxy()->getBoundsRect())) {
180 SkDEBUGCODE(op->fAddDrawOpCalled =
true;)
195 bool upgradePartialToFull) {
198 SkDEBUGCODE(this->validate();)
205 if (scissor && !scissorState.set(*scissor)) {
213 if (scissorState.enabled() && !this->caps()->performColorClearsAsDraws()) {
214 if (upgradePartialToFull && (this->
caps()->preferFullscreenClears() ||
215 this->
caps()->shouldInitializeTextures())) {
219 scissorState.setDisabled();
227 if (!scissorState.enabled()) {
231 if (opsTask->resetForFullscreenClear(this->canDiscardPreviousOpsOnFullClear()) &&
232 !this->caps()->performColorClearsAsDraws()) {
253 this->addDrawOp(std::move(op));
261void SurfaceFillContext::onValidate()
const {
262 if (fOpsTask && !fOpsTask->isClosed()) {
static bool GrClipSrcRectAndDstPoint(const SkISize &dstSize, SkIPoint *dstPoint, const SkISize &srcSize, SkIRect *srcRect)
#define GR_CREATE_TRACE_MARKER_CONTEXT(classname, op, context)
static constexpr GrClampType GrColorTypeClampType(GrColorType colorType)
@ kUnknown_SkAlphaType
uninitialized
@ kSrcOver
r = s + (1-sa)*d
static SkColorType colorType(AImageDecoder *decoder, const AImageDecoderHeaderInfo *headerInfo)
static SkPath clip(const SkPath &path, const SkHalfPlane &plane)
sk_sp< T > sk_ref_sp(T *obj)
#define RETURN_IF_ABANDONED
#define ASSERT_SINGLE_OWNER
AutoCheckFlush(GrDrawingManager *drawingManager)
static GrAppliedClip Disabled()
bool performPartialClearsAsDraws() const
bool performColorClearsAsDraws() const
virtual GrProcessorSet::Analysis finalize(const GrCaps &, const GrAppliedClip *, GrClampType)=0
virtual bool usesStencil() const
skgpu::ganesh::OpsTask * getLastOpsTask(const GrSurfaceProxy *) const
sk_sp< skgpu::ganesh::OpsTask > newOpsTask(GrSurfaceProxyView, sk_sp< GrArenas > arenas)
void newTextureResolveRenderTask(sk_sp< GrSurfaceProxy > proxy, GrSurfaceProxy::ResolveFlags, const GrCaps &)
static std::unique_ptr< GrFragmentProcessor > Make(const SkMatrix &matrix, std::unique_ptr< GrFragmentProcessor > child)
std::unique_ptr< GrOp > Owner
void setClippedBounds(const SkRect &clippedBounds)
const SkRect & bounds() const
bool requiresDstTexture() const
GrDrawingManager * drawingManager()
GrRecordingContextPriv priv()
skgpu::Swizzle swizzle() const
GrTextureProxy * asTextureProxy() const
SkISize dimensions() const
GrSurfaceOrigin origin() const
GrSurfaceProxy * proxy() const
static std::unique_ptr< GrFragmentProcessor > Make(GrSurfaceProxyView, SkAlphaType, const SkMatrix &=SkMatrix::I(), GrSamplerState::Filter=GrSamplerState::Filter::kNearest, GrSamplerState::MipmapMode mipmapMode=GrSamplerState::MipmapMode::kNone)
static const SkMatrix & I()
constexpr std::array< float, 4 > applyTo(std::array< float, 4 > color) const
static DEFINE_OP_CLASS_ID GrOp::Owner MakeColor(GrRecordingContext *context, const GrScissorState &scissor, std::array< float, 4 > color)
static GrOp::Owner MakeNonAARect(GrRecordingContext *, GrPaint &&, const SkMatrix &view, const SkRect &, const GrUserStencilSettings *=nullptr)
void addOp(GrDrawingManager *, GrOp::Owner, GrTextureResolveManager, const GrCaps &)
GrSurfaceProxy * asSurfaceProxy()
GrDrawingManager * drawingManager()
SkDEBUGCODE(void validate() const ;) SkDEBUGCODE(skgpu GrRecordingContext * fContext
SkISize dimensions() const
const GrCaps * caps() const
const GrColorInfo & colorInfo() const
sk_sp< GrSurfaceProxy > asSurfaceProxyRef()
GrSurfaceOrigin origin() const
GrSurfaceProxyView fWriteView
static void ClearToGrPaint(std::array< float, 4 > color, GrPaint *paint)
void fillRectToRectWithFP(const SkRect &srcRect, const SkIRect &dstRect, std::unique_ptr< GrFragmentProcessor > fp)
OpsTask * replaceOpsTask()
void fillRectWithFP(const SkIRect &dstRect, std::unique_ptr< GrFragmentProcessor >)
bool blitTexture(GrSurfaceProxyView, const SkIRect &srcRect, const SkIPoint &dstPoint)
const GrSurfaceProxyView & writeSurfaceView() const
sk_sp< GrRenderTask > refRenderTask()
virtual void willReplaceOpsTask(OpsTask *prevTask, OpsTask *nextTask)
SurfaceFillContext(GrRecordingContext *rContext, GrSurfaceProxyView readView, GrSurfaceProxyView writeView, const GrColorInfo &colorInfo)
FlPixelBufferTexturePrivate * priv
Optional< SkRect > bounds
constexpr SkISize size() const
static constexpr SkIRect MakePtSize(SkIPoint pt, SkISize size)
static SkRect Make(const SkISize &size)