aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/text/GrGlyphCache.cpp
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2018-03-07 11:59:37 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-03-07 19:53:30 +0000
commitaf4adefd8ccb46c148f7a16b54afc226b86c0fcc (patch)
treeda5ce6ae00e7fed1fa2544be658cffe89f5f5d9e /src/gpu/text/GrGlyphCache.cpp
parentba8726b8a33603b1352019123edb82ed199b26d2 (diff)
Have GrGlyphCache and GrAtlasManager compute the atlas limits independently
DDL contexts will have a GrGlyphCache but not a GrAtlasManager. This CL disentangles the computation of the atlas limits so the GrGlyphCache can function independently. Change-Id: Ia698c7d1ec625d1a0d1f0b5521b56731cfeafde9 Reviewed-on: https://skia-review.googlesource.com/112708 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Jim Van Verth <jvanverth@google.com>
Diffstat (limited to 'src/gpu/text/GrGlyphCache.cpp')
-rw-r--r--src/gpu/text/GrGlyphCache.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gpu/text/GrGlyphCache.cpp b/src/gpu/text/GrGlyphCache.cpp
index 49e24b8b8c..79f7748def 100644
--- a/src/gpu/text/GrGlyphCache.cpp
+++ b/src/gpu/text/GrGlyphCache.cpp
@@ -12,9 +12,14 @@
#include "SkAutoMalloc.h"
#include "SkDistanceFieldGen.h"
-GrGlyphCache::GrGlyphCache()
+GrGlyphCache::GrGlyphCache(const GrCaps* caps, float maxTextureBytes)
: fPreserveStrike(nullptr)
, fGlyphSizeLimit(0) {
+
+ int maxDim, minDim, maxPlot, minPlot;
+ GrRestrictedAtlasManager::ComputeAtlasLimits(caps, maxTextureBytes,
+ &maxDim, &minDim, &maxPlot, &minPlot);
+ fGlyphSizeLimit = minPlot;
}
GrGlyphCache::~GrGlyphCache() {