aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrDrawOpAtlas.h
diff options
context:
space:
mode:
authorGravatar Jim Van Verth <jvanverth@google.com>2017-09-15 12:14:26 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-09-15 16:34:34 +0000
commit03168b8a62a0d3d14b7a0d14642df4d82203b87c (patch)
tree011df89efc1f6416ec08f6b1d6de173ff3000b1b /src/gpu/GrDrawOpAtlas.h
parenta4083c97d48e8a4f88e2797d7363f141e3d42553 (diff)
Allow GrDrawOpAtlas to grow as needed
Bug: skia:3550 Change-Id: Ib5312c8c06ba8549d90545658df6686c45058255 Reviewed-on: https://skia-review.googlesource.com/45841 Commit-Queue: Jim Van Verth <jvanverth@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrDrawOpAtlas.h')
-rw-r--r--src/gpu/GrDrawOpAtlas.h15
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