aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrBatchFlushState.h
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2016-12-01 10:59:09 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-12-01 16:45:27 +0000
commit9afd371a8a66f992f98eb2a3fc75ae64bddc730b (patch)
tree7c4853fe590fa370be28e92fe772356aa61b9ccd /src/gpu/GrBatchFlushState.h
parent62458a6778bc39eea5360301a67d192b3a263df1 (diff)
Rename GrDrawBatch->GrDrawOp
Change-Id: I18f520924b8a2548566fd61dbea4e3e12bd253dd Reviewed-on: https://skia-review.googlesource.com/5411 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
Diffstat (limited to 'src/gpu/GrBatchFlushState.h')
-rw-r--r--src/gpu/GrBatchFlushState.h66
1 files changed, 33 insertions, 33 deletions
diff --git a/src/gpu/GrBatchFlushState.h b/src/gpu/GrBatchFlushState.h
index 794bc60da4..f075dfb2d2 100644
--- a/src/gpu/GrBatchFlushState.h
+++ b/src/gpu/GrBatchFlushState.h
@@ -24,7 +24,7 @@ public:
/** Inserts an upload to be executed after all batches in the flush prepared their draws
but before the draws are executed to the backend 3D API. */
- void addASAPUpload(GrDrawBatch::DeferredUploadFn&& upload) {
+ void addASAPUpload(GrDrawOp::DeferredUploadFn&& upload) {
fAsapUploads.emplace_back(std::move(upload));
}
@@ -32,26 +32,26 @@ public:
GrResourceProvider* resourceProvider() const { return fResourceProvider; }
/** Has the token been flushed to the backend 3D API. */
- bool hasDrawBeenFlushed(GrBatchDrawToken token) const {
+ bool hasDrawBeenFlushed(GrDrawOpUploadToken token) const {
return token.fSequenceNumber <= fLastFlushedToken.fSequenceNumber;
}
/** Issue a token to an operation that is being enqueued. */
- GrBatchDrawToken issueDrawToken() {
- return GrBatchDrawToken(++fLastIssuedToken.fSequenceNumber);
+ GrDrawOpUploadToken issueDrawToken() {
+ return GrDrawOpUploadToken(++fLastIssuedToken.fSequenceNumber);
}
/** Call every time a draw that was issued a token is flushed */
void flushToken() { ++fLastFlushedToken.fSequenceNumber; }
/** Gets the next draw token that will be issued. */
- GrBatchDrawToken nextDrawToken() const {
- return GrBatchDrawToken(fLastIssuedToken.fSequenceNumber + 1);
+ GrDrawOpUploadToken nextDrawToken() const {
+ return GrDrawOpUploadToken(fLastIssuedToken.fSequenceNumber + 1);
}
/** The last token flushed to all the way to the backend API. */
- GrBatchDrawToken nextTokenToFlush() const {
- return GrBatchDrawToken(fLastFlushedToken.fSequenceNumber + 1);
+ GrDrawOpUploadToken nextTokenToFlush() const {
+ return GrDrawOpUploadToken(fLastFlushedToken.fSequenceNumber + 1);
}
void* makeVertexSpace(size_t vertexSize, int vertexCount,
@@ -71,8 +71,8 @@ public:
fAsapUploads.reset();
}
- void doUpload(GrDrawBatch::DeferredUploadFn& upload) {
- GrDrawBatch::WritePixelsFn wp = [this] (GrSurface* surface,
+ void doUpload(GrDrawOp::DeferredUploadFn& upload) {
+ GrDrawOp::WritePixelsFn wp = [this] (GrSurface* surface,
int left, int top, int width, int height,
GrPixelConfig config, const void* buffer,
size_t rowBytes) -> bool {
@@ -98,20 +98,20 @@ public:
private:
- GrGpu* fGpu;
+ GrGpu* fGpu;
- GrResourceProvider* fResourceProvider;
+ GrResourceProvider* fResourceProvider;
- GrGpuCommandBuffer* fCommandBuffer;
+ GrGpuCommandBuffer* fCommandBuffer;
- GrVertexBufferAllocPool fVertexPool;
- GrIndexBufferAllocPool fIndexPool;
+ GrVertexBufferAllocPool fVertexPool;
+ GrIndexBufferAllocPool fIndexPool;
- SkSTArray<4, GrDrawBatch::DeferredUploadFn> fAsapUploads;
+ SkSTArray<4, GrDrawOp::DeferredUploadFn> fAsapUploads;
- GrBatchDrawToken fLastIssuedToken;
+ GrDrawOpUploadToken fLastIssuedToken;
- GrBatchDrawToken fLastFlushedToken;
+ GrDrawOpUploadToken fLastFlushedToken;
};
/**
@@ -130,22 +130,22 @@ private:
* upload must occur before. The upload will then occur between the draw that requires the new
* data but after the token that requires the old data.
*
- * TODO: Currently the token/upload interface is spread over GrDrawBatch, GrVertexBatch,
- * GrDrawBatch::Target, and GrVertexBatch::Target. However, the interface at the GrDrawBatch
+ * TODO: Currently the token/upload interface is spread over GrDrawOp, GrVertexBatch,
+ * GrDrawOp::Target, and GrVertexBatch::Target. However, the interface at the GrDrawOp
* level is not complete and isn't useful. We should push it down to GrVertexBatch until it
- * is required at the GrDrawBatch level.
+ * is required at the GrDrawOp level.
*/
/**
- * GrDrawBatch instances use this object to allocate space for their geometry and to issue the draws
+ * GrDrawOp instances use this object to allocate space for their geometry and to issue the draws
* that render their batch.
*/
-class GrDrawBatch::Target {
+class GrDrawOp::Target {
public:
- Target(GrBatchFlushState* state, GrDrawBatch* batch) : fState(state), fBatch(batch) {}
+ Target(GrBatchFlushState* state, GrDrawOp* batch) : fState(state), fBatch(batch) {}
/** Returns the token of the draw that this upload will occur before. */
- GrBatchDrawToken addInlineUpload(DeferredUploadFn&& upload) {
+ GrDrawOpUploadToken addInlineUpload(DeferredUploadFn&& upload) {
fBatch->fInlineUploads.emplace_back(std::move(upload), fState->nextDrawToken());
return fBatch->fInlineUploads.back().fUploadBeforeToken;
}
@@ -153,36 +153,36 @@ public:
/** Returns the token of the draw that this upload will occur before. Since ASAP uploads
are done first during a flush, this will be the first token since the most recent
flush. */
- GrBatchDrawToken addAsapUpload(DeferredUploadFn&& upload) {
+ GrDrawOpUploadToken addAsapUpload(DeferredUploadFn&& upload) {
fState->addASAPUpload(std::move(upload));
return fState->nextTokenToFlush();
}
- bool hasDrawBeenFlushed(GrBatchDrawToken token) const {
+ bool hasDrawBeenFlushed(GrDrawOpUploadToken token) const {
return fState->hasDrawBeenFlushed(token);
}
/** Gets the next draw token that will be issued by this target. This can be used by a batch
to record that the next draw it issues will use a resource (e.g. texture) while preparing
that draw. */
- GrBatchDrawToken nextDrawToken() const { return fState->nextDrawToken(); }
+ GrDrawOpUploadToken nextDrawToken() const { return fState->nextDrawToken(); }
const GrCaps& caps() const { return fState->caps(); }
GrResourceProvider* resourceProvider() const { return fState->resourceProvider(); }
protected:
- GrDrawBatch* batch() { return fBatch; }
+ GrDrawOp* batch() { return fBatch; }
GrBatchFlushState* state() { return fState; }
private:
GrBatchFlushState* fState;
- GrDrawBatch* fBatch;
+ GrDrawOp* fBatch;
};
-/** Extension of GrDrawBatch::Target for use by GrVertexBatch. Adds the ability to create vertex
+/** Extension of GrDrawOp::Target for use by GrVertexBatch. Adds the ability to create vertex
draws. */
-class GrVertexBatch::Target : public GrDrawBatch::Target {
+class GrVertexBatch::Target : public GrDrawOp::Target {
public:
Target(GrBatchFlushState* state, GrVertexBatch* batch) : INHERITED(state, batch) {}
@@ -205,7 +205,7 @@ public:
private:
GrVertexBatch* vertexBatch() { return static_cast<GrVertexBatch*>(this->batch()); }
- typedef GrDrawBatch::Target INHERITED;
+ typedef GrDrawOp::Target INHERITED;
};
#endif