aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/text/GrTextBlobCache.h
diff options
context:
space:
mode:
authorGravatar Herb Derby <herb@google.com>2018-05-24 16:12:31 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-05-29 17:52:16 +0000
commit862405921bdbf599bac3bd829e9d6a81a4ee4d37 (patch)
tree01571847d8167751642601c4e147e8cf2ec1e4a5 /src/gpu/text/GrTextBlobCache.h
parentbfb2a05af105f452a0f369e39dae05f9224dfa19 (diff)
Rename GrAtlasTextBlob -> GrTextBlob
Change-Id: I61311b48f206890dfd1a20796d7d678cd05ef5a3 Reviewed-on: https://skia-review.googlesource.com/130140 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Herb Derby <herb@google.com>
Diffstat (limited to 'src/gpu/text/GrTextBlobCache.h')
-rw-r--r--src/gpu/text/GrTextBlobCache.h52
1 files changed, 26 insertions, 26 deletions
diff --git a/src/gpu/text/GrTextBlobCache.h b/src/gpu/text/GrTextBlobCache.h
index c6b5c70614..b41d401aee 100644
--- a/src/gpu/text/GrTextBlobCache.h
+++ b/src/gpu/text/GrTextBlobCache.h
@@ -34,35 +34,35 @@ public:
~GrTextBlobCache();
// creates an uncached blob
- sk_sp<GrAtlasTextBlob> makeBlob(int glyphCount, int runCount) {
- return GrAtlasTextBlob::Make(glyphCount, runCount);
+ sk_sp<GrTextBlob> makeBlob(int glyphCount, int runCount) {
+ return GrTextBlob::Make(glyphCount, runCount);
}
- sk_sp<GrAtlasTextBlob> makeBlob(const SkTextBlob* blob) {
+ sk_sp<GrTextBlob> makeBlob(const SkTextBlob* blob) {
int glyphCount = 0;
int runCount = 0;
BlobGlyphCount(&glyphCount, &runCount, blob);
- return GrAtlasTextBlob::Make(glyphCount, runCount);
+ return GrTextBlob::Make(glyphCount, runCount);
}
- sk_sp<GrAtlasTextBlob> makeCachedBlob(const SkTextBlob* blob,
- const GrAtlasTextBlob::Key& key,
+ sk_sp<GrTextBlob> makeCachedBlob(const SkTextBlob* blob,
+ const GrTextBlob::Key& key,
const SkMaskFilterBase::BlurRec& blurRec,
const SkPaint& paint) {
- sk_sp<GrAtlasTextBlob> cacheBlob(this->makeBlob(blob));
+ sk_sp<GrTextBlob> cacheBlob(this->makeBlob(blob));
cacheBlob->setupKey(key, blurRec, paint);
this->add(cacheBlob);
blob->notifyAddedToCache(fUniqueID);
return cacheBlob;
}
- sk_sp<GrAtlasTextBlob> find(const GrAtlasTextBlob::Key& key) const {
+ sk_sp<GrTextBlob> find(const GrTextBlob::Key& key) const {
const auto* idEntry = fBlobIDCache.find(key.fUniqueID);
return idEntry ? idEntry->find(key) : nullptr;
}
- void remove(GrAtlasTextBlob* blob) {
- auto id = GrAtlasTextBlob::GetKey(*blob).fUniqueID;
+ void remove(GrTextBlob* blob) {
+ auto id = GrTextBlob::GetKey(*blob).fUniqueID;
auto* idEntry = fBlobIDCache.find(id);
SkASSERT(idEntry);
@@ -74,7 +74,7 @@ public:
}
}
- void makeMRU(GrAtlasTextBlob* blob) {
+ void makeMRU(GrTextBlob* blob) {
if (fBlobList.head() == blob) {
return;
}
@@ -107,7 +107,7 @@ public:
void purgeStaleBlobs();
private:
- using BitmapBlobList = SkTInternalLList<GrAtlasTextBlob>;
+ using BitmapBlobList = SkTInternalLList<GrTextBlob>;
struct BlobIDCacheEntry {
BlobIDCacheEntry() : fID(SK_InvalidGenID) {}
@@ -117,32 +117,32 @@ private:
return entry.fID;
}
- void addBlob(sk_sp<GrAtlasTextBlob> blob) {
+ void addBlob(sk_sp<GrTextBlob> blob) {
SkASSERT(blob);
- SkASSERT(GrAtlasTextBlob::GetKey(*blob).fUniqueID == fID);
- SkASSERT(!this->find(GrAtlasTextBlob::GetKey(*blob)));
+ SkASSERT(GrTextBlob::GetKey(*blob).fUniqueID == fID);
+ SkASSERT(!this->find(GrTextBlob::GetKey(*blob)));
fBlobs.emplace_back(std::move(blob));
}
- void removeBlob(GrAtlasTextBlob* blob) {
+ void removeBlob(GrTextBlob* blob) {
SkASSERT(blob);
- SkASSERT(GrAtlasTextBlob::GetKey(*blob).fUniqueID == fID);
+ SkASSERT(GrTextBlob::GetKey(*blob).fUniqueID == fID);
- auto index = this->findBlobIndex(GrAtlasTextBlob::GetKey(*blob));
+ auto index = this->findBlobIndex(GrTextBlob::GetKey(*blob));
SkASSERT(index >= 0);
fBlobs.removeShuffle(index);
}
- sk_sp<GrAtlasTextBlob> find(const GrAtlasTextBlob::Key& key) const {
+ sk_sp<GrTextBlob> find(const GrTextBlob::Key& key) const {
auto index = this->findBlobIndex(key);
return index < 0 ? nullptr : fBlobs[index];
}
- int findBlobIndex(const GrAtlasTextBlob::Key& key) const{
+ int findBlobIndex(const GrTextBlob::Key& key) const{
for (int i = 0; i < fBlobs.count(); ++i) {
- if (GrAtlasTextBlob::GetKey(*fBlobs[i]) == key) {
+ if (GrTextBlob::GetKey(*fBlobs[i]) == key) {
return i;
}
}
@@ -152,18 +152,18 @@ private:
uint32_t fID;
// Current clients don't generate multiple GrAtlasTextBlobs per SkTextBlob, so an array w/
// linear search is acceptable. If usage changes, we should re-evaluate this structure.
- SkSTArray<1, sk_sp<GrAtlasTextBlob>, true> fBlobs;
+ SkSTArray<1, sk_sp<GrTextBlob>, true> fBlobs;
};
- void add(sk_sp<GrAtlasTextBlob> blob) {
- auto id = GrAtlasTextBlob::GetKey(*blob).fUniqueID;
+ void add(sk_sp<GrTextBlob> blob) {
+ auto id = GrTextBlob::GetKey(*blob).fUniqueID;
auto* idEntry = fBlobIDCache.find(id);
if (!idEntry) {
idEntry = fBlobIDCache.set(id, BlobIDCacheEntry(id));
}
// Safe to retain a raw ptr temporarily here, because the cache will hold a ref.
- GrAtlasTextBlob* rawBlobPtr = blob.get();
+ GrTextBlob* rawBlobPtr = blob.get();
fBlobList.addToHead(rawBlobPtr);
fCurrentSize += blob->size();
idEntry->addBlob(std::move(blob));
@@ -171,7 +171,7 @@ private:
this->checkPurge(rawBlobPtr);
}
- void checkPurge(GrAtlasTextBlob* blob = nullptr);
+ void checkPurge(GrTextBlob* blob = nullptr);
static const int kMinGrowthSize = 1 << 16;
static const int kDefaultBudget = 1 << 22;