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

Unified Diff: src/gpu/GrAtlas.h

Issue 1142273002: Revert of small cleanup of GrAtlas (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 7 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 | « no previous file | src/gpu/GrAtlas.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrAtlas.h
diff --git a/src/gpu/GrAtlas.h b/src/gpu/GrAtlas.h
index 23cb326fee1acd7139437d00cfe6c78b7ec4c44c..1b0854b85ef7af2c16778fa71e8fb5bbc1a5c515 100644
--- a/src/gpu/GrAtlas.h
+++ b/src/gpu/GrAtlas.h
@@ -41,6 +41,11 @@
bool addSubImage(int width, int height, const void*, SkIPoint16*);
+ GrDrawTarget::DrawToken drawToken() const { return fDrawToken; }
+ void setDrawToken(GrDrawTarget::DrawToken draw) { fDrawToken = draw; }
+
+ void uploadToTexture();
+
void resetRects();
private:
@@ -48,6 +53,9 @@
~GrPlot(); // does not try to delete the fNext field
void init(GrAtlas* atlas, int id, int offX, int offY, int width, int height, size_t bpp,
bool batchUploads);
+
+ // for recycling
+ GrDrawTarget::DrawToken fDrawToken;
int fID;
unsigned char* fPlotData;
@@ -100,9 +108,15 @@
// remove reference to this plot
static void RemovePlot(ClientPlotUsage* usage, const GrPlot* plot);
+ // get a plot that's not being used by the current draw
+ // this allows us to overwrite this plot without flushing
+ GrPlot* getUnusedPlot();
+
GrTexture* getTexture() const {
return fTexture;
}
+
+ void uploadPlotsToTexture();
enum IterOrder {
kLRUFirst_IterOrder,
@@ -111,7 +125,7 @@
typedef GrPlotList::Iter PlotIter;
GrPlot* iterInit(PlotIter* iter, IterOrder order) {
- return iter->init(fPlotList, kLRUFirst_IterOrder == order
+ return iter->init(fPlotList, kLRUFirst_IterOrder == order
? GrPlotList::Iter::kTail_IterStart
: GrPlotList::Iter::kHead_IterStart);
}
« no previous file with comments | « no previous file | src/gpu/GrAtlas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698