Remove SkRuntimeEffect from DrawVerticesOp
It's vestigial.
Change-Id: I63791bd78e565faf203eefe1537699e924446d85
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/467978
Commit-Queue: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
diff --git a/src/gpu/ops/DrawVerticesOp.cpp b/src/gpu/ops/DrawVerticesOp.cpp
index 7830d1b..285c54b 100644
--- a/src/gpu/ops/DrawVerticesOp.cpp
+++ b/src/gpu/ops/DrawVerticesOp.cpp
@@ -8,7 +8,6 @@
#include "src/gpu/ops/DrawVerticesOp.h"
#include "include/core/SkM44.h"
-#include "include/effects/SkRuntimeEffect.h"
#include "src/core/SkArenaAlloc.h"
#include "src/core/SkDevice.h"
#include "src/core/SkMatrixPriv.h"
@@ -200,9 +199,13 @@
public:
DEFINE_OP_CLASS_ID
- DrawVerticesOpImpl(GrProcessorSet*, const SkPMColor4f&, sk_sp<SkVertices>,
- GrPrimitiveType, GrAAType, sk_sp<GrColorSpaceXform>, const SkMatrixProvider&,
- const SkRuntimeEffect*);
+ DrawVerticesOpImpl(GrProcessorSet*,
+ const SkPMColor4f&,
+ sk_sp<SkVertices>,
+ GrPrimitiveType,
+ GrAAType,
+ sk_sp<GrColorSpaceXform>,
+ const SkMatrixProvider&);
const char* name() const override { return "DrawVerticesOp"; }
@@ -301,8 +304,7 @@
GrPrimitiveType primitiveType,
GrAAType aaType,
sk_sp<GrColorSpaceXform> colorSpaceXform,
- const SkMatrixProvider& matrixProvider,
- const SkRuntimeEffect* effect)
+ const SkMatrixProvider& matrixProvider)
: INHERITED(ClassID())
, fHelper(processorSet, aaType)
, fPrimitiveType(primitiveType)
@@ -589,15 +591,18 @@
const SkMatrixProvider& matrixProvider,
GrAAType aaType,
sk_sp<GrColorSpaceXform> colorSpaceXform,
- GrPrimitiveType* overridePrimType,
- const SkRuntimeEffect* effect) {
+ GrPrimitiveType* overridePrimType) {
SkASSERT(vertices);
GrPrimitiveType primType = overridePrimType
? *overridePrimType
: SkVertexModeToGrPrimitiveType(vertices->priv().mode());
- return GrSimpleMeshDrawOpHelper::FactoryHelper<DrawVerticesOpImpl>(
- context, std::move(paint), std::move(vertices), primType, aaType,
- std::move(colorSpaceXform), matrixProvider, effect);
+ return GrSimpleMeshDrawOpHelper::FactoryHelper<DrawVerticesOpImpl>(context,
+ std::move(paint),
+ std::move(vertices),
+ primType,
+ aaType,
+ std::move(colorSpaceXform),
+ matrixProvider);
}
} // namespace skgpu::v1::DrawVerticesOp
@@ -720,9 +725,13 @@
if (numSamples > 1 && random->nextBool()) {
aaType = GrAAType::kMSAA;
}
- return skgpu::v1::DrawVerticesOp::Make(context, std::move(paint), std::move(vertices),
- matrixProvider, aaType, std::move(colorSpaceXform),
- &type, nullptr);
+ return skgpu::v1::DrawVerticesOp::Make(context,
+ std::move(paint),
+ std::move(vertices),
+ matrixProvider,
+ aaType,
+ std::move(colorSpaceXform),
+ &type);
}
#endif
diff --git a/src/gpu/ops/DrawVerticesOp.h b/src/gpu/ops/DrawVerticesOp.h
index 89d9eb0..400be1d 100644
--- a/src/gpu/ops/DrawVerticesOp.h
+++ b/src/gpu/ops/DrawVerticesOp.h
@@ -16,26 +16,24 @@
class GrPaint;
class GrRecordingContext;
class SkMatrixProvider;
-class SkRuntimeEffect;
class SkVertices;
namespace skgpu::v1::DrawVerticesOp {
- /**
- * Draw a SkVertices. The GrPaint param's color is used if the vertices lack per-vertex color.
- * If the vertices lack local coords then the vertex positions are used as local coords. The
- * primitive type drawn is derived from the SkVertices object, unless overridePrimType is
- * specified. If an SkRuntimeEffect is provided, it may expect some number of input varyings,
- * which should match the number of extra per-vertex values in the SkVertices.
- */
- GrOp::Owner Make(GrRecordingContext*,
- GrPaint&&,
- sk_sp<SkVertices>,
- const SkMatrixProvider&,
- GrAAType,
- sk_sp<GrColorSpaceXform>,
- GrPrimitiveType* overridePrimType,
- const SkRuntimeEffect*);
+/**
+ * Draw a SkVertices. The GrPaint param's color is used if the vertices lack per-vertex color.
+ * If the vertices lack local coords then the vertex positions are used as local coords. The
+ * primitive type drawn is derived from the SkVertices object, unless overridePrimType is
+ * specified. If an SkRuntimeEffect is provided, it may expect some number of input varyings,
+ * which should match the number of extra per-vertex values in the SkVertices.
+ */
+GrOp::Owner Make(GrRecordingContext*,
+ GrPaint&&,
+ sk_sp<SkVertices>,
+ const SkMatrixProvider&,
+ GrAAType,
+ sk_sp<GrColorSpaceXform>,
+ GrPrimitiveType* overridePrimType);
} // namespace skgpu::v1::DrawVerticesOp
diff --git a/src/gpu/v1/Device.cpp b/src/gpu/v1/Device.cpp
index 91cde8a..492480c 100644
--- a/src/gpu/v1/Device.cpp
+++ b/src/gpu/v1/Device.cpp
@@ -816,17 +816,16 @@
SkVerticesPriv info(vertices->priv());
- const SkRuntimeEffect* effect =
- paint.getShader() ? as_SB(paint.getShader())->asRuntimeEffect() : nullptr;
-
GrPaint grPaint;
if (!init_vertices_paint(fContext.get(), fSurfaceDrawContext->colorInfo(), paint,
this->asMatrixProvider(), mode, info.hasColors(), &grPaint)) {
return;
}
- fSurfaceDrawContext->drawVertices(this->clip(), std::move(grPaint), this->asMatrixProvider(),
- sk_ref_sp(const_cast<SkVertices*>(vertices)), nullptr,
- effect);
+ fSurfaceDrawContext->drawVertices(this->clip(),
+ std::move(grPaint),
+ this->asMatrixProvider(),
+ sk_ref_sp(const_cast<SkVertices*>(vertices)),
+ nullptr);
}
///////////////////////////////////////////////////////////////////////////////
diff --git a/src/gpu/v1/SurfaceDrawContext.cpp b/src/gpu/v1/SurfaceDrawContext.cpp
index cdc61ac..377a0de 100644
--- a/src/gpu/v1/SurfaceDrawContext.cpp
+++ b/src/gpu/v1/SurfaceDrawContext.cpp
@@ -978,8 +978,7 @@
GrPaint&& paint,
const SkMatrixProvider& matrixProvider,
sk_sp<SkVertices> vertices,
- GrPrimitiveType* overridePrimType,
- const SkRuntimeEffect* effect) {
+ GrPrimitiveType* overridePrimType) {
ASSERT_SINGLE_OWNER
RETURN_IF_ABANDONED
SkDEBUGCODE(this->validate();)
@@ -989,10 +988,13 @@
SkASSERT(vertices);
GrAAType aaType = fCanUseDynamicMSAA ? GrAAType::kMSAA : this->chooseAAType(GrAA::kNo);
- GrOp::Owner op =
- DrawVerticesOp::Make(fContext, std::move(paint), std::move(vertices), matrixProvider,
- aaType, this->colorInfo().refColorSpaceXformFromSRGB(),
- overridePrimType, effect);
+ GrOp::Owner op = DrawVerticesOp::Make(fContext,
+ std::move(paint),
+ std::move(vertices),
+ matrixProvider,
+ aaType,
+ this->colorInfo().refColorSpaceXformFromSRGB(),
+ overridePrimType);
this->addDrawOp(clip, std::move(op));
}
diff --git a/src/gpu/v1/SurfaceDrawContext_v1.h b/src/gpu/v1/SurfaceDrawContext_v1.h
index a9a9a41..311531d 100644
--- a/src/gpu/v1/SurfaceDrawContext_v1.h
+++ b/src/gpu/v1/SurfaceDrawContext_v1.h
@@ -51,7 +51,6 @@
class SkRegion;
class SkRRect;
struct SkRSXform;
-class SkRuntimeEffect;
class SkTextBlob;
class SkVertices;
@@ -363,7 +362,6 @@
const SkMatrix& viewMatrix,
GrStyledShape&&);
-
/**
* Draws vertices with a paint.
*
@@ -371,14 +369,12 @@
* @param viewMatrix transformation matrix
* @param vertices specifies the mesh to draw.
* @param overridePrimType primitive type to draw. If NULL, derive prim type from vertices.
- * @param effect runtime effect that will handle custom vertex attributes.
*/
void drawVertices(const GrClip*,
GrPaint&& paint,
const SkMatrixProvider& matrixProvider,
sk_sp<SkVertices> vertices,
- GrPrimitiveType* overridePrimType = nullptr,
- const SkRuntimeEffect* effect = nullptr);
+ GrPrimitiveType* overridePrimType = nullptr);
/**
* Draws textured sprites from an atlas with a paint. This currently does not support AA for the