diff options
author | Robert Phillips <robertphillips@google.com> | 2018-06-12 10:11:12 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-06-12 14:43:03 +0000 |
commit | 7c525e62d405d57ae7a7742cf607b9770a83a0ab (patch) | |
tree | 8dabe9ed08bddd398b8fac935decaf2743f5a6f7 /tests/PrimitiveProcessorTest.cpp | |
parent | 7deacf4833dcdb6c1101a18a2b46a8c516a96f9a (diff) |
Plumb GrContext everywhere
There is no good way to split the monster CL up. This breaks out
the GrContext plumbing but doesn't use it.
Change-Id: I90856d428d372bcec3f8821e6364667b367927d4
Reviewed-on: https://skia-review.googlesource.com/133382
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'tests/PrimitiveProcessorTest.cpp')
-rw-r--r-- | tests/PrimitiveProcessorTest.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/PrimitiveProcessorTest.cpp b/tests/PrimitiveProcessorTest.cpp index 36709f8694..3a76e6c5e0 100644 --- a/tests/PrimitiveProcessorTest.cpp +++ b/tests/PrimitiveProcessorTest.cpp @@ -14,6 +14,7 @@ #include "GrContextPriv.h" #include "GrGeometryProcessor.h" #include "GrGpu.h" +#include "GrMemoryPool.h" #include "GrOpFlushState.h" #include "GrRenderTargetContext.h" #include "GrRenderTargetContextPriv.h" @@ -31,7 +32,7 @@ public: const char* name() const override { return "Dummy Op"; } - static std::unique_ptr<GrDrawOp> Make(int numAttribs) { + static std::unique_ptr<GrDrawOp> Make(GrContext* context, int numAttribs) { return std::unique_ptr<GrDrawOp>(new Op(numAttribs)); } @@ -45,6 +46,8 @@ public: } private: + friend class ::GrOpMemoryPool; + Op(int numAttribs) : INHERITED(ClassID()), fNumAttribs(numAttribs) { this->setBounds(SkRect::MakeWH(1.f, 1.f), HasAABloat::kNo, IsZeroArea::kNo); } @@ -140,14 +143,14 @@ DEF_GPUTEST_FOR_ALL_CONTEXTS(VertexAttributeCount, reporter, ctxInfo) { GrPaint grPaint; // This one should succeed. - renderTargetContext->priv().testingOnly_addDrawOp(Op::Make(attribCnt)); + renderTargetContext->priv().testingOnly_addDrawOp(Op::Make(context, attribCnt)); context->flush(); #if GR_GPU_STATS REPORTER_ASSERT(reporter, gpu->stats()->numDraws() == 1); REPORTER_ASSERT(reporter, gpu->stats()->numFailedDraws() == 0); #endif context->contextPriv().resetGpuStats(); - renderTargetContext->priv().testingOnly_addDrawOp(Op::Make(attribCnt + 1)); + renderTargetContext->priv().testingOnly_addDrawOp(Op::Make(context, attribCnt + 1)); context->flush(); #if GR_GPU_STATS REPORTER_ASSERT(reporter, gpu->stats()->numDraws() == 0); |