diff options
author | Jim Van Verth <jvanverth@google.com> | 2017-09-18 10:05:00 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-09-18 16:26:19 +0000 |
commit | eafa64b4018a334daae74492fb33bc54bd0bb6aa (patch) | |
tree | 9b74611bfc30799b3d81c0dbad66668173529294 /src/gpu/GrDrawOpAtlas.h | |
parent | 7aeefdb0a2a71e03f796854a7a623827a3a69e8f (diff) |
Revert "Revert "Allow GrDrawOpAtlas to grow as needed""
Bug: skia:3550
Change-Id: I11a3b39ed7470542447f0e46141a26eef7a9bdaf
Reviewed-on: https://skia-review.googlesource.com/47240
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Diffstat (limited to 'src/gpu/GrDrawOpAtlas.h')
-rw-r--r-- | src/gpu/GrDrawOpAtlas.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/gpu/GrDrawOpAtlas.h b/src/gpu/GrDrawOpAtlas.h index 6d12973f4a..87d9c5b619 100644 --- a/src/gpu/GrDrawOpAtlas.h +++ b/src/gpu/GrDrawOpAtlas.h @@ -120,6 +120,7 @@ public: } static constexpr auto kMaxPages = 4; + uint32_t pageCount() { return fNumPages; } /** * A class which can be handed back to GrDrawOpAtlas for updating last use tokens in bulk. The @@ -190,6 +191,10 @@ public: return width > kGlyphMaxDim || height > kGlyphMaxDim; } + static uint32_t GetPageIndexFromID(AtlasID id) { + return id & 0xff; + } + private: GrDrawOpAtlas(GrContext*, GrPixelConfig config, int width, int height, int numPlotsX, int numPlotsY); @@ -252,7 +257,7 @@ private: static GrDrawOpAtlas::AtlasID CreateId(uint32_t pageIdx, uint32_t plotIdx, uint64_t generation) { SkASSERT(pageIdx < (1 << 8)); - SkASSERT(pageIdx == 0); // for now, we only support one page + SkASSERT(pageIdx < kMaxPages); SkASSERT(plotIdx < (1 << 8)); SkASSERT(generation < ((uint64_t)1 << 48)); return generation << 16 | plotIdx << 8 | pageIdx; @@ -286,10 +291,6 @@ private: typedef SkTInternalLList<Plot> PlotList; - static uint32_t GetPageIndexFromID(AtlasID id) { - return id & 0xff; - } - static uint32_t GetPlotIndexFromID(AtlasID id) { return (id >> 8) & 0xff; } @@ -312,6 +313,8 @@ private: // TODO: make page MRU } + bool createNewPage(); + inline void processEviction(AtlasID); GrContext* fContext; @@ -340,7 +343,7 @@ private: // proxies kept separate to make it easier to pass them up to client sk_sp<GrTextureProxy> fProxies[kMaxPages]; Page fPages[kMaxPages]; - SkDEBUGCODE(uint32_t fNumPages;) + uint32_t fNumPages; }; #endif |