Make GrFillRectOp::onPrePrepareDraws also call base class' version
and add a TriangulatingPathOp::onPrePrepareDraws shell.
Bug: 1108408
Change-Id: Ifc5e80c08ffaa47927d1691c0a8dd52db24adcd0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328597
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/ops/GrFillRectOp.cpp b/src/gpu/ops/GrFillRectOp.cpp
index a874ea6..c966a41 100644
--- a/src/gpu/ops/GrFillRectOp.cpp
+++ b/src/gpu/ops/GrFillRectOp.cpp
@@ -198,8 +198,6 @@
}
GrProgramInfo* programInfo() override {
- // This Op implements its own onPrePrepareDraws so this entry point should never be called.
- SkASSERT(0);
return fProgramInfo;
}
@@ -221,7 +219,7 @@
renderPassXferBarriers);
}
- void onPrePrepareDraws(GrRecordingContext* context,
+ void onPrePrepareDraws(GrRecordingContext* rContext,
const GrSurfaceProxyView* writeView,
GrAppliedClip* clip,
const GrXferProcessor::DstProxyView& dstProxyView,
@@ -230,15 +228,10 @@
SkASSERT(!fPrePreparedVertices);
- SkArenaAlloc* arena = context->priv().recordTimeAllocator();
+ INHERITED::onPrePrepareDraws(rContext, writeView, clip, dstProxyView,
+ renderPassXferBarriers);
- // This is equivalent to a GrOpFlushState::detachAppliedClip
- GrAppliedClip appliedClip = clip ? std::move(*clip) : GrAppliedClip::Disabled();
-
- this->createProgramInfo(context->priv().caps(), arena, writeView,
- std::move(appliedClip), dstProxyView, renderPassXferBarriers);
-
- context->priv().recordProgramInfo(fProgramInfo);
+ SkArenaAlloc* arena = rContext->priv().recordTimeAllocator();
const VertexSpec vertexSpec = this->vertexSpec();
diff --git a/src/gpu/ops/GrTriangulatingPathRenderer.cpp b/src/gpu/ops/GrTriangulatingPathRenderer.cpp
index b158a19..196b54b 100644
--- a/src/gpu/ops/GrTriangulatingPathRenderer.cpp
+++ b/src/gpu/ops/GrTriangulatingPathRenderer.cpp
@@ -403,6 +403,17 @@
renderPassXferBarriers);
}
+ void onPrePrepareDraws(GrRecordingContext* rContext,
+ const GrSurfaceProxyView* writeView,
+ GrAppliedClip* clip,
+ const GrXferProcessor::DstProxyView& dstProxyView,
+ GrXferBarrierFlags renderPassXferBarriers) override {
+ TRACE_EVENT0("skia.gpu", TRACE_FUNC);
+
+ INHERITED::onPrePrepareDraws(rContext, writeView, clip, dstProxyView,
+ renderPassXferBarriers);
+ }
+
void onPrepareDraws(Target* target) override {
if (fAntiAlias) {
this->createAAMesh(target);