Pass in the color load op to GrProgramInfo.
In follow on CLs we need to know what the load op is when we try to use discardable msaa attachments. For vulkan the load op affects how we copy the resolve attachment into the msaa attachment, which changes the render pass we use (adds extra subpass). We need to be able to make a compatible render pass to compile programs. Bug: skia:10979 Change-Id: I40c23a18b251af6a2ad3b78a1f6382bdba0b90c4 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/336598 Commit-Queue: Greg Daniel <egdaniel@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
This commit is contained in:
parent
b69a9d48bf
commit
42dbca51f4
@ -175,7 +175,8 @@ private:
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip&& appliedClip,
|
||||
const GrXferProcessor::DstProxyView& dstProxyView,
|
||||
GrXferBarrierFlags renderPassXferBarriers) override {
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) override {
|
||||
GrGeometryProcessor* gp = GP::Make(arena, fMode, fColorSpaceXform);
|
||||
|
||||
fProgramInfo = GrSimpleMeshDrawOpHelper::CreateProgramInfo(caps,
|
||||
@ -187,6 +188,7 @@ private:
|
||||
GrProcessorSet::MakeEmptySet(),
|
||||
GrPrimitiveType::kTriangleStrip,
|
||||
renderPassXferBarriers,
|
||||
colorLoadOp,
|
||||
GrPipeline::InputFlags::kNone);
|
||||
}
|
||||
|
||||
|
@ -94,7 +94,8 @@ protected:
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip&& appliedClip,
|
||||
const GrXferProcessor::DstProxyView& dstProxyView,
|
||||
GrXferBarrierFlags renderPassXferBarriers) override {
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) override {
|
||||
auto gp = this->makeGP(*caps, arena);
|
||||
if (!gp) {
|
||||
return;
|
||||
@ -108,6 +109,7 @@ protected:
|
||||
std::move(fProcessorSet),
|
||||
GrPrimitiveType::kTriangles,
|
||||
renderPassXferBarriers,
|
||||
colorLoadOp,
|
||||
flags);
|
||||
}
|
||||
|
||||
|
@ -162,14 +162,15 @@ private:
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip&& appliedClip,
|
||||
const GrXferProcessor::DstProxyView& dstProxyView,
|
||||
GrXferBarrierFlags renderPassXferBarriers) const {
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) const {
|
||||
GrGeometryProcessor* geomProc = ClockwiseTestProcessor::Make(arena, fReadSkFragCoord);
|
||||
|
||||
return sk_gpu_test::CreateProgramInfo(caps, arena, writeView,
|
||||
std::move(appliedClip), dstProxyView,
|
||||
geomProc, SkBlendMode::kPlus,
|
||||
GrPrimitiveType::kTriangleStrip,
|
||||
renderPassXferBarriers);
|
||||
renderPassXferBarriers, colorLoadOp);
|
||||
}
|
||||
|
||||
GrProgramInfo* createProgramInfo(GrOpFlushState* flushState) const {
|
||||
@ -178,14 +179,16 @@ private:
|
||||
flushState->writeView(),
|
||||
flushState->detachAppliedClip(),
|
||||
flushState->dstProxyView(),
|
||||
flushState->renderPassBarriers());
|
||||
flushState->renderPassBarriers(),
|
||||
flushState->colorLoadOp());
|
||||
}
|
||||
|
||||
void onPrePrepare(GrRecordingContext* context,
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip* clip,
|
||||
const GrXferProcessor::DstProxyView& dstProxyView,
|
||||
GrXferBarrierFlags renderPassXferBarriers) final {
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) final {
|
||||
SkArenaAlloc* arena = context->priv().recordTimeAllocator();
|
||||
|
||||
// This is equivalent to a GrOpFlushState::detachAppliedClip
|
||||
@ -193,7 +196,7 @@ private:
|
||||
|
||||
fProgramInfo = this->createProgramInfo(context->priv().caps(), arena, writeView,
|
||||
std::move(appliedClip), dstProxyView,
|
||||
renderPassXferBarriers);
|
||||
renderPassXferBarriers, colorLoadOp);
|
||||
|
||||
context->priv().recordProgramInfo(fProgramInfo);
|
||||
}
|
||||
|
@ -172,14 +172,15 @@ private:
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip&& appliedClip,
|
||||
const GrXferProcessor::DstProxyView& dstProxyView,
|
||||
GrXferBarrierFlags renderPassXferBarriers) const {
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) const {
|
||||
GrGeometryProcessor* geomProc = FwidthSquircleTestProcessor::Make(arena, fViewMatrix);
|
||||
|
||||
return sk_gpu_test::CreateProgramInfo(caps, arena, writeView,
|
||||
std::move(appliedClip), dstProxyView,
|
||||
geomProc, SkBlendMode::kSrcOver,
|
||||
GrPrimitiveType::kTriangleStrip,
|
||||
renderPassXferBarriers);
|
||||
renderPassXferBarriers, colorLoadOp);
|
||||
}
|
||||
|
||||
GrProgramInfo* createProgramInfo(GrOpFlushState* flushState) const {
|
||||
@ -188,14 +189,16 @@ private:
|
||||
flushState->writeView(),
|
||||
flushState->detachAppliedClip(),
|
||||
flushState->dstProxyView(),
|
||||
flushState->renderPassBarriers());
|
||||
flushState->renderPassBarriers(),
|
||||
flushState->colorLoadOp());
|
||||
}
|
||||
|
||||
void onPrePrepare(GrRecordingContext* context,
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip* clip,
|
||||
const GrXferProcessor::DstProxyView& dstProxyView,
|
||||
GrXferBarrierFlags renderPassXferBarriers) final {
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) final {
|
||||
SkArenaAlloc* arena = context->priv().recordTimeAllocator();
|
||||
|
||||
// This is equivalent to a GrOpFlushState::detachAppliedClip
|
||||
@ -203,7 +206,7 @@ private:
|
||||
|
||||
fProgramInfo = this->createProgramInfo(context->priv().caps(), arena, writeView,
|
||||
std::move(appliedClip), dstProxyView,
|
||||
renderPassXferBarriers);
|
||||
renderPassXferBarriers, colorLoadOp);
|
||||
|
||||
context->priv().recordProgramInfo(fProgramInfo);
|
||||
}
|
||||
|
@ -244,7 +244,8 @@ private:
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip&& appliedClip,
|
||||
const GrXferProcessor::DstProxyView& dstProxyView,
|
||||
GrXferBarrierFlags renderPassXferBarriers) const {
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) const {
|
||||
GrGeometryProcessor* geomProc = SampleLocationsTestProcessor::Make(arena, fGradType);
|
||||
|
||||
GrPipeline::InputFlags flags = GrPipeline::InputFlags::kHWAntialias;
|
||||
@ -253,7 +254,7 @@ private:
|
||||
std::move(appliedClip), dstProxyView,
|
||||
geomProc, SkBlendMode::kSrcOver,
|
||||
GrPrimitiveType::kTriangleStrip,
|
||||
renderPassXferBarriers,
|
||||
renderPassXferBarriers, colorLoadOp,
|
||||
flags, &gStencilWrite);
|
||||
}
|
||||
|
||||
@ -263,14 +264,16 @@ private:
|
||||
flushState->writeView(),
|
||||
flushState->detachAppliedClip(),
|
||||
flushState->dstProxyView(),
|
||||
flushState->renderPassBarriers());
|
||||
flushState->renderPassBarriers(),
|
||||
flushState->colorLoadOp());
|
||||
}
|
||||
|
||||
void onPrePrepare(GrRecordingContext* context,
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip* clip,
|
||||
const GrXferProcessor::DstProxyView& dstProxyView,
|
||||
GrXferBarrierFlags renderPassXferBarriers) final {
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) final {
|
||||
// We're going to create the GrProgramInfo (and the GrPipeline and geometry processor
|
||||
// it relies on) in the DDL-record-time arena.
|
||||
SkArenaAlloc* arena = context->priv().recordTimeAllocator();
|
||||
@ -280,7 +283,7 @@ private:
|
||||
|
||||
fProgramInfo = this->createProgramInfo(context->priv().caps(), arena, writeView,
|
||||
std::move(appliedClip), dstProxyView,
|
||||
renderPassXferBarriers);
|
||||
renderPassXferBarriers, colorLoadOp);
|
||||
|
||||
context->priv().recordProgramInfo(fProgramInfo);
|
||||
}
|
||||
|
@ -314,7 +314,8 @@ private:
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip*,
|
||||
const GrXferProcessor::DstProxyView&,
|
||||
GrXferBarrierFlags renderPassXferBarriers) override {}
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) override {}
|
||||
|
||||
void onPrepare(GrOpFlushState* flushState) override {
|
||||
if (fTriPositions) {
|
||||
@ -347,7 +348,7 @@ private:
|
||||
state->proxy()->backendFormat(), state->writeView().origin(),
|
||||
&pipeline, &GrUserStencilSettings::kUnused, shader.get(),
|
||||
GrPrimitiveType::kPatches, tessellationPatchVertexCount,
|
||||
state->renderPassBarriers());
|
||||
state->renderPassBarriers(), state->colorLoadOp());
|
||||
|
||||
state->bindPipeline(programInfo, SkRect::MakeIWH(kWidth, kHeight));
|
||||
state->bindBuffers(nullptr, nullptr, std::move(fVertexBuffer));
|
||||
|
@ -104,7 +104,8 @@ private:
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip*,
|
||||
const GrXferProcessor::DstProxyView&,
|
||||
GrXferBarrierFlags renderPassXferBarriers) override {}
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) override {}
|
||||
void onPrepare(GrOpFlushState*) override {}
|
||||
void onExecute(GrOpFlushState*, const SkRect& chainBounds) override;
|
||||
|
||||
|
@ -60,7 +60,8 @@ void GrOpFlushState::executeDrawsAndUploadsForMeshDrawOp(
|
||||
fCurrDraw->fGeometryProcessor,
|
||||
fCurrDraw->fPrimitiveType,
|
||||
0,
|
||||
this->renderPassBarriers());
|
||||
this->renderPassBarriers(),
|
||||
this->colorLoadOp());
|
||||
|
||||
this->bindPipelineAndScissorClip(programInfo, chainBounds);
|
||||
this->bindTextures(programInfo.primProc(), fCurrDraw->fPrimProcProxies,
|
||||
|
@ -60,13 +60,14 @@ public:
|
||||
// TODO: why does OpArgs have the op we're going to pass it to as a member? Remove it.
|
||||
explicit OpArgs(GrOp* op, const GrSurfaceProxyView& surfaceView, GrAppliedClip* appliedClip,
|
||||
const GrXferProcessor::DstProxyView& dstProxyView,
|
||||
GrXferBarrierFlags renderPassXferBarriers)
|
||||
GrXferBarrierFlags renderPassXferBarriers, GrLoadOp colorLoadOp)
|
||||
: fOp(op)
|
||||
, fSurfaceView(surfaceView)
|
||||
, fRenderTargetProxy(surfaceView.asRenderTargetProxy())
|
||||
, fAppliedClip(appliedClip)
|
||||
, fDstProxyView(dstProxyView)
|
||||
, fRenderPassXferBarriers(renderPassXferBarriers) {
|
||||
, fRenderPassXferBarriers(renderPassXferBarriers)
|
||||
, fColorLoadOp(colorLoadOp) {
|
||||
SkASSERT(surfaceView.asRenderTargetProxy());
|
||||
}
|
||||
|
||||
@ -77,6 +78,7 @@ public:
|
||||
const GrAppliedClip* appliedClip() const { return fAppliedClip; }
|
||||
const GrXferProcessor::DstProxyView& dstProxyView() const { return fDstProxyView; }
|
||||
GrXferBarrierFlags renderPassBarriers() const { return fRenderPassXferBarriers; }
|
||||
GrLoadOp colorLoadOp() const { return fColorLoadOp; }
|
||||
|
||||
#ifdef SK_DEBUG
|
||||
void validate() const {
|
||||
@ -92,6 +94,7 @@ public:
|
||||
GrAppliedClip* fAppliedClip;
|
||||
GrXferProcessor::DstProxyView fDstProxyView; // TODO: do we still need the dst proxy here?
|
||||
GrXferBarrierFlags fRenderPassXferBarriers;
|
||||
GrLoadOp fColorLoadOp;
|
||||
};
|
||||
|
||||
void setOpArgs(OpArgs* opArgs) { fOpArgs = opArgs; }
|
||||
@ -157,6 +160,10 @@ public:
|
||||
return this->drawOpArgs().renderPassBarriers();
|
||||
}
|
||||
|
||||
GrLoadOp colorLoadOp() const final {
|
||||
return this->drawOpArgs().colorLoadOp();
|
||||
}
|
||||
|
||||
GrDeferredUploadTarget* deferredUploadTarget() final { return this; }
|
||||
const GrCaps& caps() const final;
|
||||
GrThreadSafeCache* threadSafeCache() const final;
|
||||
|
@ -454,7 +454,8 @@ void GrOpsTask::onPrePrepare(GrRecordingContext* context) {
|
||||
this->target(0),
|
||||
chain.appliedClip(),
|
||||
chain.dstProxyView(),
|
||||
fRenderPassXferBarriers);
|
||||
fRenderPassXferBarriers,
|
||||
fColorLoadOp);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -484,7 +485,8 @@ void GrOpsTask::onPrepare(GrOpFlushState* flushState) {
|
||||
this->target(0),
|
||||
chain.appliedClip(),
|
||||
chain.dstProxyView(),
|
||||
fRenderPassXferBarriers);
|
||||
fRenderPassXferBarriers,
|
||||
fColorLoadOp);
|
||||
|
||||
flushState->setOpArgs(&opArgs);
|
||||
|
||||
@ -636,7 +638,8 @@ bool GrOpsTask::onExecute(GrOpFlushState* flushState) {
|
||||
this->target(0),
|
||||
chain.appliedClip(),
|
||||
chain.dstProxyView(),
|
||||
fRenderPassXferBarriers);
|
||||
fRenderPassXferBarriers,
|
||||
fColorLoadOp);
|
||||
|
||||
flushState->setOpArgs(&opArgs);
|
||||
chain.head()->execute(flushState, chain.bounds());
|
||||
|
@ -25,7 +25,8 @@ public:
|
||||
const GrPrimitiveProcessor* primProc,
|
||||
GrPrimitiveType primitiveType,
|
||||
uint8_t tessellationPatchVertexCount,
|
||||
GrXferBarrierFlags renderPassXferBarriers)
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp)
|
||||
: fNumSamples(numSamples)
|
||||
, fNumStencilSamples(numStencilSamples)
|
||||
, fBackendFormat(backendFormat)
|
||||
@ -36,6 +37,7 @@ public:
|
||||
, fPrimitiveType(primitiveType)
|
||||
, fTessellationPatchVertexCount(tessellationPatchVertexCount)
|
||||
, fRenderPassXferBarriers(renderPassXferBarriers)
|
||||
, fColorLoadOp(colorLoadOp)
|
||||
, fIsMixedSampled(this->isStencilEnabled() && numStencilSamples > numSamples) {
|
||||
SkASSERT(this->numRasterSamples() > 0);
|
||||
SkASSERT((GrPrimitiveType::kPatches == fPrimitiveType) ==
|
||||
@ -76,6 +78,8 @@ public:
|
||||
|
||||
GrXferBarrierFlags renderPassBarriers() const { return fRenderPassXferBarriers; }
|
||||
|
||||
GrLoadOp colorLoadOp() const { return fColorLoadOp; }
|
||||
|
||||
uint16_t primitiveTypeKey() const {
|
||||
return ((uint16_t)fPrimitiveType << 8) | fTessellationPatchVertexCount;
|
||||
}
|
||||
@ -111,6 +115,7 @@ private:
|
||||
GrPrimitiveType fPrimitiveType;
|
||||
uint8_t fTessellationPatchVertexCount; // GrPrimType::kPatches.
|
||||
GrXferBarrierFlags fRenderPassXferBarriers;
|
||||
GrLoadOp fColorLoadOp;
|
||||
const bool fIsMixedSampled;
|
||||
};
|
||||
|
||||
|
@ -202,6 +202,7 @@ void GrCCCoverageProcessor::bindPipeline(GrOpFlushState* flushState, const GrPip
|
||||
flushState->proxy()->numStencilSamples(),
|
||||
flushState->proxy()->backendFormat(),
|
||||
flushState->writeView().origin(), &pipeline, stencil, this,
|
||||
this->primType(), 0, flushState->renderPassBarriers());
|
||||
this->primType(), 0, flushState->renderPassBarriers(),
|
||||
flushState->colorLoadOp());
|
||||
flushState->bindPipeline(programInfo, drawBounds);
|
||||
}
|
||||
|
@ -75,7 +75,8 @@ private:
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip*,
|
||||
const GrXferProcessor::DstProxyView&,
|
||||
GrXferBarrierFlags renderPassXferBarriers) override {}
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) override {}
|
||||
|
||||
friend class GrOp;
|
||||
|
||||
|
@ -148,7 +148,7 @@ void GrCCPathProcessor::drawPaths(GrOpFlushState* flushState, const GrPipeline&
|
||||
GrProgramInfo programInfo(rtProxy->numSamples(), rtProxy->numStencilSamples(),
|
||||
rtProxy->backendFormat(), flushState->writeView().origin(),
|
||||
&pipeline, &GrUserStencilSettings::kUnused, this, primitiveType, 0,
|
||||
flushState->renderPassBarriers());
|
||||
flushState->renderPassBarriers(), flushState->colorLoadOp());
|
||||
|
||||
flushState->bindPipelineAndScissorClip(programInfo, bounds);
|
||||
flushState->bindTextures(*this, atlasProxy, pipeline);
|
||||
|
@ -60,7 +60,8 @@ private:
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip*,
|
||||
const GrXferProcessor::DstProxyView&,
|
||||
GrXferBarrierFlags renderPassXferBarriers) final {}
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) final {}
|
||||
void onPrepare(GrOpFlushState*) final {}
|
||||
};
|
||||
|
||||
|
@ -731,7 +731,8 @@ void GrCCStroker::drawLog2Strokes(int numSegmentsLog2, GrOpFlushState* flushStat
|
||||
flushState->proxy()->backendFormat(),
|
||||
flushState->writeView().origin(), &pipeline,
|
||||
&GrUserStencilSettings::kUnused, &processor,
|
||||
GrPrimitiveType::kTriangleStrip, 0, flushState->renderPassBarriers());
|
||||
GrPrimitiveType::kTriangleStrip, 0, flushState->renderPassBarriers(),
|
||||
flushState->colorLoadOp());
|
||||
|
||||
flushState->bindPipeline(programInfo, SkRect::Make(drawBounds));
|
||||
flushState->bindBuffers(nullptr, fInstanceBuffer, nullptr);
|
||||
|
@ -183,7 +183,8 @@ void GrStencilAtlasOp::drawResolve(GrOpFlushState* flushState, const GrPipeline&
|
||||
flushState->proxy()->backendFormat(),
|
||||
flushState->writeView().origin(), &resolvePipeline, stencil,
|
||||
&primProc, GrPrimitiveType::kTriangleStrip, 0,
|
||||
flushState->renderPassBarriers());
|
||||
flushState->renderPassBarriers(),
|
||||
flushState->colorLoadOp());
|
||||
flushState->bindPipeline(programInfo, SkRect::Make(drawBounds));
|
||||
flushState->setScissorRect(drawBounds);
|
||||
flushState->bindBuffers(nullptr, fResources->stencilResolveBuffer(), nullptr);
|
||||
|
@ -56,7 +56,8 @@ private:
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip*,
|
||||
const GrXferProcessor::DstProxyView&,
|
||||
GrXferBarrierFlags renderPassXferBarriers) override {}
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) override {}
|
||||
void onPrepare(GrOpFlushState*) override {}
|
||||
void onExecute(GrOpFlushState*, const SkRect& chainBounds) override;
|
||||
void drawResolve(GrOpFlushState*, const GrPipeline&, const GrUserStencilSettings*,
|
||||
|
@ -32,6 +32,7 @@ public:
|
||||
GrAppliedClip detachAppliedClip() override { return GrAppliedClip::Disabled(); }
|
||||
const GrXferProcessor::DstProxyView& dstProxyView() const override { return fDstProxyView; }
|
||||
GrXferBarrierFlags renderPassBarriers() const override { return GrXferBarrierFlags::kNone; }
|
||||
GrLoadOp colorLoadOp() const override { return GrLoadOp::kLoad; }
|
||||
|
||||
void* makeVertexSpace(size_t vertexSize, int vertexCount, sk_sp<const GrBuffer>*,
|
||||
int* startVertex) override {
|
||||
|
@ -743,7 +743,8 @@ private:
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip&& appliedClip,
|
||||
const GrXferProcessor::DstProxyView& dstProxyView,
|
||||
GrXferBarrierFlags renderPassXferBarriers) override {
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) override {
|
||||
SkMatrix invert;
|
||||
if (fHelper.usesLocalCoords() && !fPaths.back().fViewMatrix.invert(&invert)) {
|
||||
return;
|
||||
@ -757,7 +758,7 @@ private:
|
||||
std::move(appliedClip),
|
||||
dstProxyView, quadProcessor,
|
||||
GrPrimitiveType::kTriangles,
|
||||
renderPassXferBarriers);
|
||||
renderPassXferBarriers, colorLoadOp);
|
||||
}
|
||||
|
||||
void onPrepareDraws(Target* target) override {
|
||||
|
@ -879,17 +879,20 @@ private:
|
||||
const GrSurfaceProxyView& writeView,
|
||||
const SkMatrix* geometryProcessorViewM,
|
||||
const SkMatrix* geometryProcessorLocalM,
|
||||
GrXferBarrierFlags renderPassXferBarriers);
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp);
|
||||
void makeQuadProgramInfo(const GrCaps&, SkArenaAlloc*, const GrPipeline*,
|
||||
const GrSurfaceProxyView& writeView,
|
||||
const SkMatrix* geometryProcessorViewM,
|
||||
const SkMatrix* geometryProcessorLocalM,
|
||||
GrXferBarrierFlags renderPassXferBarriers);
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp);
|
||||
void makeConicProgramInfo(const GrCaps&, SkArenaAlloc*, const GrPipeline*,
|
||||
const GrSurfaceProxyView& writeView,
|
||||
const SkMatrix* geometryProcessorViewM,
|
||||
const SkMatrix* geometryProcessorLocalM,
|
||||
GrXferBarrierFlags renderPassXferBarriers);
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp);
|
||||
|
||||
GrProgramInfo* programInfo() override {
|
||||
// This Op has 3 programInfos and implements its own onPrePrepareDraws so this entry point
|
||||
@ -905,13 +908,15 @@ private:
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip&&,
|
||||
const GrXferProcessor::DstProxyView&,
|
||||
GrXferBarrierFlags renderPassXferBarriers) override;
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) override;
|
||||
|
||||
void onPrePrepareDraws(GrRecordingContext*,
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip*,
|
||||
const GrXferProcessor::DstProxyView&,
|
||||
GrXferBarrierFlags renderPassXferBarriers) override;
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) override;
|
||||
|
||||
void onPrepareDraws(Target*) override;
|
||||
void onExecute(GrOpFlushState*, const SkRect& chainBounds) override;
|
||||
@ -995,7 +1000,8 @@ void AAHairlineOp::makeLineProgramInfo(const GrCaps& caps, SkArenaAlloc* arena,
|
||||
const GrSurfaceProxyView& writeView,
|
||||
const SkMatrix* geometryProcessorViewM,
|
||||
const SkMatrix* geometryProcessorLocalM,
|
||||
GrXferBarrierFlags renderPassXferBarriers) {
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) {
|
||||
if (fProgramInfos[0]) {
|
||||
return;
|
||||
}
|
||||
@ -1019,7 +1025,7 @@ void AAHairlineOp::makeLineProgramInfo(const GrCaps& caps, SkArenaAlloc* arena,
|
||||
|
||||
fProgramInfos[0] = GrSimpleMeshDrawOpHelper::CreateProgramInfo(
|
||||
arena, pipeline, writeView, lineGP, GrPrimitiveType::kTriangles,
|
||||
renderPassXferBarriers, fHelper.stencilSettings());
|
||||
renderPassXferBarriers, colorLoadOp, fHelper.stencilSettings());
|
||||
}
|
||||
|
||||
void AAHairlineOp::makeQuadProgramInfo(const GrCaps& caps, SkArenaAlloc* arena,
|
||||
@ -1027,7 +1033,8 @@ void AAHairlineOp::makeQuadProgramInfo(const GrCaps& caps, SkArenaAlloc* arena,
|
||||
const GrSurfaceProxyView& writeView,
|
||||
const SkMatrix* geometryProcessorViewM,
|
||||
const SkMatrix* geometryProcessorLocalM,
|
||||
GrXferBarrierFlags renderPassXferBarriers) {
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) {
|
||||
if (fProgramInfos[1]) {
|
||||
return;
|
||||
}
|
||||
@ -1043,7 +1050,7 @@ void AAHairlineOp::makeQuadProgramInfo(const GrCaps& caps, SkArenaAlloc* arena,
|
||||
|
||||
fProgramInfos[1] = GrSimpleMeshDrawOpHelper::CreateProgramInfo(
|
||||
arena, pipeline, writeView, quadGP, GrPrimitiveType::kTriangles,
|
||||
renderPassXferBarriers, fHelper.stencilSettings());
|
||||
renderPassXferBarriers, colorLoadOp, fHelper.stencilSettings());
|
||||
}
|
||||
|
||||
void AAHairlineOp::makeConicProgramInfo(const GrCaps& caps, SkArenaAlloc* arena,
|
||||
@ -1051,7 +1058,8 @@ void AAHairlineOp::makeConicProgramInfo(const GrCaps& caps, SkArenaAlloc* arena,
|
||||
const GrSurfaceProxyView& writeView,
|
||||
const SkMatrix* geometryProcessorViewM,
|
||||
const SkMatrix* geometryProcessorLocalM,
|
||||
GrXferBarrierFlags renderPassXferBarriers) {
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) {
|
||||
if (fProgramInfos[2]) {
|
||||
return;
|
||||
}
|
||||
@ -1067,7 +1075,7 @@ void AAHairlineOp::makeConicProgramInfo(const GrCaps& caps, SkArenaAlloc* arena,
|
||||
|
||||
fProgramInfos[2] = GrSimpleMeshDrawOpHelper::CreateProgramInfo(
|
||||
arena, pipeline, writeView, conicGP, GrPrimitiveType::kTriangles,
|
||||
renderPassXferBarriers, fHelper.stencilSettings());
|
||||
renderPassXferBarriers, colorLoadOp, fHelper.stencilSettings());
|
||||
}
|
||||
|
||||
AAHairlineOp::Program AAHairlineOp::predictPrograms(const GrCaps* caps) const {
|
||||
@ -1101,7 +1109,8 @@ void AAHairlineOp::onCreateProgramInfo(const GrCaps* caps,
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip&& appliedClip,
|
||||
const GrXferProcessor::DstProxyView& dstProxyView,
|
||||
GrXferBarrierFlags renderPassXferBarriers) {
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) {
|
||||
// Setup the viewmatrix and localmatrix for the GrGeometryProcessor.
|
||||
SkMatrix invert;
|
||||
if (!this->viewMatrix().invert(&invert)) {
|
||||
@ -1123,17 +1132,17 @@ void AAHairlineOp::onCreateProgramInfo(const GrCaps* caps,
|
||||
if (fCharacterization & kLine_Program) {
|
||||
this->makeLineProgramInfo(*caps, arena, pipeline, writeView,
|
||||
geometryProcessorViewM, geometryProcessorLocalM,
|
||||
renderPassXferBarriers);
|
||||
renderPassXferBarriers, colorLoadOp);
|
||||
}
|
||||
if (fCharacterization & kQuad_Program) {
|
||||
this->makeQuadProgramInfo(*caps, arena, pipeline, writeView,
|
||||
geometryProcessorViewM, geometryProcessorLocalM,
|
||||
renderPassXferBarriers);
|
||||
renderPassXferBarriers, colorLoadOp);
|
||||
}
|
||||
if (fCharacterization & kConic_Program) {
|
||||
this->makeConicProgramInfo(*caps, arena, pipeline, writeView,
|
||||
geometryProcessorViewM, geometryProcessorLocalM,
|
||||
renderPassXferBarriers);
|
||||
renderPassXferBarriers, colorLoadOp);
|
||||
|
||||
}
|
||||
}
|
||||
@ -1142,7 +1151,8 @@ void AAHairlineOp::onPrePrepareDraws(GrRecordingContext* context,
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip* clip,
|
||||
const GrXferProcessor::DstProxyView& dstProxyView,
|
||||
GrXferBarrierFlags renderPassXferBarriers) {
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) {
|
||||
SkArenaAlloc* arena = context->priv().recordTimeAllocator();
|
||||
const GrCaps* caps = context->priv().caps();
|
||||
|
||||
@ -1153,7 +1163,7 @@ void AAHairlineOp::onPrePrepareDraws(GrRecordingContext* context,
|
||||
fCharacterization = this->predictPrograms(caps);
|
||||
|
||||
this->createProgramInfo(caps, arena, writeView, std::move(appliedClip), dstProxyView,
|
||||
renderPassXferBarriers);
|
||||
renderPassXferBarriers, colorLoadOp);
|
||||
|
||||
context->priv().recordProgramInfo(fProgramInfos[0]);
|
||||
context->priv().recordProgramInfo(fProgramInfos[1]);
|
||||
|
@ -205,7 +205,8 @@ private:
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip&& appliedClip,
|
||||
const GrXferProcessor::DstProxyView& dstProxyView,
|
||||
GrXferBarrierFlags renderPassXferBarriers) override {
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) override {
|
||||
GrGeometryProcessor* gp = create_lines_only_gp(arena,
|
||||
fHelper.compatibleWithCoverageAsAlpha(),
|
||||
fHelper.usesLocalCoords(),
|
||||
@ -218,7 +219,7 @@ private:
|
||||
fProgramInfo = fHelper.createProgramInfoWithStencil(caps, arena, writeView,
|
||||
std::move(appliedClip), dstProxyView,
|
||||
gp, GrPrimitiveType::kTriangles,
|
||||
renderPassXferBarriers);
|
||||
renderPassXferBarriers, colorLoadOp);
|
||||
}
|
||||
|
||||
void recordDraw(Target* target,
|
||||
|
@ -115,7 +115,8 @@ private:
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip&&,
|
||||
const GrXferProcessor::DstProxyView&,
|
||||
GrXferBarrierFlags renderPassXferBarriers) override {
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) override {
|
||||
// We cannot surface the GrAtlasTextOp's programInfo at record time. As currently
|
||||
// implemented, the GP is modified at flush time based on the number of pages in the
|
||||
// atlas.
|
||||
@ -125,7 +126,8 @@ private:
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip*,
|
||||
const GrXferProcessor::DstProxyView&,
|
||||
GrXferBarrierFlags renderPassXferBarriers) override {
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) override {
|
||||
// TODO [PI]: implement
|
||||
}
|
||||
|
||||
|
@ -47,7 +47,7 @@ private:
|
||||
|
||||
void onPrePrepare(GrRecordingContext*, const GrSurfaceProxyView& writeView, GrAppliedClip*,
|
||||
const GrXferProcessor::DstProxyView&,
|
||||
GrXferBarrierFlags renderPassXferBarriers) override {}
|
||||
GrXferBarrierFlags renderPassXferBarriers, GrLoadOp colorLoadOp) override {}
|
||||
|
||||
void onPrepare(GrOpFlushState*) override {}
|
||||
|
||||
|
@ -320,7 +320,8 @@ private:
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip&& appliedClip,
|
||||
const GrXferProcessor::DstProxyView& dstProxyView,
|
||||
GrXferBarrierFlags renderPassXferBarriers) override {
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) override {
|
||||
|
||||
DashCap capType = (this->cap() == SkPaint::kRound_Cap) ? kRound_DashCap : kNonRound_DashCap;
|
||||
|
||||
@ -360,6 +361,7 @@ private:
|
||||
std::move(fProcessorSet),
|
||||
GrPrimitiveType::kTriangles,
|
||||
renderPassXferBarriers,
|
||||
colorLoadOp,
|
||||
pipelineFlags,
|
||||
fStencilSettings);
|
||||
}
|
||||
|
@ -421,7 +421,8 @@ private:
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip&& appliedClip,
|
||||
const GrXferProcessor::DstProxyView& dstProxyView,
|
||||
GrXferBarrierFlags renderPassXferBarriers) override {
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) override {
|
||||
GrGeometryProcessor* gp;
|
||||
{
|
||||
using namespace GrDefaultGeoProcFactory;
|
||||
@ -441,7 +442,7 @@ private:
|
||||
fProgramInfo = fHelper.createProgramInfoWithStencil(caps, arena, writeView,
|
||||
std::move(appliedClip),
|
||||
dstProxyView, gp, this->primType(),
|
||||
renderPassXferBarriers);
|
||||
renderPassXferBarriers, colorLoadOp);
|
||||
|
||||
}
|
||||
|
||||
|
@ -57,7 +57,8 @@ private:
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip&&,
|
||||
const GrXferProcessor::DstProxyView&,
|
||||
GrXferBarrierFlags renderPassXferBarriers) override;
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) override;
|
||||
|
||||
void onPrepareDraws(Target*) override;
|
||||
void onExecute(GrOpFlushState*, const SkRect& chainBounds) override;
|
||||
@ -203,7 +204,8 @@ void DrawAtlasOp::onCreateProgramInfo(const GrCaps* caps,
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip&& appliedClip,
|
||||
const GrXferProcessor::DstProxyView& dstProxyView,
|
||||
GrXferBarrierFlags renderPassXferBarriers) {
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) {
|
||||
// Setup geometry processor
|
||||
GrGeometryProcessor* gp = make_gp(arena,
|
||||
this->hasColors(),
|
||||
@ -212,7 +214,7 @@ void DrawAtlasOp::onCreateProgramInfo(const GrCaps* caps,
|
||||
|
||||
fProgramInfo = fHelper.createProgramInfo(caps, arena, writeView, std::move(appliedClip),
|
||||
dstProxyView, gp, GrPrimitiveType::kTriangles,
|
||||
renderPassXferBarriers);
|
||||
renderPassXferBarriers, colorLoadOp);
|
||||
}
|
||||
|
||||
void DrawAtlasOp::onPrepareDraws(Target* target) {
|
||||
|
@ -95,7 +95,8 @@ void GrDrawPathOp::onExecute(GrOpFlushState* flushState, const SkRect& chainBoun
|
||||
pathProc.get(),
|
||||
GrPrimitiveType::kPath,
|
||||
0,
|
||||
flushState->renderPassBarriers());
|
||||
flushState->renderPassBarriers(),
|
||||
flushState->colorLoadOp());
|
||||
|
||||
flushState->bindPipelineAndScissorClip(programInfo, this->bounds());
|
||||
flushState->bindTextures(programInfo.primProc(), nullptr, programInfo.pipeline());
|
||||
|
@ -58,7 +58,8 @@ private:
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip*,
|
||||
const GrXferProcessor::DstProxyView&,
|
||||
GrXferBarrierFlags renderPassXferBarriers) final {}
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) final {}
|
||||
|
||||
void onPrepare(GrOpFlushState*) final {}
|
||||
|
||||
|
@ -468,7 +468,8 @@ private:
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip&&,
|
||||
const GrXferProcessor::DstProxyView&,
|
||||
GrXferBarrierFlags renderPassXferBarriers) override;
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) override;
|
||||
|
||||
void onPrepareDraws(Target*) override;
|
||||
void onExecute(GrOpFlushState*, const SkRect& chainBounds) override;
|
||||
@ -636,11 +637,12 @@ void DrawVerticesOp::onCreateProgramInfo(const GrCaps* caps,
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip&& appliedClip,
|
||||
const GrXferProcessor::DstProxyView& dstProxyView,
|
||||
GrXferBarrierFlags renderPassXferBarriers) {
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) {
|
||||
GrGeometryProcessor* gp = this->makeGP(arena);
|
||||
fProgramInfo = fHelper.createProgramInfo(caps, arena, writeView, std::move(appliedClip),
|
||||
dstProxyView, gp, this->primitiveType(),
|
||||
renderPassXferBarriers);
|
||||
renderPassXferBarriers, colorLoadOp);
|
||||
}
|
||||
|
||||
void DrawVerticesOp::onPrepareDraws(Target* target) {
|
||||
|
@ -39,7 +39,8 @@ private:
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip*,
|
||||
const GrXferProcessor::DstProxyView&,
|
||||
GrXferBarrierFlags renderPassXferBarriers) override {}
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) override {}
|
||||
|
||||
void onPrepare(GrOpFlushState*) override {}
|
||||
|
||||
|
@ -105,7 +105,8 @@ private:
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip&&,
|
||||
const GrXferProcessor::DstProxyView&,
|
||||
GrXferBarrierFlags renderPassXferBarriers) final;
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) final;
|
||||
|
||||
Helper fHelper;
|
||||
SkPMColor4f fColor;
|
||||
@ -855,13 +856,14 @@ void FillRRectOp::onCreateProgramInfo(const GrCaps* caps,
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip&& appliedClip,
|
||||
const GrXferProcessor::DstProxyView& dstProxyView,
|
||||
GrXferBarrierFlags renderPassXferBarriers) {
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) {
|
||||
GrGeometryProcessor* gp = Processor::Make(arena, fHelper.aaType(), fProcessorFlags);
|
||||
SkASSERT(gp->instanceStride() == (size_t)fInstanceStride);
|
||||
|
||||
fProgramInfo = fHelper.createProgramInfo(caps, arena, writeView, std::move(appliedClip),
|
||||
dstProxyView, gp, GrPrimitiveType::kTriangles,
|
||||
renderPassXferBarriers);
|
||||
renderPassXferBarriers, colorLoadOp);
|
||||
}
|
||||
|
||||
void FillRRectOp::onExecute(GrOpFlushState* flushState, const SkRect& chainBounds) {
|
||||
|
@ -206,7 +206,8 @@ private:
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip&& appliedClip,
|
||||
const GrXferProcessor::DstProxyView& dstProxyView,
|
||||
GrXferBarrierFlags renderPassXferBarriers) override {
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) override {
|
||||
const VertexSpec vertexSpec = this->vertexSpec();
|
||||
|
||||
GrGeometryProcessor* gp = GrQuadPerEdgeAA::MakeProcessor(arena, vertexSpec);
|
||||
@ -216,20 +217,21 @@ private:
|
||||
std::move(appliedClip),
|
||||
dstProxyView, gp,
|
||||
vertexSpec.primitiveType(),
|
||||
renderPassXferBarriers);
|
||||
renderPassXferBarriers, colorLoadOp);
|
||||
}
|
||||
|
||||
void onPrePrepareDraws(GrRecordingContext* rContext,
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip* clip,
|
||||
const GrXferProcessor::DstProxyView& dstProxyView,
|
||||
GrXferBarrierFlags renderPassXferBarriers) override {
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) override {
|
||||
TRACE_EVENT0("skia.gpu", TRACE_FUNC);
|
||||
|
||||
SkASSERT(!fPrePreparedVertices);
|
||||
|
||||
INHERITED::onPrePrepareDraws(rContext, writeView, clip, dstProxyView,
|
||||
renderPassXferBarriers);
|
||||
renderPassXferBarriers, colorLoadOp);
|
||||
|
||||
SkArenaAlloc* arena = rContext->priv().recordTimeAllocator();
|
||||
|
||||
|
@ -198,7 +198,8 @@ private:
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip&& appliedClip,
|
||||
const GrXferProcessor::DstProxyView& dstProxyView,
|
||||
GrXferBarrierFlags renderPassXferBarriers) override {
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) override {
|
||||
|
||||
auto gp = LatticeGP::Make(arena, fView, fColorSpaceXform, fFilter, fWideColor);
|
||||
if (!gp) {
|
||||
@ -211,6 +212,7 @@ private:
|
||||
fHelper.detachProcessorSet(),
|
||||
GrPrimitiveType::kTriangles,
|
||||
renderPassXferBarriers,
|
||||
colorLoadOp,
|
||||
fHelper.pipelineFlags(),
|
||||
&GrUserStencilSettings::kUnused);
|
||||
}
|
||||
|
@ -22,7 +22,8 @@ void GrMeshDrawOp::createProgramInfo(Target* target) {
|
||||
target->writeView(),
|
||||
target->detachAppliedClip(),
|
||||
target->dstProxyView(),
|
||||
target->renderPassBarriers());
|
||||
target->renderPassBarriers(),
|
||||
target->colorLoadOp());
|
||||
}
|
||||
|
||||
// This onPrepareDraws implementation assumes the derived Op only has a single programInfo -
|
||||
@ -31,14 +32,16 @@ void GrMeshDrawOp::onPrePrepareDraws(GrRecordingContext* context,
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip* clip,
|
||||
const GrXferProcessor::DstProxyView& dstProxyView,
|
||||
GrXferBarrierFlags renderPassXferBarriers) {
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) {
|
||||
SkArenaAlloc* arena = context->priv().recordTimeAllocator();
|
||||
|
||||
// This is equivalent to a GrOpFlushState::detachAppliedClip
|
||||
GrAppliedClip appliedClip = clip ? std::move(*clip) : GrAppliedClip::Disabled();
|
||||
|
||||
this->createProgramInfo(context->priv().caps(), arena, writeView,
|
||||
std::move(appliedClip), dstProxyView, renderPassXferBarriers);
|
||||
std::move(appliedClip), dstProxyView, renderPassXferBarriers,
|
||||
colorLoadOp);
|
||||
|
||||
// TODO: at this point we've created both the program info and desc in the recording context's
|
||||
// arena. In the DDL case, it would be cool if 'recordProgramInfo' could return the
|
||||
|
@ -42,9 +42,10 @@ protected:
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip&& appliedClip,
|
||||
const GrXferProcessor::DstProxyView& dstProxyView,
|
||||
GrXferBarrierFlags renderPassXferBarriers) {
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) {
|
||||
this->onCreateProgramInfo(caps, arena, writeView, std::move(appliedClip), dstProxyView,
|
||||
renderPassXferBarriers);
|
||||
renderPassXferBarriers, colorLoadOp);
|
||||
}
|
||||
|
||||
void createProgramInfo(Target* target);
|
||||
@ -106,7 +107,8 @@ protected:
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip*,
|
||||
const GrXferProcessor::DstProxyView&,
|
||||
GrXferBarrierFlags renderPassXferBarriers);
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp);
|
||||
|
||||
private:
|
||||
virtual GrProgramInfo* programInfo() = 0;
|
||||
@ -117,14 +119,17 @@ private:
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip&&,
|
||||
const GrXferProcessor::DstProxyView&,
|
||||
GrXferBarrierFlags renderPassXferBarriers) = 0;
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) = 0;
|
||||
|
||||
void onPrePrepare(GrRecordingContext* context,
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip* clip,
|
||||
const GrXferProcessor::DstProxyView& dstProxyView,
|
||||
GrXferBarrierFlags renderPassXferBarriers) final {
|
||||
this->onPrePrepareDraws(context, writeView, clip, dstProxyView, renderPassXferBarriers);
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) final {
|
||||
this->onPrePrepareDraws(context, writeView, clip, dstProxyView, renderPassXferBarriers,
|
||||
colorLoadOp);
|
||||
}
|
||||
void onPrepare(GrOpFlushState* state) final;
|
||||
|
||||
@ -225,6 +230,8 @@ public:
|
||||
|
||||
virtual GrXferBarrierFlags renderPassBarriers() const = 0;
|
||||
|
||||
virtual GrLoadOp colorLoadOp() const = 0;
|
||||
|
||||
virtual GrThreadSafeCache* threadSafeCache() const = 0;
|
||||
virtual GrResourceProvider* resourceProvider() const = 0;
|
||||
uint32_t contextUniqueID() const { return this->resourceProvider()->contextUniqueID(); }
|
||||
|
@ -210,8 +210,9 @@ public:
|
||||
*/
|
||||
void prePrepare(GrRecordingContext* context, const GrSurfaceProxyView& dstView,
|
||||
GrAppliedClip* clip, const GrXferProcessor::DstProxyView& dstProxyView,
|
||||
GrXferBarrierFlags renderPassXferBarriers) {
|
||||
this->onPrePrepare(context, dstView, clip, dstProxyView, renderPassXferBarriers);
|
||||
GrXferBarrierFlags renderPassXferBarriers, GrLoadOp colorLoadOp) {
|
||||
this->onPrePrepare(context, dstView, clip, dstProxyView, renderPassXferBarriers,
|
||||
colorLoadOp);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -344,7 +345,8 @@ private:
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip*,
|
||||
const GrXferProcessor::DstProxyView&,
|
||||
GrXferBarrierFlags renderPassXferBarriers) = 0;
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) = 0;
|
||||
virtual void onPrepare(GrOpFlushState*) = 0;
|
||||
// If this op is chained then chainBounds is the union of the bounds of all ops in the chain.
|
||||
// Otherwise, this op's bounds.
|
||||
|
@ -1244,7 +1244,8 @@ private:
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip&& appliedClip,
|
||||
const GrXferProcessor::DstProxyView& dstProxyView,
|
||||
GrXferBarrierFlags renderPassXferBarriers) override {
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) override {
|
||||
SkMatrix localMatrix;
|
||||
if (!fViewMatrixIfUsingLocalCoords.invert(&localMatrix)) {
|
||||
return;
|
||||
@ -1257,7 +1258,7 @@ private:
|
||||
|
||||
fProgramInfo = fHelper.createProgramInfo(caps, arena, writeView, std::move(appliedClip),
|
||||
dstProxyView, gp, GrPrimitiveType::kTriangles,
|
||||
renderPassXferBarriers);
|
||||
renderPassXferBarriers, colorLoadOp);
|
||||
}
|
||||
|
||||
void onPrepareDraws(Target* target) override {
|
||||
@ -1606,7 +1607,8 @@ private:
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip&& appliedClip,
|
||||
const GrXferProcessor::DstProxyView& dstProxyView,
|
||||
GrXferBarrierFlags renderPassXferBarriers) override {
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) override {
|
||||
SkMatrix localMatrix;
|
||||
if (!fViewMatrixIfUsingLocalCoords.invert(&localMatrix)) {
|
||||
return;
|
||||
@ -1619,7 +1621,7 @@ private:
|
||||
|
||||
fProgramInfo = fHelper.createProgramInfo(caps, arena, writeView, std::move(appliedClip),
|
||||
dstProxyView, gp, GrPrimitiveType::kTriangles,
|
||||
renderPassXferBarriers);
|
||||
renderPassXferBarriers, colorLoadOp);
|
||||
}
|
||||
|
||||
void onPrepareDraws(Target* target) override {
|
||||
@ -1939,7 +1941,8 @@ private:
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip&& appliedClip,
|
||||
const GrXferProcessor::DstProxyView& dstProxyView,
|
||||
GrXferBarrierFlags renderPassXferBarriers) override {
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) override {
|
||||
SkMatrix localMatrix;
|
||||
if (!fViewMatrixIfUsingLocalCoords.invert(&localMatrix)) {
|
||||
return;
|
||||
@ -1950,7 +1953,7 @@ private:
|
||||
|
||||
fProgramInfo = fHelper.createProgramInfo(caps, arena, writeView, std::move(appliedClip),
|
||||
dstProxyView, gp, GrPrimitiveType::kTriangles,
|
||||
renderPassXferBarriers);
|
||||
renderPassXferBarriers, colorLoadOp);
|
||||
}
|
||||
|
||||
void onPrepareDraws(Target* target) override {
|
||||
@ -2215,14 +2218,15 @@ private:
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip&& appliedClip,
|
||||
const GrXferProcessor::DstProxyView& dstProxyView,
|
||||
GrXferBarrierFlags renderPassXferBarriers) override {
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) override {
|
||||
GrGeometryProcessor* gp = DIEllipseGeometryProcessor::Make(arena, fWideColor, fUseScale,
|
||||
this->viewMatrix(),
|
||||
this->style());
|
||||
|
||||
fProgramInfo = fHelper.createProgramInfo(caps, arena, writeView, std::move(appliedClip),
|
||||
dstProxyView, gp, GrPrimitiveType::kTriangles,
|
||||
renderPassXferBarriers);
|
||||
renderPassXferBarriers, colorLoadOp);
|
||||
}
|
||||
|
||||
void onPrepareDraws(Target* target) override {
|
||||
@ -2613,7 +2617,8 @@ private:
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip&& appliedClip,
|
||||
const GrXferProcessor::DstProxyView& dstProxyView,
|
||||
GrXferBarrierFlags renderPassXferBarriers) override {
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) override {
|
||||
// Invert the view matrix as a local matrix (if any other processors require coords).
|
||||
SkMatrix localMatrix;
|
||||
if (!fViewMatrixIfUsingLocalCoords.invert(&localMatrix)) {
|
||||
@ -2626,7 +2631,7 @@ private:
|
||||
|
||||
fProgramInfo = fHelper.createProgramInfo(caps, arena, writeView, std::move(appliedClip),
|
||||
dstProxyView, gp, GrPrimitiveType::kTriangles,
|
||||
renderPassXferBarriers);
|
||||
renderPassXferBarriers, colorLoadOp);
|
||||
}
|
||||
|
||||
void onPrepareDraws(Target* target) override {
|
||||
@ -2936,7 +2941,8 @@ private:
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip&& appliedClip,
|
||||
const GrXferProcessor::DstProxyView& dstProxyView,
|
||||
GrXferBarrierFlags renderPassXferBarriers) override {
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) override {
|
||||
SkMatrix localMatrix;
|
||||
if (!fViewMatrixIfUsingLocalCoords.invert(&localMatrix)) {
|
||||
return;
|
||||
@ -2947,7 +2953,7 @@ private:
|
||||
|
||||
fProgramInfo = fHelper.createProgramInfo(caps, arena, writeView, std::move(appliedClip),
|
||||
dstProxyView, gp, GrPrimitiveType::kTriangles,
|
||||
renderPassXferBarriers);
|
||||
renderPassXferBarriers, colorLoadOp);
|
||||
}
|
||||
|
||||
void onPrepareDraws(Target* target) override {
|
||||
|
@ -90,7 +90,8 @@ private:
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip&& appliedClip,
|
||||
const GrXferProcessor::DstProxyView& dstProxyView,
|
||||
GrXferBarrierFlags renderPassXferBarriers) override {
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) override {
|
||||
GrGeometryProcessor* gp = make_gp(arena, fViewMatrix, fWideColor);
|
||||
if (!gp) {
|
||||
SkDebugf("Couldn't create GrGeometryProcessor\n");
|
||||
@ -100,7 +101,7 @@ private:
|
||||
fProgramInfo = fHelper.createProgramInfoWithStencil(caps, arena, writeView,
|
||||
std::move(appliedClip), dstProxyView,
|
||||
gp, GrPrimitiveType::kTriangles,
|
||||
renderPassXferBarriers);
|
||||
renderPassXferBarriers, colorLoadOp);
|
||||
}
|
||||
|
||||
void onPrepareDraws(Target* target) override {
|
||||
|
@ -531,7 +531,8 @@ private:
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip&& appliedClip,
|
||||
const GrXferProcessor::DstProxyView& dstProxyView,
|
||||
GrXferBarrierFlags renderPassXferBarriers) override {
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) override {
|
||||
GrGeometryProcessor* gp = GrRRectShadowGeoProc::Make(arena, fFalloffView);
|
||||
SkASSERT(sizeof(CircleVertex) == gp->vertexStride());
|
||||
|
||||
@ -541,6 +542,7 @@ private:
|
||||
GrProcessorSet::MakeEmptySet(),
|
||||
GrPrimitiveType::kTriangles,
|
||||
renderPassXferBarriers,
|
||||
colorLoadOp,
|
||||
GrPipeline::InputFlags::kNone,
|
||||
&GrUserStencilSettings::kUnused);
|
||||
}
|
||||
|
@ -176,6 +176,7 @@ GrProgramInfo* GrSimpleMeshDrawOpHelper::CreateProgramInfo(
|
||||
GrProcessorSet&& processorSet,
|
||||
GrPrimitiveType primitiveType,
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp,
|
||||
GrPipeline::InputFlags pipelineFlags,
|
||||
const GrUserStencilSettings* stencilSettings) {
|
||||
auto pipeline = CreatePipeline(caps,
|
||||
@ -187,7 +188,7 @@ GrProgramInfo* GrSimpleMeshDrawOpHelper::CreateProgramInfo(
|
||||
pipelineFlags);
|
||||
|
||||
return CreateProgramInfo(arena, pipeline, writeView, geometryProcessor, primitiveType,
|
||||
renderPassXferBarriers, stencilSettings);
|
||||
renderPassXferBarriers, colorLoadOp, stencilSettings);
|
||||
}
|
||||
|
||||
GrProgramInfo* GrSimpleMeshDrawOpHelper::CreateProgramInfo(SkArenaAlloc* arena,
|
||||
@ -196,6 +197,7 @@ GrProgramInfo* GrSimpleMeshDrawOpHelper::CreateProgramInfo(SkArenaAlloc* arena,
|
||||
GrGeometryProcessor* geometryProcessor,
|
||||
GrPrimitiveType primitiveType,
|
||||
GrXferBarrierFlags xferBarrierFlags,
|
||||
GrLoadOp colorLoadOp,
|
||||
const GrUserStencilSettings* stencilSettings) {
|
||||
GrRenderTargetProxy* outputProxy = writeView.asRenderTargetProxy();
|
||||
|
||||
@ -208,7 +210,8 @@ GrProgramInfo* GrSimpleMeshDrawOpHelper::CreateProgramInfo(SkArenaAlloc* arena,
|
||||
geometryProcessor,
|
||||
primitiveType,
|
||||
0,
|
||||
xferBarrierFlags);
|
||||
xferBarrierFlags,
|
||||
colorLoadOp);
|
||||
return tmp;
|
||||
}
|
||||
|
||||
@ -220,7 +223,8 @@ GrProgramInfo* GrSimpleMeshDrawOpHelper::createProgramInfo(
|
||||
const GrXferProcessor::DstProxyView& dstProxyView,
|
||||
GrGeometryProcessor* gp,
|
||||
GrPrimitiveType primType,
|
||||
GrXferBarrierFlags renderPassXferBarriers) {
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) {
|
||||
return CreateProgramInfo(caps,
|
||||
arena,
|
||||
writeView,
|
||||
@ -230,6 +234,7 @@ GrProgramInfo* GrSimpleMeshDrawOpHelper::createProgramInfo(
|
||||
this->detachProcessorSet(),
|
||||
primType,
|
||||
renderPassXferBarriers,
|
||||
colorLoadOp,
|
||||
this->pipelineFlags());
|
||||
}
|
||||
|
||||
|
@ -139,6 +139,7 @@ public:
|
||||
GrGeometryProcessor*,
|
||||
GrPrimitiveType,
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp,
|
||||
const GrUserStencilSettings*
|
||||
= &GrUserStencilSettings::kUnused);
|
||||
|
||||
@ -154,6 +155,7 @@ public:
|
||||
GrProcessorSet&&,
|
||||
GrPrimitiveType,
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp,
|
||||
GrPipeline::InputFlags pipelineFlags
|
||||
= GrPipeline::InputFlags::kNone,
|
||||
const GrUserStencilSettings*
|
||||
@ -166,7 +168,8 @@ public:
|
||||
const GrXferProcessor::DstProxyView&,
|
||||
GrGeometryProcessor*,
|
||||
GrPrimitiveType,
|
||||
GrXferBarrierFlags renderPassXferBarriers);
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp);
|
||||
|
||||
GrProcessorSet detachProcessorSet() {
|
||||
return fProcessors ? std::move(*fProcessors) : GrProcessorSet::MakeEmptySet();
|
||||
|
@ -52,7 +52,8 @@ GrProgramInfo* GrSimpleMeshDrawOpHelperWithStencil::createProgramInfoWithStencil
|
||||
const GrXferProcessor::DstProxyView& dstProxyView,
|
||||
GrGeometryProcessor* gp,
|
||||
GrPrimitiveType primType,
|
||||
GrXferBarrierFlags renderPassXferBarriers) {
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) {
|
||||
return CreateProgramInfo(caps,
|
||||
arena,
|
||||
writeViewSwizzle,
|
||||
@ -62,6 +63,7 @@ GrProgramInfo* GrSimpleMeshDrawOpHelperWithStencil::createProgramInfoWithStencil
|
||||
this->detachProcessorSet(),
|
||||
primType,
|
||||
renderPassXferBarriers,
|
||||
colorLoadOp,
|
||||
this->pipelineFlags(),
|
||||
this->stencilSettings());
|
||||
}
|
||||
|
@ -29,7 +29,8 @@ public:
|
||||
const GrXferProcessor::DstProxyView&,
|
||||
GrGeometryProcessor*,
|
||||
GrPrimitiveType,
|
||||
GrXferBarrierFlags renderPassXferBarriers);
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp);
|
||||
|
||||
// using declarations can't be templated, so this is a pass through function instead.
|
||||
template <typename Op, typename... OpArgs>
|
||||
|
@ -166,7 +166,8 @@ private:
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip&&,
|
||||
const GrXferProcessor::DstProxyView&,
|
||||
GrXferBarrierFlags renderPassXferBarriers) override {
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) override {
|
||||
// We cannot surface the SmallPathOp's programInfo at record time. As currently
|
||||
// implemented, the GP is modified at flush time based on the number of pages in the
|
||||
// atlas.
|
||||
@ -176,7 +177,8 @@ private:
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip*,
|
||||
const GrXferProcessor::DstProxyView&,
|
||||
GrXferBarrierFlags renderPassXferBarriers) override {
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) override {
|
||||
// TODO [PI]: implement
|
||||
}
|
||||
|
||||
|
@ -51,7 +51,8 @@ private:
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip*,
|
||||
const GrXferProcessor::DstProxyView&,
|
||||
GrXferBarrierFlags renderPassXferBarriers) override {}
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) override {}
|
||||
|
||||
void onPrepare(GrOpFlushState*) override {}
|
||||
|
||||
|
@ -175,7 +175,8 @@ private:
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip&& clip,
|
||||
const GrXferProcessor::DstProxyView& dstProxyView,
|
||||
GrXferBarrierFlags renderPassXferBarriers) override {
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) override {
|
||||
GrGeometryProcessor* gp;
|
||||
{
|
||||
using namespace GrDefaultGeoProcFactory;
|
||||
@ -192,7 +193,7 @@ private:
|
||||
|
||||
fProgramInfo = fHelper.createProgramInfo(caps, arena, writeView, std::move(clip),
|
||||
dstProxyView, gp, primType,
|
||||
renderPassXferBarriers);
|
||||
renderPassXferBarriers, colorLoadOp);
|
||||
}
|
||||
|
||||
void onPrepareDraws(Target* target) override {
|
||||
@ -443,7 +444,8 @@ private:
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip&&,
|
||||
const GrXferProcessor::DstProxyView&,
|
||||
GrXferBarrierFlags renderPassXferBarriers) override;
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) override;
|
||||
|
||||
void onPrepareDraws(Target*) override;
|
||||
void onExecute(GrOpFlushState*, const SkRect& chainBounds) override;
|
||||
@ -519,7 +521,8 @@ void AAStrokeRectOp::onCreateProgramInfo(const GrCaps* caps,
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip&& appliedClip,
|
||||
const GrXferProcessor::DstProxyView& dstProxyView,
|
||||
GrXferBarrierFlags renderPassXferBarriers) {
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) {
|
||||
|
||||
GrGeometryProcessor* gp = create_aa_stroke_rect_gp(arena,
|
||||
fHelper.compatibleWithCoverageAsAlpha(),
|
||||
@ -538,7 +541,8 @@ void AAStrokeRectOp::onCreateProgramInfo(const GrCaps* caps,
|
||||
dstProxyView,
|
||||
gp,
|
||||
GrPrimitiveType::kTriangles,
|
||||
renderPassXferBarriers);
|
||||
renderPassXferBarriers,
|
||||
colorLoadOp);
|
||||
}
|
||||
|
||||
void AAStrokeRectOp::onPrepareDraws(Target* target) {
|
||||
|
@ -649,7 +649,8 @@ private:
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip&& appliedClip,
|
||||
const GrXferProcessor::DstProxyView& dstProxyView,
|
||||
GrXferBarrierFlags renderPassXferBarriers) override {
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) override {
|
||||
SkASSERT(fDesc);
|
||||
|
||||
GrGeometryProcessor* gp;
|
||||
@ -674,14 +675,15 @@ private:
|
||||
fDesc->fProgramInfo = GrSimpleMeshDrawOpHelper::CreateProgramInfo(
|
||||
caps, arena, writeView, std::move(appliedClip), dstProxyView, gp,
|
||||
GrProcessorSet::MakeEmptySet(), fDesc->fVertexSpec.primitiveType(),
|
||||
renderPassXferBarriers, pipelineFlags);
|
||||
renderPassXferBarriers, colorLoadOp, pipelineFlags);
|
||||
}
|
||||
|
||||
void onPrePrepareDraws(GrRecordingContext* context,
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip* clip,
|
||||
const GrXferProcessor::DstProxyView& dstProxyView,
|
||||
GrXferBarrierFlags renderPassXferBarriers) override {
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) override {
|
||||
TRACE_EVENT0("skia.gpu", TRACE_FUNC);
|
||||
|
||||
SkDEBUGCODE(this->validate();)
|
||||
@ -696,7 +698,7 @@ private:
|
||||
|
||||
// This will call onCreateProgramInfo and register the created program with the DDL.
|
||||
this->INHERITED::onPrePrepareDraws(context, writeView, clip, dstProxyView,
|
||||
renderPassXferBarriers);
|
||||
renderPassXferBarriers, colorLoadOp);
|
||||
}
|
||||
|
||||
static void FillInVertices(const GrCaps& caps, TextureOp* texOp, Desc* desc, char* vertexData) {
|
||||
|
@ -457,7 +457,8 @@ private:
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip&& appliedClip,
|
||||
const GrXferProcessor::DstProxyView& dstProxyView,
|
||||
GrXferBarrierFlags renderPassXferBarriers) override {
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) override {
|
||||
GrGeometryProcessor* gp;
|
||||
{
|
||||
using namespace GrDefaultGeoProcFactory;
|
||||
@ -500,18 +501,19 @@ private:
|
||||
fProgramInfo = fHelper.createProgramInfoWithStencil(caps, arena, writeView,
|
||||
std::move(appliedClip), dstProxyView,
|
||||
gp, primitiveType,
|
||||
renderPassXferBarriers);
|
||||
renderPassXferBarriers, colorLoadOp);
|
||||
}
|
||||
|
||||
void onPrePrepareDraws(GrRecordingContext* rContext,
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip* clip,
|
||||
const GrXferProcessor::DstProxyView& dstProxyView,
|
||||
GrXferBarrierFlags renderPassXferBarriers) override {
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) override {
|
||||
TRACE_EVENT0("skia.gpu", TRACE_FUNC);
|
||||
|
||||
INHERITED::onPrePrepareDraws(rContext, writeView, clip, dstProxyView,
|
||||
renderPassXferBarriers);
|
||||
renderPassXferBarriers, colorLoadOp);
|
||||
|
||||
if (fAntiAlias) {
|
||||
// TODO: pull the triangulation work forward to the recording thread for the AA case
|
||||
|
@ -145,7 +145,8 @@ void GrDrawAtlasPathOp::onPrePrepare(GrRecordingContext*,
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip*,
|
||||
const GrXferProcessor::DstProxyView&,
|
||||
GrXferBarrierFlags renderPassXferBarriers) {}
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) {}
|
||||
|
||||
void GrDrawAtlasPathOp::onPrepare(GrOpFlushState* state) {
|
||||
size_t instanceStride = Instance::Stride(fUsesLocalCoords);
|
||||
@ -181,7 +182,8 @@ void GrDrawAtlasPathOp::onExecute(GrOpFlushState* state, const SkRect& chainBoun
|
||||
GrProgramInfo programInfo(state->proxy()->numSamples(), state->proxy()->numStencilSamples(),
|
||||
state->proxy()->backendFormat(), state->writeView().origin(),
|
||||
&pipeline, &GrUserStencilSettings::kUnused, &shader,
|
||||
GrPrimitiveType::kTriangleStrip, 0, state->renderPassBarriers());
|
||||
GrPrimitiveType::kTriangleStrip, 0, state->renderPassBarriers(),
|
||||
state->colorLoadOp());
|
||||
|
||||
state->bindPipelineAndScissorClip(programInfo, this->bounds());
|
||||
state->bindTextures(shader, *fAtlasProxy, pipeline);
|
||||
|
@ -46,7 +46,8 @@ private:
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip*,
|
||||
const GrXferProcessor::DstProxyView&,
|
||||
GrXferBarrierFlags renderPassXferBarriers) override;
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) override;
|
||||
|
||||
struct Instance {
|
||||
constexpr static size_t Stride(bool usesLocalCoords) {
|
||||
|
@ -39,13 +39,14 @@ public:
|
||||
GrProcessorSet&& processors, GrAppliedClip&& appliedClip,
|
||||
const GrXferProcessor::DstProxyView& dstProxyView,
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp,
|
||||
const GrUserStencilSettings* stencil,
|
||||
const GrCaps& caps) {
|
||||
auto* pipeline = GrSimpleMeshDrawOpHelper::CreatePipeline(
|
||||
&caps, arena, writeView.swizzle(), std::move(appliedClip), dstProxyView,
|
||||
std::move(processors), pipelineFlags);
|
||||
return MakeProgramInfo(shader, arena, writeView, pipeline, dstProxyView,
|
||||
renderPassXferBarriers, stencil, caps);
|
||||
renderPassXferBarriers, colorLoadOp, stencil, caps);
|
||||
}
|
||||
|
||||
static GrProgramInfo* MakeProgramInfo(const GrPathShader* shader, SkArenaAlloc* arena,
|
||||
@ -53,6 +54,7 @@ public:
|
||||
const GrPipeline* pipeline,
|
||||
const GrXferProcessor::DstProxyView& dstProxyView,
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp,
|
||||
const GrUserStencilSettings* stencil,
|
||||
const GrCaps& caps) {
|
||||
GrRenderTargetProxy* proxy = writeView.asRenderTargetProxy();
|
||||
@ -60,7 +62,7 @@ public:
|
||||
proxy->backendFormat(), writeView.origin(), pipeline,
|
||||
stencil, shader, shader->fPrimitiveType,
|
||||
shader->fTessellationPatchVertexCount,
|
||||
renderPassXferBarriers);
|
||||
renderPassXferBarriers, colorLoadOp);
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -62,13 +62,15 @@ private:
|
||||
void GrPathTessellateOp::onPrePrepare(GrRecordingContext* context,
|
||||
const GrSurfaceProxyView& writeView, GrAppliedClip* clip,
|
||||
const GrXferProcessor::DstProxyView& dstProxyView,
|
||||
GrXferBarrierFlags renderPassXferBarriers) {
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) {
|
||||
SkArenaAlloc* recordTimeAllocator = context->priv().recordTimeAllocator();
|
||||
GrAppliedHardClip hardClip = GrAppliedHardClip(
|
||||
(clip) ? clip->hardClip() : GrAppliedHardClip::Disabled());
|
||||
CpuTriangleAllocator cpuTriangleAllocator(recordTimeAllocator, &fOffThreadInnerTriangulation);
|
||||
PrePrepareArgs args{recordTimeAllocator, writeView, &hardClip, clip, &dstProxyView,
|
||||
renderPassXferBarriers, context->priv().caps(), &cpuTriangleAllocator};
|
||||
renderPassXferBarriers, colorLoadOp, context->priv().caps(),
|
||||
&cpuTriangleAllocator};
|
||||
|
||||
this->prePreparePrograms(args);
|
||||
|
||||
@ -216,7 +218,8 @@ void GrPathTessellateOp::prePrepareStencilTrianglesProgram(const PrePrepareArgs&
|
||||
auto* shader = args.fArena->make<GrStencilTriangleShader>(fViewMatrix);
|
||||
fStencilTrianglesProgram = GrPathShader::MakeProgramInfo(
|
||||
shader, args.fArena, args.fWriteView, fPipelineForStencils, *args.fDstProxyView,
|
||||
args.fXferBarrierFlags, stencil_pass_settings(fPath.getFillType()), *args.fCaps);
|
||||
args.fXferBarrierFlags, args.fColorLoadOp, stencil_pass_settings(fPath.getFillType()),
|
||||
*args.fCaps);
|
||||
}
|
||||
|
||||
template<typename ShaderType>
|
||||
@ -228,7 +231,8 @@ void GrPathTessellateOp::prePrepareStencilCubicsProgram(const PrePrepareArgs& ar
|
||||
auto* shader = args.fArena->make<ShaderType>(fViewMatrix);
|
||||
fStencilCubicsProgram = GrPathShader::MakeProgramInfo(
|
||||
shader, args.fArena, args.fWriteView, fPipelineForStencils, *args.fDstProxyView,
|
||||
args.fXferBarrierFlags, stencil_pass_settings(fPath.getFillType()), *args.fCaps);
|
||||
args.fXferBarrierFlags, args.fColorLoadOp, stencil_pass_settings(fPath.getFillType()),
|
||||
*args.fCaps);
|
||||
}
|
||||
|
||||
void GrPathTessellateOp::prePreparePipelineForStencils(const PrePrepareArgs& args) {
|
||||
@ -317,7 +321,7 @@ void GrPathTessellateOp::prePrepareFillTrianglesProgram(const PrePrepareArgs& ar
|
||||
auto* fillTriangleShader = args.fArena->make<GrFillTriangleShader>(fViewMatrix, fColor);
|
||||
fFillTrianglesProgram = GrPathShader::MakeProgramInfo(
|
||||
fillTriangleShader, args.fArena, args.fWriteView, fPipelineForFills,
|
||||
*args.fDstProxyView, args.fXferBarrierFlags, stencil, *args.fCaps);
|
||||
*args.fDstProxyView, args.fXferBarrierFlags, args.fColorLoadOp, stencil, *args.fCaps);
|
||||
}
|
||||
|
||||
void GrPathTessellateOp::prePrepareFillCubicHullsProgram(const PrePrepareArgs& args) {
|
||||
@ -332,7 +336,8 @@ void GrPathTessellateOp::prePrepareFillCubicHullsProgram(const PrePrepareArgs& a
|
||||
auto* fillCubicHullsShader = args.fArena->make<GrFillCubicHullShader>(fViewMatrix, fColor);
|
||||
fFillPathProgram = GrPathShader::MakeProgramInfo(
|
||||
fillCubicHullsShader, args.fArena, args.fWriteView, fPipelineForFills,
|
||||
*args.fDstProxyView, args.fXferBarrierFlags, &kTestAndResetStencil, *args.fCaps);
|
||||
*args.fDstProxyView, args.fXferBarrierFlags, args.fColorLoadOp, &kTestAndResetStencil,
|
||||
*args.fCaps);
|
||||
}
|
||||
|
||||
void GrPathTessellateOp::prePrepareFillBoundingBoxProgram(const PrePrepareArgs& args) {
|
||||
@ -348,7 +353,8 @@ void GrPathTessellateOp::prePrepareFillBoundingBoxProgram(const PrePrepareArgs&
|
||||
fPath.getBounds());
|
||||
fFillPathProgram = GrPathShader::MakeProgramInfo(
|
||||
fillBoundingBoxShader, args.fArena, args.fWriteView, fPipelineForFills,
|
||||
*args.fDstProxyView, args.fXferBarrierFlags, &kTestAndResetStencil, *args.fCaps);
|
||||
*args.fDstProxyView, args.fXferBarrierFlags, args.fColorLoadOp, &kTestAndResetStencil,
|
||||
*args.fCaps);
|
||||
}
|
||||
|
||||
void GrPathTessellateOp::prePreparePipelineForFills(const PrePrepareArgs& args) {
|
||||
@ -395,8 +401,8 @@ void GrPathTessellateOp::onPrepare(GrOpFlushState* flushState) {
|
||||
GrAppliedClip clip = flushState->detachAppliedClip();
|
||||
PrePrepareArgs args{flushState->allocator(), flushState->writeView(), &hardClip,
|
||||
&clip, &flushState->dstProxyView(),
|
||||
flushState->renderPassBarriers(), &flushState->caps(),
|
||||
&innerTriangleAllocator};
|
||||
flushState->renderPassBarriers(), flushState->colorLoadOp(),
|
||||
&flushState->caps(), &innerTriangleAllocator};
|
||||
this->prePreparePrograms(args);
|
||||
}
|
||||
|
||||
|
@ -50,7 +50,8 @@ private:
|
||||
FixedFunctionFlags fixedFunctionFlags() const override;
|
||||
|
||||
void onPrePrepare(GrRecordingContext*, const GrSurfaceProxyView&, GrAppliedClip*,
|
||||
const GrXferProcessor::DstProxyView&, GrXferBarrierFlags) override;
|
||||
const GrXferProcessor::DstProxyView&, GrXferBarrierFlags,
|
||||
GrLoadOp colorLoadOp) override;
|
||||
|
||||
struct PrePrepareArgs {
|
||||
SkArenaAlloc* fArena;
|
||||
@ -59,6 +60,7 @@ private:
|
||||
GrAppliedClip* fClip;
|
||||
const GrXferProcessor::DstProxyView* fDstProxyView;
|
||||
GrXferBarrierFlags fXferBarrierFlags;
|
||||
GrLoadOp fColorLoadOp;
|
||||
const GrCaps* fCaps;
|
||||
GrEagerVertexAllocator* fInnerTriangleAllocator;
|
||||
};
|
||||
|
@ -84,6 +84,7 @@ void GrStrokeOp::prePrepareColorProgram(SkArenaAlloc* arena,
|
||||
const GrSurfaceProxyView& writeView, GrAppliedClip&& clip,
|
||||
const GrXferProcessor::DstProxyView& dstProxyView,
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp,
|
||||
const GrCaps& caps) {
|
||||
SkASSERT(!fColorProgram);
|
||||
auto pipelineFlags = GrPipeline::InputFlags::kNone;
|
||||
@ -95,6 +96,6 @@ void GrStrokeOp::prePrepareColorProgram(SkArenaAlloc* arena,
|
||||
fColorProgram = GrPathShader::MakeProgramInfo(strokeTessellateShader, arena, writeView,
|
||||
pipelineFlags, std::move(fProcessors),
|
||||
std::move(clip), dstProxyView,
|
||||
renderPassXferBarriers,
|
||||
renderPassXferBarriers, colorLoadOp,
|
||||
&GrUserStencilSettings::kUnused, caps);
|
||||
}
|
||||
|
@ -35,8 +35,9 @@ protected:
|
||||
CombineResult onCombineIfPossible(GrOp*, SkArenaAlloc*, const GrCaps&) override;
|
||||
|
||||
void prePrepareColorProgram(SkArenaAlloc* arena, GrStrokeTessellateShader*,
|
||||
const GrSurfaceProxyView&, GrAppliedClip&&, const
|
||||
GrXferProcessor::DstProxyView&, GrXferBarrierFlags, const GrCaps&);
|
||||
const GrSurfaceProxyView&, GrAppliedClip&&,
|
||||
const GrXferProcessor::DstProxyView&, GrXferBarrierFlags,
|
||||
GrLoadOp colorLoadOp, const GrCaps&);
|
||||
|
||||
static float NumCombinedSegments(float numParametricSegments, float numRadialSegments) {
|
||||
// The first and last edges are shared by both the parametric and radial sets of edges, so
|
||||
|
@ -17,12 +17,14 @@ using Patch = GrStrokeTessellateShader::Patch;
|
||||
void GrStrokeTessellateOp::onPrePrepare(GrRecordingContext* context,
|
||||
const GrSurfaceProxyView& writeView, GrAppliedClip* clip,
|
||||
const GrXferProcessor::DstProxyView& dstProxyView,
|
||||
GrXferBarrierFlags renderPassXferBarriers) {
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) {
|
||||
SkArenaAlloc* arena = context->priv().recordTimeAllocator();
|
||||
auto* strokeTessellateShader = arena->make<GrStrokeTessellateShader>(
|
||||
fStroke, fParametricIntolerance, fNumRadialSegmentsPerRadian, fViewMatrix, fColor);
|
||||
this->prePrepareColorProgram(arena, strokeTessellateShader, writeView, std::move(*clip),
|
||||
dstProxyView, renderPassXferBarriers, *context->priv().caps());
|
||||
dstProxyView, renderPassXferBarriers, colorLoadOp,
|
||||
*context->priv().caps());
|
||||
context->priv().recordProgramInfo(fColorProgram);
|
||||
}
|
||||
|
||||
@ -34,7 +36,7 @@ void GrStrokeTessellateOp::onPrepare(GrOpFlushState* flushState) {
|
||||
this->prePrepareColorProgram(flushState->allocator(), strokeTessellateShader,
|
||||
flushState->writeView(), flushState->detachAppliedClip(),
|
||||
flushState->dstProxyView(), flushState->renderPassBarriers(),
|
||||
flushState->caps());
|
||||
flushState->colorLoadOp(), flushState->caps());
|
||||
}
|
||||
|
||||
fTarget = flushState;
|
||||
|
@ -31,7 +31,8 @@ private:
|
||||
}
|
||||
|
||||
void onPrePrepare(GrRecordingContext*, const GrSurfaceProxyView&, GrAppliedClip*,
|
||||
const GrXferProcessor::DstProxyView&, GrXferBarrierFlags) override;
|
||||
const GrXferProcessor::DstProxyView&, GrXferBarrierFlags,
|
||||
GrLoadOp colorLoadOp) override;
|
||||
|
||||
enum class JoinType {
|
||||
kFromStroke, // The shader will use the join type defined in our fStrokeRec.
|
||||
|
@ -229,7 +229,8 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrAtlasTextOpPreparation, reporter, ctxInfo)
|
||||
surfaceView,
|
||||
nullptr,
|
||||
GrXferProcessor::DstProxyView(),
|
||||
GrXferBarrierFlags::kNone);
|
||||
GrXferBarrierFlags::kNone,
|
||||
GrLoadOp::kLoad);
|
||||
|
||||
// Modify the atlas manager so it can't allocate any pages. This will force a failure
|
||||
// in the preparation of the text op
|
||||
|
@ -434,7 +434,8 @@ private:
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip*,
|
||||
const GrXferProcessor::DstProxyView&,
|
||||
GrXferBarrierFlags renderPassXferBarriers) override {}
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) override {}
|
||||
void onPrepare(GrOpFlushState* state) override {
|
||||
fHelper = std::make_unique<DrawMeshHelper>(state);
|
||||
fPrepareFn(fHelper.get());
|
||||
@ -576,7 +577,7 @@ GrOpsRenderPass* DrawMeshHelper::bindPipeline(GrPrimitiveType primitiveType, boo
|
||||
GrProgramInfo programInfo(fState->proxy()->numSamples(), fState->proxy()->numStencilSamples(),
|
||||
fState->proxy()->backendFormat(), fState->writeView().origin(),
|
||||
pipeline, &GrUserStencilSettings::kUnused, mtp, primitiveType, 0,
|
||||
fState->renderPassBarriers());
|
||||
fState->renderPassBarriers(), fState->colorLoadOp());
|
||||
|
||||
fState->opsRenderPass()->bindPipeline(programInfo, SkRect::MakeIWH(kImageWidth, kImageHeight));
|
||||
return fState->opsRenderPass();
|
||||
|
@ -146,7 +146,8 @@ private:
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip*,
|
||||
const GrXferProcessor::DstProxyView&,
|
||||
GrXferBarrierFlags renderPassXferBarriers) override {}
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) override {}
|
||||
void onPrepare(GrOpFlushState*) override {}
|
||||
void onExecute(GrOpFlushState* flushState, const SkRect& chainBounds) override {
|
||||
GrPipeline pipeline(fScissorTest, SkBlendMode::kSrc,
|
||||
@ -167,7 +168,8 @@ private:
|
||||
&GrUserStencilSettings::kUnused,
|
||||
geomProc,
|
||||
GrPrimitiveType::kTriangleStrip, 0,
|
||||
flushState->renderPassBarriers());
|
||||
flushState->renderPassBarriers(),
|
||||
flushState->colorLoadOp());
|
||||
|
||||
flushState->bindPipeline(programInfo, SkRect::MakeIWH(kScreenSize, kScreenSize));
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
|
@ -456,7 +456,8 @@ private:
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip&& appliedClip,
|
||||
const GrXferProcessor::DstProxyView& dstProxyView,
|
||||
GrXferBarrierFlags renderPassXferBarriers) const {
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) const {
|
||||
using namespace GrDefaultGeoProcFactory;
|
||||
|
||||
Color color({ 0.0f, 0.0f, 1.0f, 1.0f });
|
||||
@ -470,7 +471,7 @@ private:
|
||||
std::move(appliedClip), dstProxyView,
|
||||
gp, SkBlendMode::kSrcOver,
|
||||
GrPrimitiveType::kTriangleStrip,
|
||||
renderPassXferBarriers);
|
||||
renderPassXferBarriers, colorLoadOp);
|
||||
}
|
||||
|
||||
GrProgramInfo* createProgramInfo(GrOpFlushState* flushState) const {
|
||||
@ -479,7 +480,8 @@ private:
|
||||
flushState->writeView(),
|
||||
flushState->detachAppliedClip(),
|
||||
flushState->dstProxyView(),
|
||||
flushState->renderPassBarriers());
|
||||
flushState->renderPassBarriers(),
|
||||
flushState->colorLoadOp());
|
||||
}
|
||||
|
||||
void findOrCreateVertices(GrRecordingContext* rContext, bool failLookup, bool failFillingIn) {
|
||||
@ -546,7 +548,8 @@ private:
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip* clip,
|
||||
const GrXferProcessor::DstProxyView& dstProxyView,
|
||||
GrXferBarrierFlags renderPassXferBarriers) override {
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) override {
|
||||
SkArenaAlloc* arena = rContext->priv().recordTimeAllocator();
|
||||
|
||||
// This is equivalent to a GrOpFlushState::detachAppliedClip
|
||||
@ -554,7 +557,7 @@ private:
|
||||
|
||||
fProgramInfo = this->createProgramInfo(rContext->priv().caps(), arena, writeView,
|
||||
std::move(appliedClip), dstProxyView,
|
||||
renderPassXferBarriers);
|
||||
renderPassXferBarriers, colorLoadOp);
|
||||
|
||||
rContext->priv().recordProgramInfo(fProgramInfo);
|
||||
|
||||
|
@ -113,7 +113,8 @@ public:
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip*,
|
||||
const GrXferProcessor::DstProxyView&,
|
||||
GrXferBarrierFlags renderPassXferBarriers) override {}
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) override {}
|
||||
|
||||
void onPrepare(GrOpFlushState*) override {}
|
||||
|
||||
@ -360,7 +361,8 @@ private:
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip*,
|
||||
const GrXferProcessor::DstProxyView&,
|
||||
GrXferBarrierFlags renderPassXferBarriers) override {}
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) override {}
|
||||
void onPrepare(GrOpFlushState*) override {}
|
||||
void onExecute(GrOpFlushState* state, const SkRect& chainBounds) override {
|
||||
*fTestExecuteValue = 2;
|
||||
|
@ -104,7 +104,8 @@ private:
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip&& appliedClip,
|
||||
const GrXferProcessor::DstProxyView& dstProxyView,
|
||||
GrXferBarrierFlags renderPassXferBarriers) override {
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) override {
|
||||
using namespace GrDefaultGeoProcFactory;
|
||||
|
||||
GrGeometryProcessor* gp = GrDefaultGeoProcFactory::Make(
|
||||
@ -121,7 +122,7 @@ private:
|
||||
|
||||
fProgramInfo = fHelper.createProgramInfo(caps, arena, writeView, std::move(appliedClip),
|
||||
dstProxyView, gp, GrPrimitiveType::kTriangles,
|
||||
renderPassXferBarriers);
|
||||
renderPassXferBarriers, colorLoadOp);
|
||||
}
|
||||
|
||||
void onPrepareDraws(Target* target) override {
|
||||
|
@ -128,7 +128,8 @@ private:
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip*,
|
||||
const GrXferProcessor::DstProxyView&,
|
||||
GrXferBarrierFlags renderPassXferBarriers) override {}
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) override {}
|
||||
|
||||
void onPrepare(GrOpFlushState*) override {}
|
||||
|
||||
|
@ -63,7 +63,8 @@ private:
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip&& appliedClip,
|
||||
const GrXferProcessor::DstProxyView& dstProxyView,
|
||||
GrXferBarrierFlags renderPassXferBarriers) override {
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) override {
|
||||
class GP : public GrGeometryProcessor {
|
||||
public:
|
||||
static GrGeometryProcessor* Make(SkArenaAlloc* arena, int numAttribs) {
|
||||
@ -134,6 +135,7 @@ private:
|
||||
GrProcessorSet::MakeEmptySet(),
|
||||
GrPrimitiveType::kTriangles,
|
||||
renderPassXferBarriers,
|
||||
colorLoadOp,
|
||||
GrPipeline::InputFlags::kNone);
|
||||
}
|
||||
|
||||
|
@ -68,12 +68,14 @@ private:
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip&&,
|
||||
const GrXferProcessor::DstProxyView&,
|
||||
GrXferBarrierFlags renderPassXferBarriers) override {}
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) override {}
|
||||
void onPrePrepareDraws(GrRecordingContext*,
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip*,
|
||||
const GrXferProcessor::DstProxyView&,
|
||||
GrXferBarrierFlags renderPassXferBarriers) override {}
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) override {}
|
||||
void onPrepareDraws(Target* target) override { return; }
|
||||
void onExecute(GrOpFlushState*, const SkRect&) override { return; }
|
||||
|
||||
|
@ -68,6 +68,7 @@ GrProgramInfo* CreateProgramInfo(const GrCaps* caps,
|
||||
SkBlendMode blendMode,
|
||||
GrPrimitiveType primitiveType,
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp,
|
||||
GrPipeline::InputFlags flags,
|
||||
const GrUserStencilSettings* stencilSettings) {
|
||||
|
||||
@ -84,8 +85,8 @@ GrProgramInfo* CreateProgramInfo(const GrCaps* caps,
|
||||
return GrSimpleMeshDrawOpHelper::CreateProgramInfo(caps, arena, writeView,
|
||||
std::move(appliedClip), dstProxyView,
|
||||
geomProc, std::move(processors),
|
||||
primitiveType, renderPassXferBarriers, flags,
|
||||
stencilSettings);
|
||||
primitiveType, renderPassXferBarriers,
|
||||
colorLoadOp, flags, stencilSettings);
|
||||
}
|
||||
|
||||
|
||||
|
@ -35,6 +35,7 @@ GrProgramInfo* CreateProgramInfo(const GrCaps*,
|
||||
SkBlendMode,
|
||||
GrPrimitiveType,
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp,
|
||||
GrPipeline::InputFlags flags = GrPipeline::InputFlags::kNone,
|
||||
const GrUserStencilSettings* stencil =
|
||||
&GrUserStencilSettings::kUnused);
|
||||
|
@ -120,7 +120,8 @@ private:
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip&&,
|
||||
const GrXferProcessor::DstProxyView&,
|
||||
GrXferBarrierFlags renderPassXferBarriers) override;
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) override;
|
||||
|
||||
void onPrepareDraws(Target*) override;
|
||||
void onExecute(GrOpFlushState*, const SkRect& chainBounds) override;
|
||||
@ -180,7 +181,8 @@ void TestRectOp::onCreateProgramInfo(const GrCaps* caps,
|
||||
const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip&& appliedClip,
|
||||
const GrXferProcessor::DstProxyView& dstProxyView,
|
||||
GrXferBarrierFlags renderPassXferBarriers) {
|
||||
GrXferBarrierFlags renderPassXferBarriers,
|
||||
GrLoadOp colorLoadOp) {
|
||||
fProgramInfo = GrSimpleMeshDrawOpHelper::CreateProgramInfo(caps,
|
||||
arena,
|
||||
writeView,
|
||||
@ -190,6 +192,7 @@ void TestRectOp::onCreateProgramInfo(const GrCaps* caps,
|
||||
std::move(fProcessorSet),
|
||||
GrPrimitiveType::kTriangles,
|
||||
renderPassXferBarriers,
|
||||
colorLoadOp,
|
||||
GrPipeline::InputFlags::kNone);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user