Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(250)

Unified Diff: src/gpu/batches/GrStencilPathBatch.h

Issue 2215323003: Start using RenderTargetProxy (omnibus) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/batches/GrDrawBatch.h ('k') | src/gpu/effects/GrConfigConversionEffect.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/batches/GrStencilPathBatch.h
diff --git a/src/gpu/batches/GrStencilPathBatch.h b/src/gpu/batches/GrStencilPathBatch.h
index 73bec195d00b3a8c5b1f406dd3807886dc114491..79fa9e1bba9c2afa4fdc5406a40f5fe06211dda7 100644
--- a/src/gpu/batches/GrStencilPathBatch.h
+++ b/src/gpu/batches/GrStencilPathBatch.h
@@ -25,16 +25,16 @@ public:
bool hasStencilClip,
int numStencilBits,
const GrScissorState& scissor,
- GrRenderTarget* renderTarget,
+ GrRenderTargetProxy* rtp,
const GrPath* path) {
return new GrStencilPathBatch(viewMatrix, useHWAA, fillType, hasStencilClip,
- numStencilBits, scissor, renderTarget, path);
+ numStencilBits, scissor, rtp, path);
}
const char* name() const override { return "StencilPath"; }
- uint32_t renderTargetUniqueID() const override { return fRenderTarget.get()->uniqueID(); }
- GrRenderTarget* renderTarget() const override { return fRenderTarget.get(); }
+ uint32_t renderTargetUniqueID() const override { return fRenderTargetProxy.get()->uniqueID(); }
+ GrRenderTargetProxy* rtp() const override { return fRenderTargetProxy.get(); }
SkString dumpInfo() const override {
SkString string;
@@ -50,14 +50,14 @@ private:
bool hasStencilClip,
int numStencilBits,
const GrScissorState& scissor,
- GrRenderTarget* renderTarget,
+ GrRenderTargetProxy* rtp,
const GrPath* path)
: INHERITED(ClassID())
, fViewMatrix(viewMatrix)
, fUseHWAA(useHWAA)
, fStencil(GrPathRendering::GetStencilPassSettings(fillType), hasStencilClip, numStencilBits)
, fScissor(scissor)
- , fRenderTarget(renderTarget)
+ , fRenderTargetProxy(rtp)
, fPath(path) {
this->setBounds(path->getBounds(), HasAABloat::kNo, IsZeroArea::kNo);
}
@@ -67,17 +67,20 @@ private:
void onPrepare(GrBatchFlushState*) override {}
void onDraw(GrBatchFlushState* state, const SkRect& bounds) override {
- GrPathRendering::StencilPathArgs args(fUseHWAA, fRenderTarget.get(), &fViewMatrix,
+ GrTextureProvider* prov = state->gpu()->getContext()->textureProvider();
+ GrRenderTarget* renderTarget = fRenderTargetProxy.get()->instantiate(prov);
+ GrPathRendering::StencilPathArgs args(fUseHWAA, renderTarget, &fViewMatrix,
&fScissor, &fStencil);
state->gpu()->pathRendering()->stencilPath(args, fPath.get());
}
- SkMatrix fViewMatrix;
- bool fUseHWAA;
- GrStencilSettings fStencil;
- GrScissorState fScissor;
- GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> fRenderTarget;
- GrPendingIOResource<const GrPath, kRead_GrIOType> fPath;
+ SkMatrix fViewMatrix;
+ bool fUseHWAA;
+ GrStencilSettings fStencil;
+ GrScissorState fScissor;
+// GrPendingIOResource<GrRenderTargetProxy, kWrite_GrIOType> fRenderTargetProxy;
+ sk_sp<GrRenderTargetProxy> fRenderTargetProxy;
+ GrPendingIOResource<const GrPath, kRead_GrIOType> fPath;
typedef GrBatch INHERITED;
};
« no previous file with comments | « src/gpu/batches/GrDrawBatch.h ('k') | src/gpu/effects/GrConfigConversionEffect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698