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

Unified Diff: src/gpu/GrGpu.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/GrBatchFlushState.h ('k') | src/gpu/GrGpu.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrGpu.h
diff --git a/src/gpu/GrGpu.h b/src/gpu/GrGpu.h
index 9725590544fbc599bf91df5317462e764108c623..161ca5c35d42f0713d62a2aa66c0466bac99890f 100644
--- a/src/gpu/GrGpu.h
+++ b/src/gpu/GrGpu.h
@@ -23,6 +23,7 @@ class GrBatchTracker;
class GrContext;
class GrGLContext;
class GrIndexBuffer;
+class GrMesh;
class GrNonInstancedVertices;
class GrPath;
class GrPathRange;
@@ -37,7 +38,6 @@ class GrSurface;
class GrTexture;
class GrTransferBuffer;
class GrVertexBuffer;
-class GrVertices;
class GrGpu : public SkRefCnt {
public:
@@ -353,10 +353,6 @@ public:
// is dirty.
ResetTimestamp getResetTimestamp() const { return fResetTimestamp; }
- virtual void buildProgramDesc(GrProgramDesc*,
- const GrPrimitiveProcessor&,
- const GrPipeline&) const = 0;
-
// Called to perform a surface to surface copy. Fallbacks to issuing a draw from the src to dst
// take place at the GrDrawTarget level and this function implement faster copy paths. The rect
// and point are pre-clipped. The src rect and implied dst rect are guaranteed to be within the
@@ -382,21 +378,13 @@ public:
// multisample information itself.
const MultisampleSpecs& getMultisampleSpecs(GrRenderTarget*, const GrStencilSettings&);
- struct DrawArgs {
- DrawArgs(const GrPrimitiveProcessor* primProc,
- const GrPipeline* pipeline,
- const GrProgramDesc* desc)
- : fPrimitiveProcessor(primProc)
- , fPipeline(pipeline)
- , fDesc(desc) {
- SkASSERT(primProc && pipeline && desc);
- }
- const GrPrimitiveProcessor* fPrimitiveProcessor;
- const GrPipeline* fPipeline;
- const GrProgramDesc* fDesc;
- };
-
- void draw(const DrawArgs&, const GrVertices&);
+ // We pass in an array of meshCount GrMesh to the draw. The backend should loop over each
+ // GrMesh object and emit a draw for it. Each draw will use the same GrPipeline and
+ // GrPrimitiveProcessor.
+ void draw(const GrPipeline&,
+ const GrPrimitiveProcessor&,
+ const GrMesh*,
+ int meshCount);
// Called by drawtarget when flushing.
// Provides a hook for post-flush actions (e.g. PLS reset and Vulkan command buffer submits).
@@ -571,13 +559,15 @@ private:
// overridden by backend-specific derived class to perform the clear.
virtual void onClear(GrRenderTarget*, const SkIRect& rect, GrColor color) = 0;
-
// Overridden by backend specific classes to perform a clear of the stencil clip bits. This is
// ONLY used by the the clip target
virtual void onClearStencilClip(GrRenderTarget*, const SkIRect& rect, bool insideClip) = 0;
// overridden by backend-specific derived class to perform the draw call.
- virtual void onDraw(const DrawArgs&, const GrNonInstancedVertices&) = 0;
+ virtual void onDraw(const GrPipeline&,
+ const GrPrimitiveProcessor&,
+ const GrMesh*,
+ int meshCount) = 0;
virtual bool onMakeCopyForTextureParams(GrTexture* texture, const GrTextureParams&,
GrTextureProducer::CopyParams*) const { return false; }
« no previous file with comments | « src/gpu/GrBatchFlushState.h ('k') | src/gpu/GrGpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698