diff options
author | 2014-04-01 16:25:11 +0000 | |
---|---|---|
committer | 2014-04-01 16:25:11 +0000 | |
commit | 53e1e4d88a06db62898a3bf75751c042729d7160 (patch) | |
tree | 0d1eeab45c0a6d8276781e9cd24246df5d0d9f9d /src/gpu/GrAtlas.h | |
parent | e3ff558a4baf4cb924e7513a81c8073ddae385fc (diff) |
Minor changes to GrFontCache system.
The main change is parameterizing the GrAtlasMgr so it can have a different sized backing texture and a different number of plots. This is in support of the saveLayer cache which has a smaller backing texture and only one plot.
R=jvanverth@google.com, bsalomon@google.com
Author: robertphillips@google.com
Review URL: https://codereview.chromium.org/217423014
git-svn-id: http://skia.googlecode.com/svn/trunk@14011 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu/GrAtlas.h')
-rw-r--r-- | src/gpu/GrAtlas.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/gpu/GrAtlas.h b/src/gpu/GrAtlas.h index c7536e3800..d7f5334141 100644 --- a/src/gpu/GrAtlas.h +++ b/src/gpu/GrAtlas.h @@ -33,9 +33,6 @@ class GrPlot { public: SK_DECLARE_INTERNAL_LLIST_INTERFACE(GrPlot); - int getOffsetX() const { return fOffset.fX; } - int getOffsetY() const { return fOffset.fY; } - GrTexture* texture() const { return fTexture; } bool addSubImage(int width, int height, const void*, GrIPoint16*); @@ -48,6 +45,7 @@ public: private: GrPlot(); ~GrPlot(); // does not try to delete the fNext field + void init(GrAtlasMgr* mgr, int offX, int offY, int width, int height, size_t bpp); // for recycling GrDrawTarget::DrawToken fDrawToken; @@ -55,7 +53,7 @@ private: GrTexture* fTexture; GrRectanizer* fRects; GrAtlasMgr* fAtlasMgr; - GrIPoint16 fOffset; + GrIPoint16 fOffset; // the offset of the plot in the backing texture size_t fBytesPerPixel; friend class GrAtlasMgr; @@ -65,7 +63,8 @@ typedef SkTInternalLList<GrPlot> GrPlotList; class GrAtlasMgr { public: - GrAtlasMgr(GrGpu*, GrPixelConfig); + GrAtlasMgr(GrGpu*, GrPixelConfig, const SkISize& backingTextureSize, + int numPlotsX, int numPlotsY); ~GrAtlasMgr(); // add subimage of width, height dimensions to atlas @@ -89,6 +88,9 @@ private: GrGpu* fGpu; GrPixelConfig fPixelConfig; GrTexture* fTexture; + SkISize fBackingTextureSize; + int fNumPlotsX; + int fNumPlotsY; // allocated array of GrPlots GrPlot* fPlotArray; |