Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Unified Diff: src/gpu/text/GrTextBlobCache.h

Issue 1686113002: Remove GrTextBlobCache/GrAtlasTextBlob friendliness (Closed) Base URL: https://skia.googlesource.com/skia.git@tc-cleanup-1
Patch Set: build warnings Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/text/GrAtlasTextContext.cpp ('k') | src/gpu/text/GrTextBlobCache.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/text/GrTextBlobCache.h
diff --git a/src/gpu/text/GrTextBlobCache.h b/src/gpu/text/GrTextBlobCache.h
index 8eee9d13db0360d1fdc0353bf85d1052b1ab1178..e3b2ca73fb622bb0c73bfc1e3b6049c60a8546cc 100644
--- a/src/gpu/text/GrTextBlobCache.h
+++ b/src/gpu/text/GrTextBlobCache.h
@@ -30,40 +30,26 @@ public:
~GrTextBlobCache();
// creates an uncached blob
- GrAtlasTextBlob* createBlob(int glyphCount, int runCount, size_t maxVASize);
- GrAtlasTextBlob* createBlob(const SkTextBlob* blob, size_t maxVAStride) {
+ GrAtlasTextBlob* createBlob(int glyphCount, int runCount) {
+ return GrAtlasTextBlob::Create(&fPool, glyphCount, runCount);
+ }
+ GrAtlasTextBlob* createBlob(const SkTextBlob* blob) {
int glyphCount = 0;
int runCount = 0;
BlobGlyphCount(&glyphCount, &runCount, blob);
- GrAtlasTextBlob* cacheBlob = this->createBlob(glyphCount, runCount, maxVAStride);
+ GrAtlasTextBlob* cacheBlob = GrAtlasTextBlob::Create(&fPool, glyphCount, runCount);
return cacheBlob;
}
- static void SetupCacheBlobKey(GrAtlasTextBlob* cacheBlob,
- const GrAtlasTextBlob::Key& key,
- const SkMaskFilter::BlurRec& blurRec,
- const SkPaint& paint) {
- cacheBlob->fKey = key;
- if (key.fHasBlur) {
- cacheBlob->fBlurRec = blurRec;
- }
- if (key.fStyle != SkPaint::kFill_Style) {
- cacheBlob->fStrokeInfo.fFrameWidth = paint.getStrokeWidth();
- cacheBlob->fStrokeInfo.fMiterLimit = paint.getStrokeMiter();
- cacheBlob->fStrokeInfo.fJoin = paint.getStrokeJoin();
- }
- }
-
GrAtlasTextBlob* createCachedBlob(const SkTextBlob* blob,
const GrAtlasTextBlob::Key& key,
const SkMaskFilter::BlurRec& blurRec,
- const SkPaint& paint,
- size_t maxVAStride) {
+ const SkPaint& paint) {
int glyphCount = 0;
int runCount = 0;
BlobGlyphCount(&glyphCount, &runCount, blob);
- GrAtlasTextBlob* cacheBlob = this->createBlob(glyphCount, runCount, maxVAStride);
- SetupCacheBlobKey(cacheBlob, key, blurRec, paint);
+ GrAtlasTextBlob* cacheBlob = GrAtlasTextBlob::Create(&fPool, glyphCount, runCount);
+ cacheBlob->setupKey(key, blurRec, paint);
this->add(cacheBlob);
return cacheBlob;
}
@@ -73,7 +59,7 @@ public:
}
void remove(GrAtlasTextBlob* blob) {
- fCache.remove(blob->fKey);
+ fCache.remove(blob->key());
fBlobList.remove(blob);
blob->unref();
}
@@ -119,7 +105,7 @@ private:
iter.init(fBlobList, BitmapBlobList::Iter::kTail_IterStart);
GrAtlasTextBlob* lruBlob = nullptr;
while (fPool.size() > fBudget && (lruBlob = iter.get()) && lruBlob != blob) {
- fCache.remove(lruBlob->fKey);
+ fCache.remove(lruBlob->key());
// Backup the iterator before removing and unrefing the blob
iter.prev();
« no previous file with comments | « src/gpu/text/GrAtlasTextContext.cpp ('k') | src/gpu/text/GrTextBlobCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698