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

Unified Diff: src/gpu/GrPathRendering.h

Issue 1806983002: Update how we send draws to gpu backend to reduce state setting. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: nit Created 4 years, 9 months 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/GrOvalRenderer.cpp ('k') | src/gpu/GrTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrPathRendering.h
diff --git a/src/gpu/GrPathRendering.h b/src/gpu/GrPathRendering.h
index a2e9c0295b86870e03d0e363f69a9e8af050dc2d..b2863b5b36c73ea38b063f982460597fb67257aa 100644
--- a/src/gpu/GrPathRendering.h
+++ b/src/gpu/GrPathRendering.h
@@ -152,38 +152,35 @@ public:
this->onStencilPath(args, path);
}
- struct DrawPathArgs : public GrGpu::DrawArgs {
- DrawPathArgs(const GrPrimitiveProcessor* primProc,
- const GrPipeline* pipeline,
- const GrProgramDesc* desc,
- const GrStencilSettings* stencil)
- : DrawArgs(primProc, pipeline, desc)
- , fStencil(stencil) {
- }
-
- const GrStencilSettings* fStencil;
- };
-
- void drawPath(const DrawPathArgs& args, const GrPath* path) {
+ void drawPath(const GrPipeline& pipeline,
+ const GrPrimitiveProcessor& primProc,
+ const GrStencilSettings& stencil,
+ const GrPath* path) {
fGpu->handleDirtyContext();
- if (GrXferBarrierType barrierType = args.fPipeline->xferBarrierType(*fGpu->caps())) {
- fGpu->xferBarrier(args.fPipeline->getRenderTarget(), barrierType);
+ if (GrXferBarrierType barrierType = pipeline.xferBarrierType(*fGpu->caps())) {
+ fGpu->xferBarrier(pipeline.getRenderTarget(), barrierType);
}
- this->onDrawPath(args, path);
+ this->onDrawPath(pipeline, primProc, stencil, path);
}
- void drawPaths(const DrawPathArgs& args, const GrPathRange* pathRange, const void* indices,
- PathIndexType indexType, const float transformValues[],
- PathTransformType transformType, int count) {
+ void drawPaths(const GrPipeline& pipeline,
+ const GrPrimitiveProcessor& primProc,
+ const GrStencilSettings& stencil,
+ const GrPathRange* pathRange,
+ const void* indices,
+ PathIndexType indexType,
+ const float transformValues[],
+ PathTransformType transformType,
+ int count) {
fGpu->handleDirtyContext();
- if (GrXferBarrierType barrierType = args.fPipeline->xferBarrierType(*fGpu->caps())) {
- fGpu->xferBarrier(args.fPipeline->getRenderTarget(), barrierType);
+ if (GrXferBarrierType barrierType = pipeline.xferBarrierType(*fGpu->caps())) {
+ fGpu->xferBarrier(pipeline.getRenderTarget(), barrierType);
}
#ifdef SK_DEBUG
pathRange->assertPathsLoaded(indices, indexType, count);
#endif
- this->onDrawPaths(args, pathRange, indices, indexType, transformValues, transformType,
- count);
+ this->onDrawPaths(pipeline, primProc, stencil, pathRange, indices, indexType,
+ transformValues, transformType, count);
}
protected:
@@ -191,9 +188,19 @@ protected:
: fGpu(gpu) {
}
virtual void onStencilPath(const StencilPathArgs&, const GrPath*) = 0;
- virtual void onDrawPath(const DrawPathArgs&, const GrPath*) = 0;
- virtual void onDrawPaths(const DrawPathArgs&, const GrPathRange*, const void*, PathIndexType,
- const float[], PathTransformType, int) = 0;
+ virtual void onDrawPath(const GrPipeline&,
+ const GrPrimitiveProcessor&,
+ const GrStencilSettings&,
+ const GrPath*) = 0;
+ virtual void onDrawPaths(const GrPipeline&,
+ const GrPrimitiveProcessor&,
+ const GrStencilSettings&,
+ const GrPathRange*,
+ const void* indices,
+ PathIndexType,
+ const float transformValues[],
+ PathTransformType,
+ int count) = 0;
GrGpu* fGpu;
private:
« no previous file with comments | « src/gpu/GrOvalRenderer.cpp ('k') | src/gpu/GrTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698