Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(210)

Unified Diff: src/gpu/GrBatchAtlas.h

Issue 1835283002: Simplify GrDrawBatch uploads and token uage. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gm/convexpolyeffect.cpp ('k') | src/gpu/GrBatchAtlas.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrBatchAtlas.h
diff --git a/src/gpu/GrBatchAtlas.h b/src/gpu/GrBatchAtlas.h
index 43dd692429a926f8e43e65501f1e969ca9c526e2..707f463d970684228eb5d768fb30db76edeaa9e5 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;)
« no previous file with comments | « gm/convexpolyeffect.cpp ('k') | src/gpu/GrBatchAtlas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698