Chromium Code Reviews| Index: src/gpu/GrAtlas.h |
| diff --git a/src/gpu/GrAtlas.h b/src/gpu/GrAtlas.h |
| index 40a21545e15e6e7d1d089a3eba6db51c274eb441..18dad18fb3803599706efaa3792f11569f594cd5 100644 |
| --- a/src/gpu/GrAtlas.h |
| +++ b/src/gpu/GrAtlas.h |
| @@ -20,8 +20,6 @@ class GrAtlasMgr; |
| class GrAtlas { |
| public: |
| - GrAtlas(GrAtlasMgr*, int plotX, int plotY, GrMaskFormat); |
| - |
| int getPlotX() const { return fPlot.fX; } |
| int getPlotY() const { return fPlot.fY; } |
| GrMaskFormat getMaskFormat() const { return fMaskFormat; } |
| @@ -40,11 +38,16 @@ public: |
| // testing |
| GrAtlas* nextAtlas() const { return fNext; } |
| + |
|
robertphillips
2013/08/02 15:23:50
Does this need to be out here with the availabilit
bsalomon
2013/08/02 15:30:35
I'd feel better if this and fUsed were private, ev
jvanverth1
2013/08/02 21:49:27
Done.
|
| + GrAtlas* fNext; |
| + |
| + // for recycling |
| + bool fUsed; |
| private: |
| + GrAtlas(GrAtlasMgr*, int plotX, int plotY, GrMaskFormat format); |
| ~GrAtlas(); // does not try to delete the fNext field |
| - GrAtlas* fNext; |
| GrTexture* fTexture; |
| GrRectanizer* fRects; |
| GrAtlasMgr* fAtlasMgr; |
| @@ -61,8 +64,9 @@ public: |
| GrAtlasMgr(GrGpu*); |
| ~GrAtlasMgr(); |
| - GrAtlas* addToAtlas(GrAtlas*, int width, int height, const void*, |
| + GrAtlas* addToAtlas(GrAtlas**, int width, int height, const void*, |
| GrMaskFormat, GrIPoint16*); |
| + void deleteAtlas(GrAtlas* atlas) { delete atlas; } |
| GrTexture* getTexture(GrMaskFormat format) const { |
| GrAssert((unsigned)format < kCount_GrMaskFormats); |
| @@ -70,12 +74,12 @@ public: |
| } |
| // to be called by ~GrAtlas() |
| - void freePlot(int x, int y); |
| + void freePlot(GrMaskFormat format, int x, int y); |
| private: |
| GrGpu* fGpu; |
| GrTexture* fTexture[kCount_GrMaskFormats]; |
| - GrPlotMgr* fPlotMgr; |
| + GrPlotMgr* fPlotMgr[kCount_GrMaskFormats]; |
| }; |
| #endif |