Some simple optimizations for improving GrAtlasTextContext perf
BUG=skia:
Review URL: https://codereview.chromium.org/1093083003
diff --git a/src/gpu/GrBatchAtlas.h b/src/gpu/GrBatchAtlas.h
index 77a49ce..2b85da1 100644
--- a/src/gpu/GrBatchAtlas.h
+++ b/src/gpu/GrBatchAtlas.h
@@ -112,6 +112,11 @@
void setLastUseTokenBulk(const BulkUseTokenUpdater& reffer, BatchToken);
+ static const int kGlyphMaxDim = 256;
+ static bool GlyphTooLargeForAtlas(int width, int height) {
+ return width > kGlyphMaxDim || height > kGlyphMaxDim;
+ }
+
private:
static int GetIndexFromID(AtlasID id) {
return id & 0xffff;