Remove SkAutoGlyphCache decls that happen to work
...and fix sample code.
Change-Id: I673770125064f8451e3d88ec4929a68409935ad1
Reviewed-on: https://skia-review.googlesource.com/115995
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
diff --git a/include/core/SkPaint.h b/include/core/SkPaint.h
index 5cd05a2..6dc7ed4 100644
--- a/include/core/SkPaint.h
+++ b/include/core/SkPaint.h
@@ -15,7 +15,6 @@
#include "SkRefCnt.h"
class SkAutoDescriptor;
-class SkAutoGlyphCache;
class SkColorFilter;
class SkData;
class SkDescriptor;
@@ -1700,7 +1699,6 @@
friend class GrGLPathRendering;
friend class GrPathRendering;
friend class GrTextUtils;
- friend class SkAutoGlyphCache;
friend class SkAutoGlyphCacheNoGamma;
friend class SkCanonicalizePaint;
friend class SkCanvas;
diff --git a/samplecode/SamplePathText.cpp b/samplecode/SamplePathText.cpp
index c6c07ee..30c8e63 100644
--- a/samplecode/SamplePathText.cpp
+++ b/samplecode/SamplePathText.cpp
@@ -24,8 +24,7 @@
PathText() {
SkPaint defaultPaint;
- SkAutoGlyphCache agc(defaultPaint, nullptr, &SkMatrix::I());
- SkGlyphCache* cache = agc.get();
+ auto cache = SkGlyphCache::FindOrCreateStrikeExclusive(defaultPaint);
SkPath glyphPaths[52];
for (int i = 0; i < 52; ++i) {
// I and l are rects on OS X ...
diff --git a/src/atlastext/SkAtlasTextTarget.cpp b/src/atlastext/SkAtlasTextTarget.cpp
index 937498b..c1a21b0 100644
--- a/src/atlastext/SkAtlasTextTarget.cpp
+++ b/src/atlastext/SkAtlasTextTarget.cpp
@@ -181,7 +181,7 @@
void GrAtlasTextOp::executeForTextTarget(SkAtlasTextTarget* target) {
FlushInfo flushInfo;
- SkAutoGlyphCache autoGlyphCache;
+ SkExclusiveStrikePtr autoGlyphCache;
auto& context = target->context()->internal();
auto glyphCache = context.grContext()->contextPriv().getGlyphCache();
auto atlasManager = context.grContext()->contextPriv().getAtlasManager();
diff --git a/src/gpu/ops/GrAtlasTextOp.cpp b/src/gpu/ops/GrAtlasTextOp.cpp
index 10df795..6a53423 100644
--- a/src/gpu/ops/GrAtlasTextOp.cpp
+++ b/src/gpu/ops/GrAtlasTextOp.cpp
@@ -269,7 +269,7 @@
char* currVertex = reinterpret_cast<char*>(vertices);
- SkAutoGlyphCache autoGlyphCache;
+ SkExclusiveStrikePtr autoGlyphCache;
// each of these is a SubRun
for (int i = 0; i < fGeoCount; i++) {
const Geometry& args = fGeoData[i];
diff --git a/src/gpu/text/GrAtlasTextBlob.h b/src/gpu/text/GrAtlasTextBlob.h
index 0cc3062..7c2bd46 100644
--- a/src/gpu/text/GrAtlasTextBlob.h
+++ b/src/gpu/text/GrAtlasTextBlob.h
@@ -572,7 +572,7 @@
VertexRegenerator(GrResourceProvider*, GrAtlasTextBlob*, int runIdx, int subRunIdx,
const SkMatrix& viewMatrix, SkScalar x, SkScalar y, GrColor color,
GrDeferredUploadTarget*, GrGlyphCache*, GrAtlasManager*,
- SkAutoGlyphCache*);
+ SkExclusiveStrikePtr*);
struct Result {
/**
diff --git a/src/gpu/text/GrAtlasTextBlobVertexRegenerator.cpp b/src/gpu/text/GrAtlasTextBlobVertexRegenerator.cpp
index b74d087..92d6eb0 100644
--- a/src/gpu/text/GrAtlasTextBlobVertexRegenerator.cpp
+++ b/src/gpu/text/GrAtlasTextBlobVertexRegenerator.cpp
@@ -195,7 +195,7 @@
int runIdx, int subRunIdx,
const SkMatrix& viewMatrix, SkScalar x, SkScalar y, GrColor color,
GrDeferredUploadTarget* uploadTarget, GrGlyphCache* glyphCache,
- GrAtlasManager* fullAtlasManager, SkAutoGlyphCache* lazyCache)
+ GrAtlasManager* fullAtlasManager, SkExclusiveStrikePtr* lazyCache)
: fResourceProvider(resourceProvider)
, fViewMatrix(viewMatrix)
, fBlob(blob)