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>
This commit is contained in:
parent
cd924dba04
commit
7311b40efb
@ -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;
|
||||
};
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user