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