aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu
diff options
context:
space:
mode:
authorGravatar joshualitt <joshualitt@chromium.org>2016-01-20 06:48:47 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-01-20 06:48:47 -0800
commit323c2ebe9e171d399c922f1efb5b6a2ca9d56b2e (patch)
tree64a144a8a6ce494856c375e0b0839ae7963da69a /src/gpu
parent0d2199b3db21e1f22cf328ca090aa0c8abc9067f (diff)
A few more small changes to make GrAtlasTextBlob nearly self contained
Note: There is still a bit of friendliness, but its going to require some creativity to deal with. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1606943002 Review URL: https://codereview.chromium.org/1606943002
Diffstat (limited to 'src/gpu')
-rw-r--r--src/gpu/batches/GrAtlasTextBatch.cpp4
-rw-r--r--src/gpu/text/GrAtlasTextBlob.cpp23
-rw-r--r--src/gpu/text/GrAtlasTextBlob.h395
-rw-r--r--src/gpu/text/GrAtlasTextContext.cpp21
-rw-r--r--src/gpu/text/GrAtlasTextContext.h3
-rw-r--r--src/gpu/text/GrTextUtils.cpp3
6 files changed, 238 insertions, 211 deletions
diff --git a/src/gpu/batches/GrAtlasTextBatch.cpp b/src/gpu/batches/GrAtlasTextBatch.cpp
index 11b35c196b..ce6b2eae2b 100644
--- a/src/gpu/batches/GrAtlasTextBatch.cpp
+++ b/src/gpu/batches/GrAtlasTextBatch.cpp
@@ -121,10 +121,6 @@ inline void regen_vertices(intptr_t vertex, const GrGlyph* glyph, size_t vertexS
}
}
-typedef GrAtlasTextBlob Blob;
-typedef Blob::Run Run;
-typedef Run::SubRunInfo TextInfo;
-
template <bool regenPos, bool regenCol, bool regenTexCoords, bool regenGlyphs>
inline void GrAtlasTextBatch::regenBlob(Target* target, FlushInfo* flushInfo, Blob* blob, Run* run,
TextInfo* info, SkGlyphCache** cache,
diff --git a/src/gpu/text/GrAtlasTextBlob.cpp b/src/gpu/text/GrAtlasTextBlob.cpp
index f79f82598f..05fb5ad415 100644
--- a/src/gpu/text/GrAtlasTextBlob.cpp
+++ b/src/gpu/text/GrAtlasTextBlob.cpp
@@ -232,12 +232,13 @@ bool GrAtlasTextBlob::mustRegenerate(SkScalar* outTransX, SkScalar* outTransY,
return false;
}
-GrDrawBatch* GrAtlasTextBlob::createBatch(const Run::SubRunInfo& info,
- int glyphCount, int run, int subRun,
- GrColor color, SkScalar transX, SkScalar transY,
- const SkPaint& skPaint, const SkSurfaceProps& props,
- const GrDistanceFieldAdjustTable* distanceAdjustTable,
- GrBatchFontCache* cache) {
+inline GrDrawBatch* GrAtlasTextBlob::createBatch(
+ const Run::SubRunInfo& info,
+ int glyphCount, int run, int subRun,
+ GrColor color, SkScalar transX, SkScalar transY,
+ const SkPaint& skPaint, const SkSurfaceProps& props,
+ const GrDistanceFieldAdjustTable* distanceAdjustTable,
+ GrBatchFontCache* cache) {
GrMaskFormat format = info.maskFormat();
GrColor subRunColor;
if (kARGB_GrMaskFormat == format) {
@@ -412,6 +413,16 @@ void GrAtlasTextBlob::flushThrowaway(GrContext* context,
this->flushBigGlyphs(context, dc, clip, skPaint, 0, 0, clipBounds);
}
+GrDrawBatch* GrAtlasTextBlob::test_createBatch(
+ int glyphCount, int run, int subRun,
+ GrColor color, SkScalar transX, SkScalar transY,
+ const SkPaint& skPaint, const SkSurfaceProps& props,
+ const GrDistanceFieldAdjustTable* distanceAdjustTable,
+ GrBatchFontCache* cache) {
+ const GrAtlasTextBlob::Run::SubRunInfo& info = fRuns[0].fSubRunInfo[0];
+ return this->createBatch(info, glyphCount, 0, 0, color, transX, transY, skPaint,
+ props, distanceAdjustTable, cache);
+}
// TODO get this code building again
#ifdef CACHE_SANITY_CHECK
diff --git a/src/gpu/text/GrAtlasTextBlob.h b/src/gpu/text/GrAtlasTextBlob.h
index ff371c1674..1c5ea5e60e 100644
--- a/src/gpu/text/GrAtlasTextBlob.h
+++ b/src/gpu/text/GrAtlasTextBlob.h
@@ -45,6 +45,210 @@ class GrAtlasTextBlob : public SkNVRefCnt<GrAtlasTextBlob> {
public:
SK_DECLARE_INTERNAL_LLIST_INTERFACE(GrAtlasTextBlob);
+ GrAtlasTextBlob()
+ : fMaxMinScale(-SK_ScalarMax)
+ , fMinMaxScale(SK_ScalarMax)
+ , fTextType(0) {}
+
+ ~GrAtlasTextBlob() {
+ for (int i = 0; i < fRunCount; i++) {
+ fRuns[i].~Run();
+ }
+ }
+
+ struct Key {
+ Key() {
+ sk_bzero(this, sizeof(Key));
+ }
+ uint32_t fUniqueID;
+ // Color may affect the gamma of the mask we generate, but in a fairly limited way.
+ // Each color is assigned to on of a fixed number of buckets based on its
+ // luminance. For each luminance bucket there is a "canonical color" that
+ // represents the bucket. This functionality is currently only supported for A8
+ SkColor fCanonicalColor;
+ SkPaint::Style fStyle;
+ SkPixelGeometry fPixelGeometry;
+ bool fHasBlur;
+
+ bool operator==(const Key& other) const {
+ return 0 == memcmp(this, &other, sizeof(Key));
+ }
+ };
+
+ static const Key& GetKey(const GrAtlasTextBlob& blob) {
+ return blob.fKey;
+ }
+
+ static uint32_t Hash(const Key& key) {
+ return SkChecksum::Murmur3(&key, sizeof(Key));
+ }
+
+ void operator delete(void* p) {
+ GrAtlasTextBlob* blob = reinterpret_cast<GrAtlasTextBlob*>(p);
+ blob->fPool->release(p);
+ }
+ void* operator new(size_t) {
+ SkFAIL("All blobs are created by placement new.");
+ return sk_malloc_throw(0);
+ }
+
+ void* operator new(size_t, void* p) { return p; }
+ void operator delete(void* target, void* placement) {
+ ::operator delete(target, placement);
+ }
+
+ bool hasDistanceField() const { return SkToBool(fTextType & kHasDistanceField_TextType); }
+ bool hasBitmap() const { return SkToBool(fTextType & kHasBitmap_TextType); }
+ void setHasDistanceField() { fTextType |= kHasDistanceField_TextType; }
+ void setHasBitmap() { fTextType |= kHasBitmap_TextType; }
+
+ void push_back_run(int currRun) {
+ SkASSERT(currRun < fRunCount);
+ if (currRun > 0) {
+ Run::SubRunInfo& newRun = fRuns[currRun].fSubRunInfo.back();
+ Run::SubRunInfo& lastRun = fRuns[currRun - 1].fSubRunInfo.back();
+ newRun.setAsSuccessor(lastRun);
+ }
+ }
+
+ // sets the last subrun of runIndex to use distance field text
+ void setSubRunHasDistanceFields(int runIndex, bool hasLCD) {
+ Run& run = fRuns[runIndex];
+ Run::SubRunInfo& subRun = run.fSubRunInfo.back();
+ subRun.setUseLCDText(hasLCD);
+ subRun.setDrawAsDistanceFields();
+ }
+
+ void setRunDrawAsPaths(int runIndex) {
+ fRuns[runIndex].fDrawAsPaths = true;
+ }
+
+ void setMinAndMaxScale(SkScalar scaledMax, SkScalar scaledMin) {
+ // we init fMaxMinScale and fMinMaxScale in the constructor
+ fMaxMinScale = SkMaxScalar(scaledMax, fMaxMinScale);
+ fMinMaxScale = SkMinScalar(scaledMin, fMinMaxScale);
+ }
+
+ // inits the override descriptor on the current run. All following subruns must use this
+ // descriptor
+ void initOverride(int runIndex) {
+ Run& run = fRuns[runIndex];
+ // Push back a new subrun to fill and set the override descriptor
+ run.push_back();
+ run.fOverrideDescriptor.reset(new SkAutoDescriptor);
+ }
+
+ SkGlyphCache* setupCache(int runIndex,
+ const SkSurfaceProps& props,
+ const SkPaint& skPaint,
+ const SkMatrix* viewMatrix,
+ bool noGamma);
+
+ // Appends a glyph to the blob. If the glyph is too large, the glyph will be appended
+ // as a path.
+ void appendGlyph(int runIndex,
+ const SkRect& positions,
+ GrColor color,
+ GrBatchTextStrike* strike,
+ GrGlyph* glyph,
+ GrFontScaler* scaler, const SkGlyph& skGlyph,
+ SkScalar x, SkScalar y, SkScalar scale, bool applyVM);
+
+ static size_t GetVertexStride(GrMaskFormat maskFormat) {
+ switch (maskFormat) {
+ case kA8_GrMaskFormat:
+ return kGrayTextVASize;
+ case kARGB_GrMaskFormat:
+ return kColorTextVASize;
+ default:
+ return kLCDTextVASize;
+ }
+ }
+
+ bool mustRegenerate(SkScalar* outTransX, SkScalar* outTransY, const SkPaint& paint,
+ GrColor color, const SkMaskFilter::BlurRec& blurRec,
+ const SkMatrix& viewMatrix, SkScalar x, SkScalar y);
+
+ // flush a GrAtlasTextBlob associated with a SkTextBlob
+ void flushCached(GrContext* context,
+ GrDrawContext* dc,
+ const SkTextBlob* blob,
+ const SkSurfaceProps& props,
+ const GrDistanceFieldAdjustTable* distanceAdjustTable,
+ const SkPaint& skPaint,
+ const GrPaint& grPaint,
+ SkDrawFilter* drawFilter,
+ const GrClip& clip,
+ const SkMatrix& viewMatrix,
+ const SkIRect& clipBounds,
+ SkScalar x, SkScalar y,
+ SkScalar transX, SkScalar transY);
+
+ // flush a throwaway GrAtlasTextBlob *not* associated with an SkTextBlob
+ void flushThrowaway(GrContext* context,
+ GrDrawContext* dc,
+ const SkSurfaceProps& props,
+ const GrDistanceFieldAdjustTable* distanceAdjustTable,
+ const SkPaint& skPaint,
+ const GrPaint& grPaint,
+ const GrClip& clip,
+ const SkIRect& clipBounds);
+
+ // position + local coord
+ static const size_t kColorTextVASize = sizeof(SkPoint) + sizeof(SkIPoint16);
+ static const size_t kGrayTextVASize = sizeof(SkPoint) + sizeof(GrColor) + sizeof(SkIPoint16);
+ static const size_t kLCDTextVASize = kGrayTextVASize;
+ static const int kVerticesPerGlyph = 4;
+
+#ifdef CACHE_SANITY_CHECK
+ static void AssertEqual(const GrAtlasTextBlob&, const GrAtlasTextBlob&);
+ size_t fSize;
+#endif
+
+ // The color here is the GrPaint color, and it is used to determine whether we
+ // have to regenerate LCD text blobs.
+ // We use this color vs the SkPaint color because it has the colorfilter applied.
+ void initReusableBlob(GrColor color, const SkMatrix& viewMatrix, SkScalar x, SkScalar y) {
+ fPaintColor = color;
+ fViewMatrix = viewMatrix;
+ fX = x;
+ fY = y;
+ }
+
+ void initThrowawayBlob(const SkMatrix& viewMatrix) {
+ fViewMatrix = viewMatrix;
+ }
+
+ GrDrawBatch* test_createBatch(int glyphCount, int run, int subRun,
+ GrColor color, SkScalar transX, SkScalar transY,
+ const SkPaint& skPaint, const SkSurfaceProps& props,
+ const GrDistanceFieldAdjustTable* distanceAdjustTable,
+ GrBatchFontCache* cache);
+
+private:
+ void appendLargeGlyph(GrGlyph* glyph, GrFontScaler* scaler, const SkGlyph& skGlyph,
+ SkScalar x, SkScalar y, SkScalar scale, bool applyVM);
+
+ inline void flushRun(GrDrawContext* dc, GrPipelineBuilder* pipelineBuilder,
+ int run, GrColor color,
+ SkScalar transX, SkScalar transY,
+ const SkPaint& skPaint, const SkSurfaceProps& props,
+ const GrDistanceFieldAdjustTable* distanceAdjustTable,
+ GrBatchFontCache* cache);
+
+ void flushBigGlyphs(GrContext* context, GrDrawContext* dc,
+ const GrClip& clip, const SkPaint& skPaint,
+ SkScalar transX, SkScalar transY,
+ const SkIRect& clipBounds);
+
+ void flushRunAsPaths(GrContext* context,
+ GrDrawContext* dc,
+ const SkSurfaceProps& props,
+ const SkTextBlobRunIterator& it,
+ const GrClip& clip, const SkPaint& skPaint,
+ SkDrawFilter* drawFilter, const SkMatrix& viewMatrix,
+ const SkIRect& clipBounds, SkScalar x, SkScalar y);
+
/*
* Each Run inside of the blob can have its texture coordinates regenerated if required.
* To determine if regeneration is necessary, fAtlasGeneration is used. If there have been
@@ -177,6 +381,13 @@ public:
bool fDrawAsPaths;
};
+ inline GrDrawBatch* createBatch(const Run::SubRunInfo& info,
+ int glyphCount, int run, int subRun,
+ GrColor color, SkScalar transX, SkScalar transY,
+ const SkPaint& skPaint, const SkSurfaceProps& props,
+ const GrDistanceFieldAdjustTable* distanceAdjustTable,
+ GrBatchFontCache* cache);
+
struct BigGlyph {
BigGlyph(const SkPath& path, SkScalar vx, SkScalar vy, SkScalar scale, bool applyVM)
: fPath(path)
@@ -191,25 +402,6 @@ public:
bool fApplyVM;
};
- struct Key {
- Key() {
- sk_bzero(this, sizeof(Key));
- }
- uint32_t fUniqueID;
- // Color may affect the gamma of the mask we generate, but in a fairly limited way.
- // Each color is assigned to on of a fixed number of buckets based on its
- // luminance. For each luminance bucket there is a "canonical color" that
- // represents the bucket. This functionality is currently only supported for A8
- SkColor fCanonicalColor;
- SkPaint::Style fStyle;
- SkPixelGeometry fPixelGeometry;
- bool fHasBlur;
-
- bool operator==(const Key& other) const {
- return 0 == memcmp(this, &other, sizeof(Key));
- }
- };
-
struct StrokeInfo {
SkScalar fFrameWidth;
SkScalar fMiterLimit;
@@ -243,169 +435,8 @@ public:
int fRunCount;
uint8_t fTextType;
- GrAtlasTextBlob()
- : fMaxMinScale(-SK_ScalarMax)
- , fMinMaxScale(SK_ScalarMax)
- , fTextType(0) {}
-
- ~GrAtlasTextBlob() {
- for (int i = 0; i < fRunCount; i++) {
- fRuns[i].~Run();
- }
- }
-
- static const Key& GetKey(const GrAtlasTextBlob& blob) {
- return blob.fKey;
- }
-
- static uint32_t Hash(const Key& key) {
- return SkChecksum::Murmur3(&key, sizeof(Key));
- }
-
- void operator delete(void* p) {
- GrAtlasTextBlob* blob = reinterpret_cast<GrAtlasTextBlob*>(p);
- blob->fPool->release(p);
- }
- void* operator new(size_t) {
- SkFAIL("All blobs are created by placement new.");
- return sk_malloc_throw(0);
- }
-
- void* operator new(size_t, void* p) { return p; }
- void operator delete(void* target, void* placement) {
- ::operator delete(target, placement);
- }
-
- bool hasDistanceField() const { return SkToBool(fTextType & kHasDistanceField_TextType); }
- bool hasBitmap() const { return SkToBool(fTextType & kHasBitmap_TextType); }
- void setHasDistanceField() { fTextType |= kHasDistanceField_TextType; }
- void setHasBitmap() { fTextType |= kHasBitmap_TextType; }
-
- void push_back_run(int currRun) {
- SkASSERT(currRun < fRunCount);
- if (currRun > 0) {
- Run::SubRunInfo& newRun = fRuns[currRun].fSubRunInfo.back();
- Run::SubRunInfo& lastRun = fRuns[currRun - 1].fSubRunInfo.back();
- newRun.setAsSuccessor(lastRun);
- }
- }
-
- // sets the last subrun of runIndex to use distance field text
- void setSubRunHasDistanceFields(int runIndex, bool hasLCD) {
- Run& run = fRuns[runIndex];
- Run::SubRunInfo& subRun = run.fSubRunInfo.back();
- subRun.setUseLCDText(hasLCD);
- subRun.setDrawAsDistanceFields();
- }
-
- // inits the override descriptor on the current run. All following subruns must use this
- // descriptor
- void initOverride(int runIndex) {
- Run& run = fRuns[runIndex];
- // Push back a new subrun to fill and set the override descriptor
- run.push_back();
- run.fOverrideDescriptor.reset(new SkAutoDescriptor);
- }
-
- SkGlyphCache* setupCache(int runIndex,
- const SkSurfaceProps& props,
- const SkPaint& skPaint,
- const SkMatrix* viewMatrix,
- bool noGamma);
-
- // Appends a glyph to the blob. If the glyph is too large, the glyph will be appended
- // as a path.
- void appendGlyph(int runIndex,
- const SkRect& positions,
- GrColor color,
- GrBatchTextStrike* strike,
- GrGlyph* glyph,
- GrFontScaler* scaler, const SkGlyph& skGlyph,
- SkScalar x, SkScalar y, SkScalar scale, bool applyVM);
-
- static size_t GetVertexStride(GrMaskFormat maskFormat) {
- switch (maskFormat) {
- case kA8_GrMaskFormat:
- return kGrayTextVASize;
- case kARGB_GrMaskFormat:
- return kColorTextVASize;
- default:
- return kLCDTextVASize;
- }
- }
-
- bool mustRegenerate(SkScalar* outTransX, SkScalar* outTransY, const SkPaint& paint,
- GrColor color, const SkMaskFilter::BlurRec& blurRec,
- const SkMatrix& viewMatrix, SkScalar x, SkScalar y);
-
- // flush a GrAtlasTextBlob associated with a SkTextBlob
- void flushCached(GrContext* context,
- GrDrawContext* dc,
- const SkTextBlob* blob,
- const SkSurfaceProps& props,
- const GrDistanceFieldAdjustTable* distanceAdjustTable,
- const SkPaint& skPaint,
- const GrPaint& grPaint,
- SkDrawFilter* drawFilter,
- const GrClip& clip,
- const SkMatrix& viewMatrix,
- const SkIRect& clipBounds,
- SkScalar x, SkScalar y,
- SkScalar transX, SkScalar transY);
-
- // flush a throwaway GrAtlasTextBlob *not* associated with an SkTextBlob
- void flushThrowaway(GrContext* context,
- GrDrawContext* dc,
- const SkSurfaceProps& props,
- const GrDistanceFieldAdjustTable* distanceAdjustTable,
- const SkPaint& skPaint,
- const GrPaint& grPaint,
- const GrClip& clip,
- const SkIRect& clipBounds);
-
- // position + local coord
- static const size_t kColorTextVASize = sizeof(SkPoint) + sizeof(SkIPoint16);
- static const size_t kGrayTextVASize = sizeof(SkPoint) + sizeof(GrColor) + sizeof(SkIPoint16);
- static const size_t kLCDTextVASize = kGrayTextVASize;
- static const int kVerticesPerGlyph = 4;
-
-#ifdef CACHE_SANITY_CHECK
- static void AssertEqual(const GrAtlasTextBlob&, const GrAtlasTextBlob&);
- size_t fSize;
-#endif
-
- // We'd like to inline this and make it private, but there is some test code which calls it.
- // TODO refactor this
- GrDrawBatch* createBatch(const Run::SubRunInfo& info,
- int glyphCount, int run, int subRun,
- GrColor color, SkScalar transX, SkScalar transY,
- const SkPaint& skPaint, const SkSurfaceProps& props,
- const GrDistanceFieldAdjustTable* distanceAdjustTable,
- GrBatchFontCache* cache);
-
-private:
- void appendLargeGlyph(GrGlyph* glyph, GrFontScaler* scaler, const SkGlyph& skGlyph,
- SkScalar x, SkScalar y, SkScalar scale, bool applyVM);
-
- inline void flushRun(GrDrawContext* dc, GrPipelineBuilder* pipelineBuilder,
- int run, GrColor color,
- SkScalar transX, SkScalar transY,
- const SkPaint& skPaint, const SkSurfaceProps& props,
- const GrDistanceFieldAdjustTable* distanceAdjustTable,
- GrBatchFontCache* cache);
-
- void flushBigGlyphs(GrContext* context, GrDrawContext* dc,
- const GrClip& clip, const SkPaint& skPaint,
- SkScalar transX, SkScalar transY,
- const SkIRect& clipBounds);
-
- void flushRunAsPaths(GrContext* context,
- GrDrawContext* dc,
- const SkSurfaceProps& props,
- const SkTextBlobRunIterator& it,
- const GrClip& clip, const SkPaint& skPaint,
- SkDrawFilter* drawFilter, const SkMatrix& viewMatrix,
- const SkIRect& clipBounds, SkScalar x, SkScalar y);
+ friend class GrAtlasTextBatch; // We might be able to get rid of this friending
+ friend class GrTextBlobCache; // Needs to access the key
};
#endif
diff --git a/src/gpu/text/GrAtlasTextContext.cpp b/src/gpu/text/GrAtlasTextContext.cpp
index 85030686cc..e286aa6d0f 100644
--- a/src/gpu/text/GrAtlasTextContext.cpp
+++ b/src/gpu/text/GrAtlasTextContext.cpp
@@ -191,13 +191,7 @@ void GrAtlasTextContext::regenerateTextBlob(GrAtlasTextBlob* cacheBlob,
const SkMatrix& viewMatrix,
const SkTextBlob* blob, SkScalar x, SkScalar y,
SkDrawFilter* drawFilter) {
- // The color here is the GrPaint color, and it is used to determine whether we
- // have to regenerate LCD text blobs.
- // We use this color vs the SkPaint color because it has the colorfilter applied.
- cacheBlob->fPaintColor = color;
- cacheBlob->fViewMatrix = viewMatrix;
- cacheBlob->fX = x;
- cacheBlob->fY = y;
+ cacheBlob->initReusableBlob(color, viewMatrix, x, y);
// Regenerate textblob
SkPaint runPaint = skPaint;
@@ -248,7 +242,7 @@ void GrAtlasTextContext::regenerateTextBlob(GrAtlasTextBlob* cacheBlob,
}
}
} else if (SkDraw::ShouldDrawTextAsPaths(runPaint, viewMatrix)) {
- cacheBlob->fRuns[run].fDrawAsPaths = true;
+ cacheBlob->setRunDrawAsPaths(run);
} else {
switch (it.positioning()) {
case SkTextBlob::kDefault_Positioning:
@@ -287,7 +281,7 @@ GrAtlasTextContext::createDrawTextBlob(const GrPaint& paint, const SkPaint& skPa
int glyphCount = skPaint.countText(text, byteLength);
GrAtlasTextBlob* blob = fCache->createBlob(glyphCount, 1, GrAtlasTextBlob::kGrayTextVASize);
- blob->fViewMatrix = viewMatrix;
+ blob->initThrowawayBlob(viewMatrix);
if (GrTextUtils::CanDrawAsDistanceFields(skPaint, viewMatrix, fSurfaceProps,
*fContext->caps()->shaderCaps())) {
@@ -310,7 +304,7 @@ GrAtlasTextContext::createDrawPosTextBlob(const GrPaint& paint, const SkPaint& s
int glyphCount = skPaint.countText(text, byteLength);
GrAtlasTextBlob* blob = fCache->createBlob(glyphCount, 1, GrAtlasTextBlob::kGrayTextVASize);
- blob->fViewMatrix = viewMatrix;
+ blob->initThrowawayBlob(viewMatrix);
if (GrTextUtils::CanDrawAsDistanceFields(skPaint, viewMatrix, fSurfaceProps,
*fContext->caps()->shaderCaps())) {
@@ -401,10 +395,9 @@ DRAW_BATCH_TEST_DEFINE(TextBlobBatch) {
SkScalar transX = static_cast<SkScalar>(random->nextU());
SkScalar transY = static_cast<SkScalar>(random->nextU());
- const GrAtlasTextBlob::Run::SubRunInfo& info = blob->fRuns[0].fSubRunInfo[0];
- return blob->createBatch(info, textLen, 0, 0, color, transX, transY, skPaint,
- gSurfaceProps, gTextContext->dfAdjustTable(),
- context->getBatchFontCache());
+ return blob->test_createBatch(textLen, 0, 0, color, transX, transY, skPaint,
+ gSurfaceProps, gTextContext->dfAdjustTable(),
+ context->getBatchFontCache());
}
#endif
diff --git a/src/gpu/text/GrAtlasTextContext.h b/src/gpu/text/GrAtlasTextContext.h
index f3fe34579d..94a9cffba1 100644
--- a/src/gpu/text/GrAtlasTextContext.h
+++ b/src/gpu/text/GrAtlasTextContext.h
@@ -51,9 +51,6 @@ private:
const SkMatrix& viewMatrix, const SkTextBlob*, SkScalar x, SkScalar y,
SkDrawFilter*, const SkIRect& clipBounds) override;
- typedef GrAtlasTextBlob::Run Run;
- typedef Run::SubRunInfo PerSubRunInfo;
-
// sets up the descriptor on the blob and returns a detached cache. Client must attach
inline static GrColor ComputeCanonicalColor(const SkPaint&, bool lcd);
void regenerateTextBlob(GrAtlasTextBlob* bmp, const SkPaint& skPaint, GrColor,
diff --git a/src/gpu/text/GrTextUtils.cpp b/src/gpu/text/GrTextUtils.cpp
index 2f2c1f116a..96b12b018b 100644
--- a/src/gpu/text/GrTextUtils.cpp
+++ b/src/gpu/text/GrTextUtils.cpp
@@ -236,8 +236,7 @@ void GrTextUtils::InitDistanceFieldPaint(GrAtlasTextBlob* blob,
// against these values to decide if we can reuse or not(ie, will a given scale change our mip
// level)
SkASSERT(dfMaskScaleFloor <= scaledTextSize && scaledTextSize <= dfMaskScaleCeil);
- blob->fMaxMinScale = SkMaxScalar(dfMaskScaleFloor / scaledTextSize, blob->fMaxMinScale);
- blob->fMinMaxScale = SkMinScalar(dfMaskScaleCeil / scaledTextSize, blob->fMinMaxScale);
+ blob->setMinAndMaxScale(dfMaskScaleFloor / scaledTextSize, dfMaskScaleCeil / scaledTextSize);
skPaint->setLCDRenderText(false);
skPaint->setAutohinted(false);