From 53e1e4d88a06db62898a3bf75751c042729d7160 Mon Sep 17 00:00:00 2001 From: "commit-bot@chromium.org" Date: Tue, 1 Apr 2014 16:25:11 +0000 Subject: 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 --- src/gpu/GrAtlas.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/gpu/GrAtlas.h') 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 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; -- cgit v1.2.3