Make GrOp::onPrePrepare be pure virtual
This makes onPrePrepare match onPrepare & onExecute. Most of the new method bodies will-have-to/should be filled in anyway. Change-Id: Ifc897feaeb2d8fe6eec3ac3a8e91f99393ad6758 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277542 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
This commit is contained in:
parent
3a76975a7c
commit
c655c3aa8b
@ -298,6 +298,11 @@ private:
|
|||||||
return GrProcessorSet::EmptySetAnalysis();
|
return GrProcessorSet::EmptySetAnalysis();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void onPrePrepare(GrRecordingContext*,
|
||||||
|
const GrSurfaceProxyView* outputView,
|
||||||
|
GrAppliedClip*,
|
||||||
|
const GrXferProcessor::DstProxyView&) override {}
|
||||||
|
|
||||||
void onPrepare(GrOpFlushState* flushState) override {
|
void onPrepare(GrOpFlushState* flushState) override {
|
||||||
if (fTriPositions) {
|
if (fTriPositions) {
|
||||||
if (void* vertexData = flushState->makeVertexSpace(sizeof(float) * 3, 3, &fVertexBuffer,
|
if (void* vertexData = flushState->makeVertexSpace(sizeof(float) * 3, 3, &fVertexBuffer,
|
||||||
|
@ -94,6 +94,10 @@ private:
|
|||||||
bool hasMixedSampledCoverage, GrClampType) override {
|
bool hasMixedSampledCoverage, GrClampType) override {
|
||||||
return GrProcessorSet::EmptySetAnalysis();
|
return GrProcessorSet::EmptySetAnalysis();
|
||||||
}
|
}
|
||||||
|
void onPrePrepare(GrRecordingContext*,
|
||||||
|
const GrSurfaceProxyView* outputView,
|
||||||
|
GrAppliedClip*,
|
||||||
|
const GrXferProcessor::DstProxyView&) override {}
|
||||||
void onPrepare(GrOpFlushState*) override {}
|
void onPrepare(GrOpFlushState*) override {}
|
||||||
void onExecute(GrOpFlushState*, const SkRect& chainBounds) override;
|
void onExecute(GrOpFlushState*, const SkRect& chainBounds) override;
|
||||||
|
|
||||||
|
@ -71,6 +71,11 @@ public:
|
|||||||
void onExecute(GrOpFlushState*, const SkRect& chainBounds) override;
|
void onExecute(GrOpFlushState*, const SkRect& chainBounds) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void onPrePrepare(GrRecordingContext*,
|
||||||
|
const GrSurfaceProxyView* outputView,
|
||||||
|
GrAppliedClip*,
|
||||||
|
const GrXferProcessor::DstProxyView&) override {}
|
||||||
|
|
||||||
friend class GrOpMemoryPool;
|
friend class GrOpMemoryPool;
|
||||||
|
|
||||||
static std::unique_ptr<GrCCDrawPathsOp> InternalMake(GrRecordingContext*,
|
static std::unique_ptr<GrCCDrawPathsOp> InternalMake(GrRecordingContext*,
|
||||||
|
@ -45,7 +45,6 @@ public:
|
|||||||
// TODO: make use of texture chaining.
|
// TODO: make use of texture chaining.
|
||||||
return CombineResult::kCannotCombine;
|
return CombineResult::kCannotCombine;
|
||||||
}
|
}
|
||||||
void onPrepare(GrOpFlushState*) override {}
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
AtlasOp(uint32_t classID, sk_sp<const GrCCPerFlushResources> resources,
|
AtlasOp(uint32_t classID, sk_sp<const GrCCPerFlushResources> resources,
|
||||||
@ -57,6 +56,13 @@ protected:
|
|||||||
}
|
}
|
||||||
|
|
||||||
const sk_sp<const GrCCPerFlushResources> fResources;
|
const sk_sp<const GrCCPerFlushResources> fResources;
|
||||||
|
|
||||||
|
private:
|
||||||
|
void onPrePrepare(GrRecordingContext*,
|
||||||
|
const GrSurfaceProxyView* outputView,
|
||||||
|
GrAppliedClip*,
|
||||||
|
const GrXferProcessor::DstProxyView&) final {}
|
||||||
|
void onPrepare(GrOpFlushState*) final {}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Copies paths from a cached coverage count or msaa atlas into an 8-bit literal-coverage atlas.
|
// Copies paths from a cached coverage count or msaa atlas into an 8-bit literal-coverage atlas.
|
||||||
|
@ -46,16 +46,20 @@ public:
|
|||||||
// TODO: make use of texture chaining.
|
// TODO: make use of texture chaining.
|
||||||
return CombineResult::kCannotCombine;
|
return CombineResult::kCannotCombine;
|
||||||
}
|
}
|
||||||
void onPrepare(GrOpFlushState*) override {}
|
|
||||||
|
|
||||||
static std::unique_ptr<GrDrawOp> Make(
|
static std::unique_ptr<GrDrawOp> Make(
|
||||||
GrRecordingContext*, sk_sp<const GrCCPerFlushResources>, FillBatchID, StrokeBatchID,
|
GrRecordingContext*, sk_sp<const GrCCPerFlushResources>, FillBatchID, StrokeBatchID,
|
||||||
int baseStencilResolveInstance, int endStencilResolveInstance,
|
int baseStencilResolveInstance, int endStencilResolveInstance,
|
||||||
const SkISize& drawBounds);
|
const SkISize& drawBounds);
|
||||||
|
|
||||||
void onExecute(GrOpFlushState* flushState, const SkRect& chainBounds) override;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void onPrePrepare(GrRecordingContext*,
|
||||||
|
const GrSurfaceProxyView* outputView,
|
||||||
|
GrAppliedClip*,
|
||||||
|
const GrXferProcessor::DstProxyView&) override {}
|
||||||
|
void onPrepare(GrOpFlushState*) override {}
|
||||||
|
void onExecute(GrOpFlushState*, const SkRect& chainBounds) override;
|
||||||
|
|
||||||
friend class ::GrOpMemoryPool; // for ctor
|
friend class ::GrOpMemoryPool; // for ctor
|
||||||
|
|
||||||
GrStencilAtlasOp(sk_sp<const GrCCPerFlushResources> resources, FillBatchID fillBatchID,
|
GrStencilAtlasOp(sk_sp<const GrCCPerFlushResources> resources, FillBatchID fillBatchID,
|
||||||
|
@ -91,6 +91,11 @@ private:
|
|||||||
fClip.scissorRect().contains(that->fClip.scissorRect()));
|
fClip.scissorRect().contains(that->fClip.scissorRect()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void onPrePrepare(GrRecordingContext*,
|
||||||
|
const GrSurfaceProxyView* outputView,
|
||||||
|
GrAppliedClip*,
|
||||||
|
const GrXferProcessor::DstProxyView&) 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;
|
||||||
|
@ -54,6 +54,11 @@ private:
|
|||||||
this->setBounds(bounds, HasAABloat::kNo, IsHairline::kNo);
|
this->setBounds(bounds, HasAABloat::kNo, IsHairline::kNo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void onPrePrepare(GrRecordingContext*,
|
||||||
|
const GrSurfaceProxyView* outputView,
|
||||||
|
GrAppliedClip*,
|
||||||
|
const GrXferProcessor::DstProxyView&) override {}
|
||||||
|
|
||||||
void onPrepare(GrOpFlushState*) override {}
|
void onPrepare(GrOpFlushState*) override {}
|
||||||
|
|
||||||
void onExecute(GrOpFlushState*, const SkRect& chainBounds) override;
|
void onExecute(GrOpFlushState*, const SkRect& chainBounds) override;
|
||||||
|
@ -54,6 +54,11 @@ protected:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void onPrePrepare(GrRecordingContext*,
|
||||||
|
const GrSurfaceProxyView* outputView,
|
||||||
|
GrAppliedClip*,
|
||||||
|
const GrXferProcessor::DstProxyView&) final {}
|
||||||
|
|
||||||
void onPrepare(GrOpFlushState*) final {}
|
void onPrepare(GrOpFlushState*) final {}
|
||||||
|
|
||||||
SkMatrix fViewMatrix;
|
SkMatrix fViewMatrix;
|
||||||
|
@ -41,6 +41,12 @@ private:
|
|||||||
const GrCaps& caps) override {
|
const GrCaps& caps) override {
|
||||||
return CombineResult::kCannotCombine;
|
return CombineResult::kCannotCombine;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void onPrePrepare(GrRecordingContext*,
|
||||||
|
const GrSurfaceProxyView* outputView,
|
||||||
|
GrAppliedClip*,
|
||||||
|
const GrXferProcessor::DstProxyView&) override {}
|
||||||
|
|
||||||
void onPrepare(GrOpFlushState*) override {}
|
void onPrepare(GrOpFlushState*) override {}
|
||||||
|
|
||||||
void onExecute(GrOpFlushState*, const SkRect& chainBounds) override;
|
void onExecute(GrOpFlushState*, const SkRect& chainBounds) override;
|
||||||
|
@ -299,7 +299,7 @@ private:
|
|||||||
virtual void onPrePrepare(GrRecordingContext*,
|
virtual void onPrePrepare(GrRecordingContext*,
|
||||||
const GrSurfaceProxyView* outputView,
|
const GrSurfaceProxyView* outputView,
|
||||||
GrAppliedClip*,
|
GrAppliedClip*,
|
||||||
const GrXferProcessor::DstProxyView&) {}
|
const GrXferProcessor::DstProxyView&) = 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.
|
||||||
|
@ -56,6 +56,11 @@ private:
|
|||||||
this->setBounds(fPath->getBounds(), HasAABloat::kNo, IsHairline::kNo);
|
this->setBounds(fPath->getBounds(), HasAABloat::kNo, IsHairline::kNo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void onPrePrepare(GrRecordingContext*,
|
||||||
|
const GrSurfaceProxyView* outputView,
|
||||||
|
GrAppliedClip*,
|
||||||
|
const GrXferProcessor::DstProxyView&) override {}
|
||||||
|
|
||||||
void onPrepare(GrOpFlushState*) override {}
|
void onPrepare(GrOpFlushState*) override {}
|
||||||
|
|
||||||
void onExecute(GrOpFlushState*, const SkRect& chainBounds) override;
|
void onExecute(GrOpFlushState*, const SkRect& chainBounds) override;
|
||||||
|
@ -140,6 +140,12 @@ GrOp::CombineResult GrDrawAtlasPathOp::onCombineIfPossible(
|
|||||||
return CombineResult::kMerged;
|
return CombineResult::kMerged;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GrDrawAtlasPathOp::onPrePrepare(GrRecordingContext*,
|
||||||
|
const GrSurfaceProxyView* outputView,
|
||||||
|
GrAppliedClip*,
|
||||||
|
const GrXferProcessor::DstProxyView&) {
|
||||||
|
}
|
||||||
|
|
||||||
void GrDrawAtlasPathOp::onPrepare(GrOpFlushState* state) {
|
void GrDrawAtlasPathOp::onPrepare(GrOpFlushState* state) {
|
||||||
size_t instanceStride = Instance::Stride(fUsesLocalCoords);
|
size_t instanceStride = Instance::Stride(fUsesLocalCoords);
|
||||||
if (char* instanceData = (char*)state->makeVertexSpace(
|
if (char* instanceData = (char*)state->makeVertexSpace(
|
||||||
|
@ -40,6 +40,11 @@ public:
|
|||||||
void onExecute(GrOpFlushState*, const SkRect& chainBounds) override;
|
void onExecute(GrOpFlushState*, const SkRect& chainBounds) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void onPrePrepare(GrRecordingContext*,
|
||||||
|
const GrSurfaceProxyView* outputView,
|
||||||
|
GrAppliedClip*,
|
||||||
|
const GrXferProcessor::DstProxyView&) override;
|
||||||
|
|
||||||
struct Instance {
|
struct Instance {
|
||||||
constexpr static size_t Stride(bool usesLocalCoords) {
|
constexpr static size_t Stride(bool usesLocalCoords) {
|
||||||
size_t stride = sizeof(Instance);
|
size_t stride = sizeof(Instance);
|
||||||
|
@ -23,6 +23,12 @@ GrTessellatePathOp::FixedFunctionFlags GrTessellatePathOp::fixedFunctionFlags()
|
|||||||
return flags;
|
return flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GrTessellatePathOp::onPrePrepare(GrRecordingContext*,
|
||||||
|
const GrSurfaceProxyView* outputView,
|
||||||
|
GrAppliedClip*,
|
||||||
|
const GrXferProcessor::DstProxyView&) {
|
||||||
|
}
|
||||||
|
|
||||||
void GrTessellatePathOp::onPrepare(GrOpFlushState* state) {
|
void GrTessellatePathOp::onPrepare(GrOpFlushState* state) {
|
||||||
GrEagerDynamicVertexAllocator pathVertexAllocator(state, &fPathVertexBuffer, &fBasePathVertex);
|
GrEagerDynamicVertexAllocator pathVertexAllocator(state, &fPathVertexBuffer, &fBasePathVertex);
|
||||||
GrEagerDynamicVertexAllocator cubicInstanceAllocator(state, &fCubicInstanceBuffer,
|
GrEagerDynamicVertexAllocator cubicInstanceAllocator(state, &fCubicInstanceBuffer,
|
||||||
|
@ -53,6 +53,10 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
FixedFunctionFlags fixedFunctionFlags() const override;
|
FixedFunctionFlags fixedFunctionFlags() const override;
|
||||||
|
void onPrePrepare(GrRecordingContext*,
|
||||||
|
const GrSurfaceProxyView* outputView,
|
||||||
|
GrAppliedClip*,
|
||||||
|
const GrXferProcessor::DstProxyView&) override;
|
||||||
void onPrepare(GrOpFlushState* state) override;
|
void onPrepare(GrOpFlushState* state) override;
|
||||||
void onExecute(GrOpFlushState*, const SkRect& chainBounds) override;
|
void onExecute(GrOpFlushState*, const SkRect& chainBounds) override;
|
||||||
|
|
||||||
|
@ -320,6 +320,11 @@ private:
|
|||||||
bool hasMixedSampledCoverage, GrClampType) override {
|
bool hasMixedSampledCoverage, GrClampType) override {
|
||||||
return GrProcessorSet::EmptySetAnalysis();
|
return GrProcessorSet::EmptySetAnalysis();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void onPrePrepare(GrRecordingContext*,
|
||||||
|
const GrSurfaceProxyView* outputView,
|
||||||
|
GrAppliedClip*,
|
||||||
|
const GrXferProcessor::DstProxyView&) override {}
|
||||||
void onPrepare(GrOpFlushState* state) override {
|
void onPrepare(GrOpFlushState* state) override {
|
||||||
fHelper.reset(new DrawMeshHelper(state));
|
fHelper.reset(new DrawMeshHelper(state));
|
||||||
fPrepareFn(fHelper.get());
|
fPrepareFn(fHelper.get());
|
||||||
|
@ -145,6 +145,10 @@ private:
|
|||||||
bool hasMixedSampledCoverage, GrClampType) override {
|
bool hasMixedSampledCoverage, GrClampType) override {
|
||||||
return GrProcessorSet::EmptySetAnalysis();
|
return GrProcessorSet::EmptySetAnalysis();
|
||||||
}
|
}
|
||||||
|
void onPrePrepare(GrRecordingContext*,
|
||||||
|
const GrSurfaceProxyView* outputView,
|
||||||
|
GrAppliedClip*,
|
||||||
|
const GrXferProcessor::DstProxyView&) 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,
|
||||||
|
@ -113,6 +113,11 @@ public:
|
|||||||
bool hasMixedSampledCoverage, GrClampType) override {
|
bool hasMixedSampledCoverage, GrClampType) override {
|
||||||
return GrProcessorSet::EmptySetAnalysis();
|
return GrProcessorSet::EmptySetAnalysis();
|
||||||
}
|
}
|
||||||
|
void onPrePrepare(GrRecordingContext*,
|
||||||
|
const GrSurfaceProxyView* outputView,
|
||||||
|
GrAppliedClip*,
|
||||||
|
const GrXferProcessor::DstProxyView&) override {}
|
||||||
|
|
||||||
void onPrepare(GrOpFlushState*) override {}
|
void onPrepare(GrOpFlushState*) override {}
|
||||||
|
|
||||||
LazyProxyTest* const fTest;
|
LazyProxyTest* const fTest;
|
||||||
@ -363,6 +368,10 @@ private:
|
|||||||
bool hasMixedSampledCoverage, GrClampType) override {
|
bool hasMixedSampledCoverage, GrClampType) override {
|
||||||
return GrProcessorSet::EmptySetAnalysis();
|
return GrProcessorSet::EmptySetAnalysis();
|
||||||
}
|
}
|
||||||
|
void onPrePrepare(GrRecordingContext*,
|
||||||
|
const GrSurfaceProxyView* outputView,
|
||||||
|
GrAppliedClip*,
|
||||||
|
const GrXferProcessor::DstProxyView&) 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;
|
||||||
|
@ -122,6 +122,11 @@ private:
|
|||||||
HasAABloat::kNo, IsHairline::kNo);
|
HasAABloat::kNo, IsHairline::kNo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void onPrePrepare(GrRecordingContext*,
|
||||||
|
const GrSurfaceProxyView* outputView,
|
||||||
|
GrAppliedClip*,
|
||||||
|
const GrXferProcessor::DstProxyView&) override {}
|
||||||
|
|
||||||
void onPrepare(GrOpFlushState*) override {}
|
void onPrepare(GrOpFlushState*) override {}
|
||||||
|
|
||||||
void onExecute(GrOpFlushState*, const SkRect& chainBounds) override {
|
void onExecute(GrOpFlushState*, const SkRect& chainBounds) override {
|
||||||
|
Loading…
Reference in New Issue
Block a user