aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrBatchAtlas.h
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2016-04-01 06:06:20 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-04-01 06:06:20 -0700
commit342bfc25de5b0452b1551bf9db4bf45eac7718b2 (patch)
tree5d54f2ecb1ec17f7848500df30c4f6d40c5b9ae8 /src/gpu/GrBatchAtlas.h
parent38d68bc31d69ea9793d925dd3c7d4337330b2b7b (diff)
Simplify GrDrawBatch uploads and token uage.
GrVertexBatch subclasses no longer need "initDraw". Simplifies GrTestBatch BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1835283002 Review URL: https://codereview.chromium.org/1835283002
Diffstat (limited to 'src/gpu/GrBatchAtlas.h')
-rw-r--r--src/gpu/GrBatchAtlas.h26
1 files changed, 9 insertions, 17 deletions
diff --git a/src/gpu/GrBatchAtlas.h b/src/gpu/GrBatchAtlas.h
index 43dd692429..707f463d97 100644
--- a/src/gpu/GrBatchAtlas.h
+++ b/src/gpu/GrBatchAtlas.h
@@ -65,7 +65,7 @@ public:
}
// To ensure the atlas does not evict a given entry, the client must set the last use token
- inline void setLastUseToken(AtlasID id, GrBatchToken batchToken) {
+ inline void setLastUseToken(AtlasID id, GrBatchDrawToken batchToken) {
SkASSERT(this->hasID(id));
uint32_t index = GetIndexFromID(id);
SkASSERT(index < fNumPlots);
@@ -124,7 +124,7 @@ public:
friend class GrBatchAtlas;
};
- void setLastUseTokenBulk(const BulkUseTokenUpdater& updater, GrBatchToken batchToken) {
+ void setLastUseTokenBulk(const BulkUseTokenUpdater& updater, GrBatchDrawToken batchToken) {
int count = updater.fPlotsToUpdate.count();
for (int i = 0; i < count; i++) {
BatchPlot* plot = fPlotArray[updater.fPlotsToUpdate[i]];
@@ -167,18 +167,12 @@ private:
// we don't need to issue a new upload even if we update the cpu backing store. We use
// lastUse to determine when we can evict a plot from the cache, ie if the last use has
// already flushed through the gpu then we can reuse the plot.
- GrBatchToken lastUploadToken() const { return fLastUpload; }
- GrBatchToken lastUseToken() const { return fLastUse; }
- void setLastUploadToken(GrBatchToken batchToken) {
- SkASSERT(batchToken >= fLastUpload);
- fLastUpload = batchToken;
- }
- void setLastUseToken(GrBatchToken batchToken) {
- SkASSERT(batchToken >= fLastUse);
- fLastUse = batchToken;
- }
+ GrBatchDrawToken lastUploadToken() const { return fLastUpload; }
+ GrBatchDrawToken lastUseToken() const { return fLastUse; }
+ void setLastUploadToken(GrBatchDrawToken batchToken) { fLastUpload = batchToken; }
+ void setLastUseToken(GrBatchDrawToken batchToken) { fLastUse = batchToken; }
- void uploadToTexture(GrBatchUploader::TextureUploader* uploader, GrTexture* texture);
+ void uploadToTexture(GrDrawBatch::WritePixelsFn&, GrTexture* texture);
void resetRects();
private:
@@ -199,8 +193,8 @@ private:
return generation << 16 | index;
}
- GrBatchToken fLastUpload;
- GrBatchToken fLastUse;
+ GrBatchDrawToken fLastUpload;
+ GrBatchDrawToken fLastUse;
const uint32_t fIndex;
uint64_t fGenID;
@@ -246,8 +240,6 @@ private:
inline void processEviction(AtlasID);
- friend class GrPlotUploader; // to access GrBatchPlot
-
GrTexture* fTexture;
SkDEBUGCODE(uint32_t fNumPlots;)