aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrGpu.h
diff options
context:
space:
mode:
authorGravatar joshualitt <joshualitt@chromium.org>2015-01-20 09:08:51 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-01-20 09:08:52 -0800
commit873ad0e0b4d67bdc7bad025018f597450e7004c6 (patch)
tree5f9ec6f5fa8bff319bb2479f8b8e0375ee2c4f54 /src/gpu/GrGpu.h
parent94443b8718fa194bb2077324eade66bd68f99b54 (diff)
BUG=skia:
Diffstat (limited to 'src/gpu/GrGpu.h')
-rw-r--r--src/gpu/GrGpu.h37
1 files changed, 29 insertions, 8 deletions
diff --git a/src/gpu/GrGpu.h b/src/gpu/GrGpu.h
index 429c9c8439..cbae83f71f 100644
--- a/src/gpu/GrGpu.h
+++ b/src/gpu/GrGpu.h
@@ -20,6 +20,7 @@ class GrPath;
class GrPathRange;
class GrPathRenderer;
class GrPathRendererChain;
+class GrPrimitiveProcessor;
class GrStencilBuffer;
class GrVertexBufferAllocPool;
@@ -315,10 +316,12 @@ public:
GrContext::GPUStats* gpuStats() { return &fGPUStats; }
- virtual void buildProgramDesc(const GrOptDrawState&,
+ virtual void buildProgramDesc(GrProgramDesc*,
+ const GrPrimitiveProcessor&,
+ const GrOptDrawState&,
const GrProgramDesc::DescInfo&,
GrGpu::DrawType,
- GrProgramDesc*) = 0;
+ const GrBatchTracker&) const = 0;
/**
* Called at start and end of gpu trace marking
@@ -358,7 +361,25 @@ public:
const SkIRect& srcRect,
const SkIPoint& dstPoint) = 0;
- void draw(const GrOptDrawState&, const GrDrawTarget::DrawInfo&);
+ struct DrawArgs {
+ typedef GrDrawTarget::DrawInfo DrawInfo;
+ DrawArgs(const GrPrimitiveProcessor* primProc,
+ const GrOptDrawState* optState,
+ const GrProgramDesc* desc,
+ const GrBatchTracker* batchTracker)
+ : fPrimitiveProcessor(primProc)
+ , fOptState(optState)
+ , fDesc(desc)
+ , fBatchTracker(batchTracker) {
+ SkASSERT(primProc && optState && desc && batchTracker);
+ }
+ const GrPrimitiveProcessor* fPrimitiveProcessor;
+ const GrOptDrawState* fOptState;
+ const GrProgramDesc* fDesc;
+ const GrBatchTracker* fBatchTracker;
+ };
+
+ void draw(const DrawArgs&, const GrDrawTarget::DrawInfo&);
/** None of these params are optional, pointers used just to avoid making copies. */
struct StencilPathState {
@@ -371,8 +392,8 @@ public:
void stencilPath(const GrPath*, const StencilPathState&);
- void drawPath(const GrOptDrawState&, const GrPath*, const GrStencilSettings&);
- void drawPaths(const GrOptDrawState&,
+ void drawPath(const DrawArgs&, const GrPath*, const GrStencilSettings&);
+ void drawPaths(const DrawArgs&,
const GrPathRange*,
const void* indices,
GrDrawTarget::PathIndexType,
@@ -446,11 +467,11 @@ private:
bool insideClip) = 0;
// overridden by backend-specific derived class to perform the draw call.
- virtual void onDraw(const GrOptDrawState&, const GrDrawTarget::DrawInfo&) = 0;
+ virtual void onDraw(const DrawArgs&, const GrDrawTarget::DrawInfo&) = 0;
virtual void onStencilPath(const GrPath*, const StencilPathState&) = 0;
- virtual void onDrawPath(const GrOptDrawState&, const GrPath*, const GrStencilSettings&) = 0;
- virtual void onDrawPaths(const GrOptDrawState&,
+ virtual void onDrawPath(const DrawArgs&, const GrPath*, const GrStencilSettings&) = 0;
+ virtual void onDrawPaths(const DrawArgs&,
const GrPathRange*,
const void* indices,
GrDrawTarget::PathIndexType,