Plumb SkMatrixProvider throughout Ganesh
Renames the provider to SkMatrixProvider, which is now also able to
provide the local-to-device matrix. Everywhere that does paint
conversion and FP generation now has access to the entire matrix
provider, instead of just the CTM.
This will allow the SkSL FP (and others) to fetch other matrix state.
Change-Id: Iffb00bae0d438da0e8de3eebe75183ed6d440fd6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284040
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
diff --git a/src/gpu/GrRenderTargetContext.cpp b/src/gpu/GrRenderTargetContext.cpp
index f291979..bb4c6ca 100644
--- a/src/gpu/GrRenderTargetContext.cpp
+++ b/src/gpu/GrRenderTargetContext.cpp
@@ -85,20 +85,25 @@
fRenderTargetContext->addDrawOp(clip, std::move(op));
}
- void drawShape(const GrClip& clip, const SkPaint& paint,
- const SkMatrix& viewMatrix, const GrStyledShape& shape) override {
+ void drawShape(const GrClip& clip,
+ const SkPaint& paint,
+ const SkMatrixProvider& matrixProvider,
+ const GrStyledShape& shape) override {
GrBlurUtils::drawShapeWithMaskFilter(fRenderTargetContext->fContext, fRenderTargetContext,
- clip, paint, viewMatrix, shape);
+ clip, paint, matrixProvider, shape);
}
- void makeGrPaint(GrMaskFormat maskFormat, const SkPaint& skPaint, const SkMatrix& viewMatrix,
+ void makeGrPaint(GrMaskFormat maskFormat,
+ const SkPaint& skPaint,
+ const SkMatrixProvider& matrixProvider,
GrPaint* grPaint) override {
auto context = fRenderTargetContext->fContext;
const GrColorInfo& colorInfo = fRenderTargetContext->colorInfo();
if (kARGB_GrMaskFormat == maskFormat) {
- SkPaintToGrPaintWithPrimitiveColor(context, colorInfo, skPaint, grPaint);
+ SkPaintToGrPaintWithPrimitiveColor(context, colorInfo, skPaint, matrixProvider,
+ grPaint);
} else {
- SkPaintToGrPaint(context, colorInfo, skPaint, viewMatrix, grPaint);
+ SkPaintToGrPaint(context, colorInfo, skPaint, matrixProvider, grPaint);
}
}
@@ -435,9 +440,9 @@
return fOpsTask.get();
}
-void GrRenderTargetContext::drawGlyphRunList(
- const GrClip& clip, const SkMatrix& viewMatrix,
- const SkGlyphRunList& blob) {
+void GrRenderTargetContext::drawGlyphRunList(const GrClip& clip,
+ const SkMatrixProvider& matrixProvider,
+ const SkGlyphRunList& blob) {
ASSERT_SINGLE_OWNER
RETURN_IF_ABANDONED
SkDEBUGCODE(this->validate();)
@@ -451,7 +456,7 @@
}
GrTextContext* atlasTextContext = this->drawingManager()->getTextContext();
- atlasTextContext->drawGlyphRunList(fContext, fTextTarget.get(), clip, viewMatrix,
+ atlasTextContext->drawGlyphRunList(fContext, fTextTarget.get(), clip, matrixProvider,
fSurfaceProps, blob);
}
@@ -1081,11 +1086,10 @@
void GrRenderTargetContext::drawVertices(const GrClip& clip,
GrPaint&& paint,
- const SkMatrix& viewMatrix,
+ const SkMatrixProvider& matrixProvider,
sk_sp<SkVertices> vertices,
GrPrimitiveType* overridePrimType,
- const SkRuntimeEffect* effect,
- const SkMarkedMatrixProvider* matrixProvider) {
+ const SkRuntimeEffect* effect) {
ASSERT_SINGLE_OWNER
RETURN_IF_ABANDONED
SkDEBUGCODE(this->validate();)
@@ -1096,9 +1100,9 @@
SkASSERT(vertices);
GrAAType aaType = this->chooseAAType(GrAA::kNo);
std::unique_ptr<GrDrawOp> op =
- GrDrawVerticesOp::Make(fContext, std::move(paint), std::move(vertices), viewMatrix,
+ GrDrawVerticesOp::Make(fContext, std::move(paint), std::move(vertices), matrixProvider,
aaType, this->colorInfo().refColorSpaceXformFromSRGB(),
- overridePrimType, effect, matrixProvider);
+ overridePrimType, effect);
this->addDrawOp(clip, std::move(op));
}