aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrOpFlushState.h
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2017-10-30 09:37:55 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-10-30 15:30:09 +0000
commit943ed7910f938d7b4894b4e925566cf7b7053f29 (patch)
treeb281c6fb91ede12be586ee7d475a2c4f38e15f5d /src/gpu/GrOpFlushState.h
parentf18b1d88aa98f81d2c115a59d887265fea63f876 (diff)
Remove deferred upload types from GrDrawOp.h.
This is motivated by exposing these to an upcoming atlas text rendering API that doesn't use ops. Change-Id: Id034dd43d13bc96fe1350fc6d8f699477bb74a05 Reviewed-on: https://skia-review.googlesource.com/65060 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/GrOpFlushState.h')
-rw-r--r--src/gpu/GrOpFlushState.h32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/gpu/GrOpFlushState.h b/src/gpu/GrOpFlushState.h
index a5a5f82c31..22d0e81fad 100644
--- a/src/gpu/GrOpFlushState.h
+++ b/src/gpu/GrOpFlushState.h
@@ -27,7 +27,7 @@ public:
/** Inserts an upload to be executed after all ops in the flush prepared their draws but before
the draws are executed to the backend 3D API. */
- void addASAPUpload(GrDrawOp::DeferredUploadFn&& upload) {
+ void addASAPUpload(GrDeferredTextureUploadFn&& upload) {
fAsapUploads.emplace_back(std::move(upload));
}
@@ -35,26 +35,26 @@ public:
GrResourceProvider* resourceProvider() const { return fResourceProvider; }
/** Has the token been flushed to the backend 3D API. */
- bool hasDrawBeenFlushed(GrDrawOpUploadToken token) const {
+ bool hasDrawBeenFlushed(GrDeferredUploadToken token) const {
return token.fSequenceNumber <= fLastFlushedToken.fSequenceNumber;
}
/** Issue a token to an operation that is being enqueued. */
- GrDrawOpUploadToken issueDrawToken() {
- return GrDrawOpUploadToken(++fLastIssuedToken.fSequenceNumber);
+ GrDeferredUploadToken issueDrawToken() {
+ return GrDeferredUploadToken(++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. */
- GrDrawOpUploadToken nextDrawToken() const {
- return GrDrawOpUploadToken(fLastIssuedToken.fSequenceNumber + 1);
+ GrDeferredUploadToken nextDrawToken() const {
+ return GrDeferredUploadToken(fLastIssuedToken.fSequenceNumber + 1);
}
/** The last token flushed to all the way to the backend API. */
- GrDrawOpUploadToken nextTokenToFlush() const {
- return GrDrawOpUploadToken(fLastFlushedToken.fSequenceNumber + 1);
+ GrDeferredUploadToken nextTokenToFlush() const {
+ return GrDeferredUploadToken(fLastFlushedToken.fSequenceNumber + 1);
}
void* makeVertexSpace(size_t vertexSize, int vertexCount,
@@ -80,7 +80,7 @@ public:
fAsapUploads.reset();
}
- void doUpload(GrDrawOp::DeferredUploadFn&);
+ void doUpload(GrDeferredTextureUploadFn&);
void putBackIndices(size_t indices) { fIndexPool.putBack(indices * sizeof(uint16_t)); }
@@ -132,9 +132,9 @@ private:
GrGpuCommandBuffer* fCommandBuffer;
GrVertexBufferAllocPool fVertexPool;
GrIndexBufferAllocPool fIndexPool;
- SkSTArray<4, GrDrawOp::DeferredUploadFn> fAsapUploads;
- GrDrawOpUploadToken fLastIssuedToken;
- GrDrawOpUploadToken fLastFlushedToken;
+ SkSTArray<4, GrDeferredTextureUploadFn> fAsapUploads;
+ GrDeferredUploadToken fLastIssuedToken;
+ GrDeferredUploadToken fLastFlushedToken;
DrawOpArgs* fOpArgs;
SkArenaAlloc fPipelines{sizeof(GrPipeline) * 100};
};
@@ -170,7 +170,7 @@ public:
Target(GrOpFlushState* state, GrDrawOp* op) : fState(state), fOp(op) {}
/** Returns the token of the draw that this upload will occur before. */
- GrDrawOpUploadToken addInlineUpload(DeferredUploadFn&& upload) {
+ GrDeferredUploadToken addInlineUpload(GrDeferredTextureUploadFn&& upload) {
fOp->fInlineUploads.emplace_back(std::move(upload), fState->nextDrawToken());
return fOp->fInlineUploads.back().fUploadBeforeToken;
}
@@ -178,19 +178,19 @@ 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. */
- GrDrawOpUploadToken addAsapUpload(DeferredUploadFn&& upload) {
+ GrDeferredUploadToken addAsapUpload(GrDeferredTextureUploadFn&& upload) {
fState->addASAPUpload(std::move(upload));
return fState->nextTokenToFlush();
}
- bool hasDrawBeenFlushed(GrDrawOpUploadToken token) const {
+ bool hasDrawBeenFlushed(GrDeferredUploadToken token) const {
return fState->hasDrawBeenFlushed(token);
}
/** Gets the next draw token that will be issued by this target. This can be used by an op
to record that the next draw it issues will use a resource (e.g. texture) while preparing
that draw. */
- GrDrawOpUploadToken nextDrawToken() const { return fState->nextDrawToken(); }
+ GrDeferredUploadToken nextDrawToken() const { return fState->nextDrawToken(); }
const GrCaps& caps() const { return fState->caps(); }