aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrBatch.h
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2015-05-04 11:41:41 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-05-04 11:41:42 -0700
commit8415abe44cf205ac214b7793c076fd8c13272240 (patch)
treec527e81183de555849faf4f6bc83c9db0cad7a87 /src/gpu/GrBatch.h
parentf28381c6866cad92af8ebe5b9d2db074613b1963 (diff)
Revert of Start on simplifying generateGeometry() overrides (patchset #10 id:160001 of https://codereview.chromium.org/1122673002/)
Reason for revert: Breaking bots Original issue's description: > Start on simplifying generateGeometry() overrides > > Committed: https://skia.googlesource.com/skia/+/f28381c6866cad92af8ebe5b9d2db074613b1963 TBR=joshualitt@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/1124633003
Diffstat (limited to 'src/gpu/GrBatch.h')
-rw-r--r--src/gpu/GrBatch.h44
1 files changed, 1 insertions, 43 deletions
diff --git a/src/gpu/GrBatch.h b/src/gpu/GrBatch.h
index 38316cebad..7b5c888a70 100644
--- a/src/gpu/GrBatch.h
+++ b/src/gpu/GrBatch.h
@@ -11,12 +11,12 @@
#include <new>
// TODO remove this header when we move entirely to batch
#include "GrDrawTarget.h"
-#include "GrBatchTarget.h"
#include "GrGeometryProcessor.h"
#include "SkRefCnt.h"
#include "SkThread.h"
#include "SkTypes.h"
+class GrBatchTarget;
class GrGpu;
class GrIndexBufferAllocPool;
class GrPipeline;
@@ -113,48 +113,6 @@ protected:
return fBounds.joinPossiblyEmptyRect(otherBounds);
}
- /** Helper for rendering instances using an instanced index index buffer. This class creates the
- space for the vertices and flushes the draws to the batch target.*/
- class InstancedHelper {
- public:
- InstancedHelper() : fInstancesRemaining(0) {}
- /** Returns the allocated storage for the vertices. The caller should populate the before
- vertices before calling issueDraws(). */
- void* init(GrBatchTarget* batchTarget, size_t vertexStride,
- const GrIndexBuffer* indexBuffer, int verticesPerInstance,
- int indicesPerInstance, int instancesToDraw);
-
- /** Call after init() to issue draws to the batch target.*/
- void issueDraws(GrBatchTarget* batchTarget) {
- SkASSERT(fDrawInfo.instanceCount());
- do {
- batchTarget->draw(fDrawInfo);
- } while (fDrawInfo.nextInstances(&fInstancesRemaining, fMaxInstancesPerDraw));
- }
- private:
- int fInstancesRemaining;
- int fMaxInstancesPerDraw;
- GrDrawTarget::DrawInfo fDrawInfo;
- };
-
- static const int kVerticesPerQuad = 4;
- static const int kIndicesPerQuad = 6;
-
- /** A specialization of InstanceHelper for quad rendering. */
- class QuadHelper : private InstancedHelper {
- public:
- QuadHelper() : INHERITED() {}
- /** Finds the cached quad index buffer and reserves vertex space. Returns NULL on failure
- and on sucess a pointer to the vertex data that the caller should populate before
- calling issueDraws(). */
- void* init(GrBatchTarget* batchTarget, size_t vertexStride, int quadsToDraw);
-
- using InstancedHelper::issueDraws;
-
- private:
- typedef InstancedHelper INHERITED;
- };
-
SkRect fBounds;
private: