diff options
author | Robert Phillips <robertphillips@google.com> | 2017-07-27 12:01:46 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-07-27 16:42:33 +0000 |
commit | 7311b40efb0e1a75f3024eac3386e4f7d806675a (patch) | |
tree | 6e2ff357d138fd8e7fd698924c0b7d96acfb2703 /src | |
parent | cd924dba0496da51d766efa10828f4773d064f27 (diff) |
Make StencilPathArgs hold a GrRenderTargetProxy (rather than a GrRenderTarget)
Again, this will be useful when GrSurface does not have a origin field.
Change-Id: I0c4ef5b441eaf38f3489e8631aced11b11fdb6ac
Reviewed-on: https://skia-review.googlesource.com/27540
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/gpu/GrPathRendering.h | 12 | ||||
-rw-r--r-- | src/gpu/gl/GrGLPathRendering.cpp | 6 | ||||
-rw-r--r-- | src/gpu/ops/GrStencilPathOp.cpp | 2 |
3 files changed, 10 insertions, 10 deletions
diff --git a/src/gpu/GrPathRendering.h b/src/gpu/GrPathRendering.h index bcd2cfa89e..ac203eddeb 100644 --- a/src/gpu/GrPathRendering.h +++ b/src/gpu/GrPathRendering.h @@ -132,20 +132,20 @@ public: /** None of these params are optional, pointers used just to avoid making copies. */ struct StencilPathArgs { StencilPathArgs(bool useHWAA, - GrRenderTarget* renderTarget, + GrRenderTargetProxy* proxy, const SkMatrix* viewMatrix, const GrScissorState* scissor, const GrStencilSettings* stencil) : fUseHWAA(useHWAA) - , fRenderTarget(renderTarget) + , fProxy(proxy) , fViewMatrix(viewMatrix) , fScissor(scissor) , fStencil(stencil) { } - bool fUseHWAA; - GrRenderTarget* fRenderTarget; - const SkMatrix* fViewMatrix; - const GrScissorState* fScissor; + bool fUseHWAA; + GrRenderTargetProxy* fProxy; + const SkMatrix* fViewMatrix; + const GrScissorState* fScissor; const GrStencilSettings* fStencil; }; diff --git a/src/gpu/gl/GrGLPathRendering.cpp b/src/gpu/gl/GrGLPathRendering.cpp index fa3393f6d5..0b3baca566 100644 --- a/src/gpu/gl/GrGLPathRendering.cpp +++ b/src/gpu/gl/GrGLPathRendering.cpp @@ -119,10 +119,10 @@ void GrGLPathRendering::onStencilPath(const StencilPathArgs& args, const GrPath* SkASSERT(gpu->caps()->shaderCaps()->pathRenderingSupport()); gpu->flushColorWrite(false); - GrGLRenderTarget* rt = static_cast<GrGLRenderTarget*>(args.fRenderTarget); + GrGLRenderTarget* rt = static_cast<GrGLRenderTarget*>(args.fProxy->priv().peekRenderTarget()); SkISize size = SkISize::Make(rt->width(), rt->height()); - this->setProjectionMatrix(*args.fViewMatrix, size, rt->origin()); - gpu->flushScissor(*args.fScissor, rt->getViewport(), rt->origin()); + this->setProjectionMatrix(*args.fViewMatrix, size, args.fProxy->origin()); + gpu->flushScissor(*args.fScissor, rt->getViewport(), args.fProxy->origin()); gpu->flushHWAAState(rt, args.fUseHWAA, true); gpu->flushRenderTarget(rt, nullptr); diff --git a/src/gpu/ops/GrStencilPathOp.cpp b/src/gpu/ops/GrStencilPathOp.cpp index 41091f30fd..3c17e81f05 100644 --- a/src/gpu/ops/GrStencilPathOp.cpp +++ b/src/gpu/ops/GrStencilPathOp.cpp @@ -13,7 +13,7 @@ void GrStencilPathOp::onExecute(GrOpFlushState* state) { SkASSERT(state->drawOpArgs().renderTarget()); - GrPathRendering::StencilPathArgs args(fUseHWAA, state->drawOpArgs().renderTarget(), + GrPathRendering::StencilPathArgs args(fUseHWAA, state->drawOpArgs().fProxy, &fViewMatrix, &fScissor, &fStencil); state->gpu()->pathRendering()->stencilPath(args, fPath.get()); } |