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>
diff --git a/src/gpu/ops/GrClearOp.h b/src/gpu/ops/GrClearOp.h
index 5353d47..ea22a6a 100644
--- a/src/gpu/ops/GrClearOp.h
+++ b/src/gpu/ops/GrClearOp.h
@@ -91,6 +91,11 @@
fClip.scissorRect().contains(that->fClip.scissorRect()));
}
+ void onPrePrepare(GrRecordingContext*,
+ const GrSurfaceProxyView* outputView,
+ GrAppliedClip*,
+ const GrXferProcessor::DstProxyView&) override {}
+
void onPrepare(GrOpFlushState*) override {}
void onExecute(GrOpFlushState* state, const SkRect& chainBounds) override;
diff --git a/src/gpu/ops/GrClearStencilClipOp.h b/src/gpu/ops/GrClearStencilClipOp.h
index a233153..b5810d0 100644
--- a/src/gpu/ops/GrClearStencilClipOp.h
+++ b/src/gpu/ops/GrClearStencilClipOp.h
@@ -54,6 +54,11 @@
this->setBounds(bounds, HasAABloat::kNo, IsHairline::kNo);
}
+ void onPrePrepare(GrRecordingContext*,
+ const GrSurfaceProxyView* outputView,
+ GrAppliedClip*,
+ const GrXferProcessor::DstProxyView&) override {}
+
void onPrepare(GrOpFlushState*) override {}
void onExecute(GrOpFlushState*, const SkRect& chainBounds) override;
diff --git a/src/gpu/ops/GrDrawPathOp.h b/src/gpu/ops/GrDrawPathOp.h
index c11be49..b56dab3 100644
--- a/src/gpu/ops/GrDrawPathOp.h
+++ b/src/gpu/ops/GrDrawPathOp.h
@@ -54,6 +54,11 @@
}
private:
+ void onPrePrepare(GrRecordingContext*,
+ const GrSurfaceProxyView* outputView,
+ GrAppliedClip*,
+ const GrXferProcessor::DstProxyView&) final {}
+
void onPrepare(GrOpFlushState*) final {}
SkMatrix fViewMatrix;
diff --git a/src/gpu/ops/GrDrawableOp.cpp b/src/gpu/ops/GrDrawableOp.cpp
index d50c26b..19291b8 100644
--- a/src/gpu/ops/GrDrawableOp.cpp
+++ b/src/gpu/ops/GrDrawableOp.cpp
@@ -25,7 +25,7 @@
const SkRect& bounds)
: INHERITED(ClassID())
, fDrawable(std::move(drawable)) {
- this->setBounds(bounds, HasAABloat::kNo, IsHairline::kNo);
+ this->setBounds(bounds, HasAABloat::kNo, IsHairline::kNo);
}
void GrDrawableOp::onExecute(GrOpFlushState* state, const SkRect& chainBounds) {
diff --git a/src/gpu/ops/GrDrawableOp.h b/src/gpu/ops/GrDrawableOp.h
index 063886f..828404e 100644
--- a/src/gpu/ops/GrDrawableOp.h
+++ b/src/gpu/ops/GrDrawableOp.h
@@ -41,6 +41,12 @@
const GrCaps& caps) override {
return CombineResult::kCannotCombine;
}
+
+ void onPrePrepare(GrRecordingContext*,
+ const GrSurfaceProxyView* outputView,
+ GrAppliedClip*,
+ const GrXferProcessor::DstProxyView&) override {}
+
void onPrepare(GrOpFlushState*) override {}
void onExecute(GrOpFlushState*, const SkRect& chainBounds) override;
diff --git a/src/gpu/ops/GrOp.h b/src/gpu/ops/GrOp.h
index 1fcd193..95c692c 100644
--- a/src/gpu/ops/GrOp.h
+++ b/src/gpu/ops/GrOp.h
@@ -299,7 +299,7 @@
virtual void onPrePrepare(GrRecordingContext*,
const GrSurfaceProxyView* outputView,
GrAppliedClip*,
- const GrXferProcessor::DstProxyView&) {}
+ const GrXferProcessor::DstProxyView&) = 0;
virtual void onPrepare(GrOpFlushState*) = 0;
// If this op is chained then chainBounds is the union of the bounds of all ops in the chain.
// Otherwise, this op's bounds.
diff --git a/src/gpu/ops/GrStencilPathOp.h b/src/gpu/ops/GrStencilPathOp.h
index 2d4f37f..05fd585 100644
--- a/src/gpu/ops/GrStencilPathOp.h
+++ b/src/gpu/ops/GrStencilPathOp.h
@@ -56,6 +56,11 @@
this->setBounds(fPath->getBounds(), HasAABloat::kNo, IsHairline::kNo);
}
+ void onPrePrepare(GrRecordingContext*,
+ const GrSurfaceProxyView* outputView,
+ GrAppliedClip*,
+ const GrXferProcessor::DstProxyView&) override {}
+
void onPrepare(GrOpFlushState*) override {}
void onExecute(GrOpFlushState*, const SkRect& chainBounds) override;