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

Unified Diff: src/gpu/GrBatchAtlas.h

Issue 1888473002: Use transfer buffer for BatchAtlas texture copies Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase to ToT Created 4 years, 3 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 | « include/gpu/gl/GrGLTypes.h ('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 827106fdf9cad404a9370f64b278b0c466a90f08..b9bed0b60fbca82f46ebef26fe48bcfdc05049dc 100644
--- a/src/gpu/GrBatchAtlas.h
+++ b/src/gpu/GrBatchAtlas.h
@@ -16,6 +16,8 @@
#include "batches/GrDrawBatch.h"
class GrRectanizer;
+class GrResourceProvider;
+class GrBuffer;
struct GrBatchAtlasConfig {
int numPlotsX() const { return fWidth / fPlotWidth; }
@@ -41,7 +43,7 @@ public:
// the eviction
typedef void (*EvictionFunc)(GrBatchAtlas::AtlasID, void*);
- GrBatchAtlas(GrTexture*, int numPlotsX, int numPlotsY);
+ GrBatchAtlas(GrResourceProvider*, GrTexture*, int numPlotsX, int numPlotsY);
~GrBatchAtlas();
// Adds a width x height subimage to the atlas. Upon success it returns
@@ -172,19 +174,21 @@ private:
void setLastUploadToken(GrBatchDrawToken batchToken) { fLastUpload = batchToken; }
void setLastUseToken(GrBatchDrawToken batchToken) { fLastUse = batchToken; }
- void uploadToTexture(GrDrawBatch::WritePixelsFn&, GrTexture* texture);
+ void uploadToTexture(GrDrawBatch::WritePixelsFn&, GrDrawBatch::TransferPixelsFn&,
+ GrTexture* texture);
void resetRects();
private:
BatchPlot(int index, uint64_t genID, int offX, int offY, int width, int height,
- GrPixelConfig config);
+ GrPixelConfig config, GrResourceProvider* rp);
~BatchPlot() override;
// Create a clone of this plot. The cloned plot will take the place of the
// current plot in the atlas.
BatchPlot* clone() const {
- return new BatchPlot(fIndex, fGenID+1, fX, fY, fWidth, fHeight, fConfig);
+ return new BatchPlot(fIndex, fGenID+1, fX, fY, fWidth, fHeight, fConfig,
+ fResourceProvider);
}
static GrBatchAtlas::AtlasID CreateId(uint32_t index, uint64_t generation) {
@@ -193,13 +197,17 @@ private:
return generation << 16 | index;
}
+ // used to create transfer buffers
+ GrResourceProvider* fResourceProvider;
GrBatchDrawToken fLastUpload;
GrBatchDrawToken fLastUse;
const uint32_t fIndex;
uint64_t fGenID;
GrBatchAtlas::AtlasID fID;
- unsigned char* fData;
+ unsigned char* fDataPtr;
+ GrBuffer* fTransferBuffer;
+ GrFence fTransferFence;
const int fWidth;
const int fHeight;
const int fX;
« no previous file with comments | « include/gpu/gl/GrGLTypes.h ('k') | src/gpu/GrBatchAtlas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698