Add a separate draw function to GrRenderTargetContext for GrMeshDrawOp derived classes.
The first phase of deferring GrPipeline creation until flush will apply only to GrDrawOp subclasses that do not derive from GrMeshDrawOp. This change prepares for that by creating separate draw functions on GrRenderTargetContext for GrMeshDrawOp-derived ops. This is temporary and will incrementally be undone as pipeline-creation deferral rolls out to the GrMeshDrawOps in a later phase of this work.
Change-Id: I0f5b71fe913f3273cfe9e965f7d8bbe7f01ad0ef
Reviewed-on: https://skia-review.googlesource.com/9481
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
diff --git a/tests/ProcessorTest.cpp b/tests/ProcessorTest.cpp
index 03646e1..7d9349b 100644
--- a/tests/ProcessorTest.cpp
+++ b/tests/ProcessorTest.cpp
@@ -27,7 +27,9 @@
DEFINE_OP_CLASS_ID
const char* name() const override { return "TestOp"; }
- static std::unique_ptr<GrDrawOp> Make() { return std::unique_ptr<GrDrawOp>(new TestOp); }
+ static std::unique_ptr<GrMeshDrawOp> Make() {
+ return std::unique_ptr<GrMeshDrawOp>(new TestOp);
+ }
private:
TestOp() : INHERITED(ClassID(), SkRect::MakeWH(100, 100), 0xFFFFFFFF) {}
@@ -167,7 +169,7 @@
images.emplace_back(texture3, GrIOType::kWrite_GrIOType);
images.emplace_back(texture4, GrIOType::kRW_GrIOType);
}
- std::unique_ptr<GrDrawOp> op(TestOp::Make());
+ std::unique_ptr<GrMeshDrawOp> op(TestOp::Make());
GrPaint paint;
auto fp = TestFP::Make(context,
std::move(proxies), std::move(buffers), std::move(images));
@@ -175,8 +177,8 @@
fp = TestFP::Make(std::move(fp));
}
paint.addColorFragmentProcessor(std::move(fp));
- renderTargetContext->priv().testingOnly_addDrawOp(std::move(paint), GrAAType::kNone,
- std::move(op));
+ renderTargetContext->priv().testingOnly_addMeshDrawOp(
+ std::move(paint), GrAAType::kNone, std::move(op));
}
int refCnt, readCnt, writeCnt;
@@ -264,7 +266,7 @@
auto op =
GrNonAAFillRectOp::Make(GrColor_WHITE, SkMatrix::I(),
SkRect::MakeWH(rtc->width(), rtc->height()), nullptr, nullptr);
- rtc->addDrawOp(pb, GrNoClip(), std::move(op));
+ rtc->addMeshDrawOp(pb, GrNoClip(), std::move(op));
}
#if GR_TEST_UTILS