Index: src/gpu/GrDrawTarget.h |
diff --git a/src/gpu/GrDrawTarget.h b/src/gpu/GrDrawTarget.h |
index 0e211ba85d44ecca6170f02f130222f19a7dfa39..583a84968cf7233bf794b973f6d96757cc3e2296 100644 |
--- a/src/gpu/GrDrawTarget.h |
+++ b/src/gpu/GrDrawTarget.h |
@@ -26,6 +26,7 @@ |
#include "SkTypes.h" |
#include "SkXfermode.h" |
+class GrBatch; |
class GrClipData; |
class GrDrawTargetCaps; |
class GrPath; |
@@ -259,6 +260,11 @@ public: |
int vertexCount, |
const SkRect* devBounds = NULL); |
+ void batchDraw(GrDrawState*, |
+ GrBatch*, |
+ GrPrimitiveType, |
bsalomon
2015/01/20 16:14:03
what's primtype doing here?
joshualitt
2015/01/20 17:03:08
I'd prefer to roll out batch everywhere, and then
bsalomon
2015/01/20 20:49:58
I guess I just don't understand why it's here or w
|
+ const SkRect* devBounds = NULL); |
+ |
/** |
* Draws path into the stencil buffer. The fill must be either even/odd or |
* winding (not inverse or hairline). It will respect the HW antialias flag |
@@ -524,6 +530,7 @@ public: |
*/ |
class DrawInfo { |
public: |
+ DrawInfo() { fDevBounds = NULL; } |
DrawInfo(const DrawInfo& di) { (*this) = di; } |
DrawInfo& operator =(const DrawInfo& di); |
@@ -536,6 +543,15 @@ public: |
int indicesPerInstance() const { return fIndicesPerInstance; } |
int instanceCount() const { return fInstanceCount; } |
+ void setPrimitiveType(GrPrimitiveType type) { fPrimitiveType = type; } |
+ void setStartVertex(int startVertex) { fStartVertex = startVertex; } |
+ void setStartIndex(int startIndex) { fStartIndex = startIndex; } |
+ void setVertexCount(int vertexCount) { fVertexCount = vertexCount; } |
+ void setIndexCount(int indexCount) { fIndexCount = indexCount; } |
+ void setVerticesPerInstance(int verticesPerI) { fVerticesPerInstance = verticesPerI; } |
+ void setIndicesPerInstance(int indicesPerI) { fIndicesPerInstance = indicesPerI; } |
+ void setInstanceCount(int instanceCount) { fInstanceCount = instanceCount; } |
+ |
bool isIndexed() const { return fIndexCount > 0; } |
#ifdef SK_DEBUG |
bool isInstanced() const; // this version is longer because of asserts |
@@ -565,8 +581,6 @@ public: |
const SkRect* getDevBounds() const { return fDevBounds; } |
private: |
- DrawInfo() { fDevBounds = NULL; } |
- |
friend class GrDrawTarget; |
GrPrimitiveType fPrimitiveType; |
@@ -664,6 +678,10 @@ protected: |
const GrPrimitiveProcessor*, |
GrDeviceCoordTexture* dstCopy, |
const SkRect* drawBounds); |
+ bool setupDstReadIfNecessary(GrDrawState*, |
+ const GrBatch*, |
+ GrDeviceCoordTexture* dstCopy, |
+ const SkRect* drawBounds); |
private: |
/** |
@@ -706,6 +724,11 @@ private: |
const DrawInfo&, |
const GrScissorState&, |
const GrDeviceCoordTexture* dstCopy) = 0; |
+ virtual void onBatchDraw(GrBatch*, |
+ const GrDrawState&, |
+ GrPrimitiveType type, |
+ const GrScissorState&, |
+ const GrDeviceCoordTexture* dstCopy) = 0; |
// TODO copy in order drawbuffer onDrawRect to here |
virtual void onDrawRect(GrDrawState*, |
GrColor color, |