diff options
author | Brian Salomon <bsalomon@google.com> | 2017-03-09 13:50:43 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-03-09 19:26:13 +0000 |
commit | 649a3411f99a8aea3c46e4ef1f495f61b9801164 (patch) | |
tree | 1de3926cfb95e9fa7b440b26dfa6988fd351eccf /tests/ProcessorTest.cpp | |
parent | 383dd9dc58a142392907a3a975d5f3317cda5288 (diff) |
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>
Diffstat (limited to 'tests/ProcessorTest.cpp')
-rw-r--r-- | tests/ProcessorTest.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/ProcessorTest.cpp b/tests/ProcessorTest.cpp index 03646e1d44..7d9349ba6d 100644 --- a/tests/ProcessorTest.cpp +++ b/tests/ProcessorTest.cpp @@ -27,7 +27,9 @@ public: 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 @@ DEF_GPUTEST_FOR_ALL_CONTEXTS(ProcessorRefTest, reporter, ctxInfo) { 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 @@ DEF_GPUTEST_FOR_ALL_CONTEXTS(ProcessorRefTest, reporter, ctxInfo) { 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 @@ void test_draw_op(GrContext* context, GrRenderTargetContext* rtc, sk_sp<GrFragme 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 |