Stop flattening GrCoordTransforms in parent GrFragmentProcessors.
This changes moves to a model that iterates over GrCTs in a GrFP hierarchy when inserting transformations by GrGLSLPrimitiveProcessors.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2339203002
Committed: https://skia.googlesource.com/skia/+/d91237ee051523f439238042674ade99207fe4a6
Review-Url: https://codereview.chromium.org/2339203002
diff --git a/src/gpu/batches/GrAnalyticRectBatch.cpp b/src/gpu/batches/GrAnalyticRectBatch.cpp
index 7be0ad3..8c0f419 100644
--- a/src/gpu/batches/GrAnalyticRectBatch.cpp
+++ b/src/gpu/batches/GrAnalyticRectBatch.cpp
@@ -18,6 +18,7 @@
#include "batches/GrVertexBatch.h"
#include "glsl/GrGLSLFragmentShaderBuilder.h"
#include "glsl/GrGLSLGeometryProcessor.h"
+#include "glsl/GrGLSLGeometryProcessor.h"
#include "glsl/GrGLSLProgramDataManager.h"
#include "glsl/GrGLSLVarying.h"
#include "glsl/GrGLSLVertexShaderBuilder.h"
@@ -120,8 +121,7 @@
gpArgs->fPositionVar,
rgp.inPosition()->fName,
rgp.localMatrix(),
- args.fTransformsIn,
- args.fTransformsOut);
+ args.fFPCoordTransformHandler);
// TODO: compute all these offsets, spans, and scales in the VS
fragBuilder->codeAppendf("float insetW = min(1.0, %s.x) - 0.5;",
@@ -194,15 +194,10 @@
b->add32(0x0);
}
- void setData(const GrGLSLProgramDataManager& pdman,
- const GrPrimitiveProcessor& gp) override {}
-
- void setTransformData(const GrPrimitiveProcessor& primProc,
- const GrGLSLProgramDataManager& pdman,
- int index,
- const SkTArray<const GrCoordTransform*, true>& transforms) override {
- this->setTransformDataHelper(primProc.cast<RectGeometryProcessor>().fLocalMatrix, pdman,
- index, transforms);
+ void setData(const GrGLSLProgramDataManager& pdman, const GrPrimitiveProcessor& primProc,
+ FPCoordTransformIter&& transformIter) override {
+ const RectGeometryProcessor& rgp = primProc.cast<RectGeometryProcessor>();
+ this->setTransformDataHelper(rgp.fLocalMatrix, pdman,&transformIter);
}
private: