aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/ops
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-08-10 08:44:49 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-08-10 12:47:25 +0000
commit65048139bd26c8edbc6796f220e79b6c848151d7 (patch)
tree3870d39758c3bd26843c754c3d491999632528d2 /src/gpu/ops
parent2ef3b0fe3a02513cf0fea519bb67027a6809b7a8 (diff)
Remove accessRenderTarget calls in service of binding stencil buffer
Change-Id: Ifca6e21c619a0433ecf0b8699d92661f8c3068a8 Reviewed-on: https://skia-review.googlesource.com/31243 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/ops')
-rw-r--r--src/gpu/ops/GrStencilPathOp.cpp10
-rw-r--r--src/gpu/ops/GrStencilPathOp.h12
2 files changed, 14 insertions, 8 deletions
diff --git a/src/gpu/ops/GrStencilPathOp.cpp b/src/gpu/ops/GrStencilPathOp.cpp
index 53a55cc979..4c89ec0b05 100644
--- a/src/gpu/ops/GrStencilPathOp.cpp
+++ b/src/gpu/ops/GrStencilPathOp.cpp
@@ -9,10 +9,18 @@
#include "GrGpu.h"
#include "GrOpFlushState.h"
+#include "GrRenderTargetPriv.h"
void GrStencilPathOp::onExecute(GrOpFlushState* state) {
+ GrRenderTarget* rt = state->drawOpArgs().renderTarget();
+ SkASSERT(rt);
+
+ int numStencilBits = rt->renderTargetPriv().numStencilBits();
+ GrStencilSettings stencil(GrPathRendering::GetStencilPassSettings(fFillType),
+ fHasStencilClip, numStencilBits);
+
GrPathRendering::StencilPathArgs args(fUseHWAA, state->drawOpArgs().fProxy,
- &fViewMatrix, &fScissor, &fStencil);
+ &fViewMatrix, &fScissor, &stencil);
state->gpu()->pathRendering()->stencilPath(args, fPath.get());
}
diff --git a/src/gpu/ops/GrStencilPathOp.h b/src/gpu/ops/GrStencilPathOp.h
index 45240be4fd..64df726536 100644
--- a/src/gpu/ops/GrStencilPathOp.h
+++ b/src/gpu/ops/GrStencilPathOp.h
@@ -23,13 +23,11 @@ public:
bool useHWAA,
GrPathRendering::FillType fillType,
bool hasStencilClip,
- int numStencilBits,
const GrScissorState& scissor,
const GrPath* path) {
return std::unique_ptr<GrOp>(new GrStencilPathOp(viewMatrix, useHWAA, fillType,
- hasStencilClip, numStencilBits, scissor,
- path));
+ hasStencilClip, scissor, path));
}
const char* name() const override { return "StencilPathOp"; }
@@ -46,14 +44,13 @@ private:
bool useHWAA,
GrPathRendering::FillType fillType,
bool hasStencilClip,
- int numStencilBits,
const GrScissorState& scissor,
const GrPath* path)
: INHERITED(ClassID())
, fViewMatrix(viewMatrix)
, fUseHWAA(useHWAA)
- , fStencil(GrPathRendering::GetStencilPassSettings(fillType), hasStencilClip,
- numStencilBits)
+ , fFillType(fillType)
+ , fHasStencilClip(hasStencilClip)
, fScissor(scissor)
, fPath(path) {
this->setBounds(path->getBounds(), HasAABloat::kNo, IsZeroArea::kNo);
@@ -67,7 +64,8 @@ private:
SkMatrix fViewMatrix;
bool fUseHWAA;
- GrStencilSettings fStencil;
+ GrPathRendering::FillType fFillType;
+ bool fHasStencilClip;
GrScissorState fScissor;
GrPendingIOResource<const GrPath, kRead_GrIOType> fPath;