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

Unified Diff: src/gpu/text/GrAtlasTextContext.cpp

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/GrAtlasTextBlob.cpp ('k') | src/gpu/text/GrTextBlobCache.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/text/GrAtlasTextContext.cpp
diff --git a/src/gpu/text/GrAtlasTextContext.cpp b/src/gpu/text/GrAtlasTextContext.cpp
index 91fa658110eb8fdc38acd09e704caf432606f0a8..9e30476248c47fbdefc553a7fac36f97b869ab72 100644
--- a/src/gpu/text/GrAtlasTextContext.cpp
+++ b/src/gpu/text/GrAtlasTextContext.cpp
@@ -150,8 +150,7 @@ void GrAtlasTextContext::drawTextBlob(GrDrawContext* dc,
// TODO we could probably get away reuse most of the time if the pointer is unique,
// but we'd have to clear the subrun information
fCache->remove(cacheBlob);
- cacheBlob.reset(SkRef(fCache->createCachedBlob(blob, key, blurRec, skPaint,
- GrAtlasTextBlob::kGrayTextVASize)));
+ cacheBlob.reset(SkRef(fCache->createCachedBlob(blob, key, blurRec, skPaint)));
this->regenerateTextBlob(cacheBlob, skPaint, grPaint.getColor(), viewMatrix,
blob, x, y, drawFilter);
} else {
@@ -161,9 +160,8 @@ void GrAtlasTextContext::drawTextBlob(GrDrawContext* dc,
int glyphCount = 0;
int runCount = 0;
GrTextBlobCache::BlobGlyphCount(&glyphCount, &runCount, blob);
- SkAutoTUnref<GrAtlasTextBlob> sanityBlob(
- fCache->createBlob(glyphCount, runCount, GrAtlasTextBlob::kGrayTextVASize));
- GrTextBlobCache::SetupCacheBlobKey(sanityBlob, key, blurRec, skPaint);
+ SkAutoTUnref<GrAtlasTextBlob> sanityBlob(fCache->createBlob(glyphCount, runCount));
+ sanityBlob->setupKey(key, blurRec, skPaint);
this->regenerateTextBlob(sanityBlob, skPaint, grPaint.getColor(), viewMatrix,
blob, x, y, drawFilter);
GrAtlasTextBlob::AssertEqual(*sanityBlob, *cacheBlob);
@@ -171,10 +169,9 @@ void GrAtlasTextContext::drawTextBlob(GrDrawContext* dc,
}
} else {
if (canCache) {
- cacheBlob.reset(SkRef(fCache->createCachedBlob(blob, key, blurRec, skPaint,
- GrAtlasTextBlob::kGrayTextVASize)));
+ cacheBlob.reset(SkRef(fCache->createCachedBlob(blob, key, blurRec, skPaint)));
} else {
- cacheBlob.reset(fCache->createBlob(blob, GrAtlasTextBlob::kGrayTextVASize));
+ cacheBlob.reset(fCache->createBlob(blob));
}
this->regenerateTextBlob(cacheBlob, skPaint, grPaint.getColor(), viewMatrix,
blob, x, y, drawFilter);
@@ -278,7 +275,7 @@ GrAtlasTextContext::createDrawTextBlob(const GrPaint& paint, const SkPaint& skPa
SkScalar x, SkScalar y) {
int glyphCount = skPaint.countText(text, byteLength);
- GrAtlasTextBlob* blob = fCache->createBlob(glyphCount, 1, GrAtlasTextBlob::kGrayTextVASize);
+ GrAtlasTextBlob* blob = fCache->createBlob(glyphCount, 1);
blob->initThrowawayBlob(viewMatrix, x, y);
if (GrTextUtils::CanDrawAsDistanceFields(skPaint, viewMatrix, fSurfaceProps,
@@ -301,7 +298,7 @@ GrAtlasTextContext::createDrawPosTextBlob(const GrPaint& paint, const SkPaint& s
const SkPoint& offset) {
int glyphCount = skPaint.countText(text, byteLength);
- GrAtlasTextBlob* blob = fCache->createBlob(glyphCount, 1, GrAtlasTextBlob::kGrayTextVASize);
+ GrAtlasTextBlob* blob = fCache->createBlob(glyphCount, 1);
blob->initThrowawayBlob(viewMatrix, offset.x(), offset.y());
if (GrTextUtils::CanDrawAsDistanceFields(skPaint, viewMatrix, fSurfaceProps,
« no previous file with comments | « src/gpu/text/GrAtlasTextBlob.cpp ('k') | src/gpu/text/GrTextBlobCache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698