aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/text
diff options
context:
space:
mode:
authorGravatar Herb Derby <herb@google.com>2018-05-24 14:39:01 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-05-24 20:41:08 +0000
commit26cbe5130aa9839b5429b9507363ce2474091808 (patch)
tree5d10df1e2a768bf31af6ccbd2fd636f44f7c98b6 /src/gpu/text
parent4a0ad501e4919e06bcf7a7ef4adec8f28818946b (diff)
Rename GrAtlasTextContext -> GrTextContext
Change-Id: I309b39425afc9b45095241eeb299096bc426afed Reviewed-on: https://skia-review.googlesource.com/130029 Reviewed-by: Herb Derby <herb@google.com> Reviewed-by: Jim Van Verth <jvanverth@google.com> Commit-Queue: Herb Derby <herb@google.com>
Diffstat (limited to 'src/gpu/text')
-rw-r--r--src/gpu/text/GrAtlasTextBlob.h4
-rw-r--r--src/gpu/text/GrDistanceFieldAdjustTable.h2
-rw-r--r--src/gpu/text/GrTextBlobCache.h2
-rw-r--r--src/gpu/text/GrTextContext.cpp (renamed from src/gpu/text/GrAtlasTextContext.cpp)263
-rw-r--r--src/gpu/text/GrTextContext.h (renamed from src/gpu/text/GrAtlasTextContext.h)8
5 files changed, 139 insertions, 140 deletions
diff --git a/src/gpu/text/GrAtlasTextBlob.h b/src/gpu/text/GrAtlasTextBlob.h
index d7e1b6def6..302a66d9d4 100644
--- a/src/gpu/text/GrAtlasTextBlob.h
+++ b/src/gpu/text/GrAtlasTextBlob.h
@@ -31,7 +31,7 @@ class SkDrawFilter;
class SkTextBlob;
class SkTextBlobRunIterator;
-// With this flag enabled, the GrAtlasTextContext will, as a sanity check, regenerate every blob
+// With this flag enabled, the GrTextContext will, as a sanity check, regenerate every blob
// that comes in to verify the integrity of its cache
#define CACHE_SANITY_CHECK 0
@@ -322,7 +322,7 @@ private:
* many SubRuns as it has glyphs, ie if a run alternates between color emoji and A8. In
* practice, the vast majority of runs have only a single subrun.
*
- * Finally, for runs where the entire thing is too large for the GrAtlasTextContext to
+ * Finally, for runs where the entire thing is too large for the GrTextContext to
* handle, we have a bit to mark the run as flushable via rendering as paths or as scaled
* glyphs. It would be a bit expensive to figure out ahead of time whether or not a run
* can flush in this manner, so we always allocate vertices for the run, regardless of
diff --git a/src/gpu/text/GrDistanceFieldAdjustTable.h b/src/gpu/text/GrDistanceFieldAdjustTable.h
index 0f5c6f29ab..fca9a8cb8e 100644
--- a/src/gpu/text/GrDistanceFieldAdjustTable.h
+++ b/src/gpu/text/GrDistanceFieldAdjustTable.h
@@ -12,7 +12,7 @@
#include "SkScalar.h"
// Distance field text needs this table to compute a value for use in the fragment shader.
-// Because the GrAtlasTextContext can go out of scope before the final flush, this needs to be
+// Because the GrTextContext can go out of scope before the final flush, this needs to be
// refcnted and malloced
struct GrDistanceFieldAdjustTable : public SkNVRefCnt<GrDistanceFieldAdjustTable> {
GrDistanceFieldAdjustTable() { this->buildDistanceAdjustTables(); }
diff --git a/src/gpu/text/GrTextBlobCache.h b/src/gpu/text/GrTextBlobCache.h
index 4931667c61..c6b5c70614 100644
--- a/src/gpu/text/GrTextBlobCache.h
+++ b/src/gpu/text/GrTextBlobCache.h
@@ -8,7 +8,7 @@
#ifndef GrTextBlobCache_DEFINED
#define GrTextBlobCache_DEFINED
-#include "GrAtlasTextContext.h"
+#include "GrTextContext.h"
#include "SkMessageBus.h"
#include "SkRefCnt.h"
#include "SkTArray.h"
diff --git a/src/gpu/text/GrAtlasTextContext.cpp b/src/gpu/text/GrTextContext.cpp
index 6d62d80b6d..dfc6898929 100644
--- a/src/gpu/text/GrAtlasTextContext.cpp
+++ b/src/gpu/text/GrTextContext.cpp
@@ -4,7 +4,7 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
-#include "GrAtlasTextContext.h"
+#include "GrTextContext.h"
#include "GrCaps.h"
#include "GrContext.h"
#include "GrContextPriv.h"
@@ -40,16 +40,16 @@ static const int kDefaultMaxDistanceFieldFontSize = 384;
static const int kDefaultMaxDistanceFieldFontSize = 2 * kLargeDFFontSize;
#endif
-GrAtlasTextContext::GrAtlasTextContext(const Options& options)
+GrTextContext::GrTextContext(const Options& options)
: fDistanceAdjustTable(new GrDistanceFieldAdjustTable), fOptions(options) {
SanitizeOptions(&fOptions);
}
-std::unique_ptr<GrAtlasTextContext> GrAtlasTextContext::Make(const Options& options) {
- return std::unique_ptr<GrAtlasTextContext>(new GrAtlasTextContext(options));
+std::unique_ptr<GrTextContext> GrTextContext::Make(const Options& options) {
+ return std::unique_ptr<GrTextContext>(new GrTextContext(options));
}
-SkColor GrAtlasTextContext::ComputeCanonicalColor(const SkPaint& paint, bool lcd) {
+SkColor GrTextContext::ComputeCanonicalColor(const SkPaint& paint, bool lcd) {
SkColor canonicalColor = paint.computeLuminanceColor();
if (lcd) {
// This is the correct computation, but there are tons of cases where LCD can be overridden.
@@ -70,7 +70,7 @@ SkColor GrAtlasTextContext::ComputeCanonicalColor(const SkPaint& paint, bool lcd
return canonicalColor;
}
-SkScalerContextFlags GrAtlasTextContext::ComputeScalerContextFlags(
+SkScalerContextFlags GrTextContext::ComputeScalerContextFlags(
const GrColorSpaceInfo& colorSpaceInfo) {
// If we're doing gamma-correct rendering, then we can disable the gamma hacks.
// Otherwise, leave them on. In either case, we still want the contrast boost:
@@ -84,7 +84,7 @@ SkScalerContextFlags GrAtlasTextContext::ComputeScalerContextFlags(
// TODO if this function ever shows up in profiling, then we can compute this value when the
// textblob is being built and cache it. However, for the time being textblobs mostly only have 1
// run so this is not a big deal to compute here.
-bool GrAtlasTextContext::HasLCD(const SkTextBlob* blob) {
+bool GrTextContext::HasLCD(const SkTextBlob* blob) {
SkTextBlobRunIterator it(blob);
for (; !it.done(); it.next()) {
if (it.isLCD()) {
@@ -94,11 +94,11 @@ bool GrAtlasTextContext::HasLCD(const SkTextBlob* blob) {
return false;
}
-void GrAtlasTextContext::drawTextBlob(GrContext* context, GrTextUtils::Target* target,
- const GrClip& clip, const SkPaint& skPaint,
- const SkMatrix& viewMatrix, const SkSurfaceProps& props,
- const SkTextBlob* blob, SkScalar x, SkScalar y,
- SkDrawFilter* drawFilter, const SkIRect& clipBounds) {
+void GrTextContext::drawTextBlob(GrContext* context, GrTextUtils::Target* target,
+ const GrClip& clip, const SkPaint& skPaint,
+ const SkMatrix& viewMatrix, const SkSurfaceProps& props,
+ const SkTextBlob* blob, SkScalar x, SkScalar y,
+ SkDrawFilter* drawFilter, const SkIRect& clipBounds) {
// If we have been abandoned, then don't draw
if (context->contextPriv().abandoned()) {
return;
@@ -181,15 +181,15 @@ void GrAtlasTextContext::drawTextBlob(GrContext* context, GrTextUtils::Target* t
clip, viewMatrix, clipBounds, x, y);
}
-void GrAtlasTextContext::regenerateTextBlob(GrAtlasTextBlob* cacheBlob,
- GrGlyphCache* glyphCache,
- const GrShaderCaps& shaderCaps,
- const GrTextUtils::Paint& paint,
- SkScalerContextFlags scalerContextFlags,
- const SkMatrix& viewMatrix,
- const SkSurfaceProps& props, const SkTextBlob* blob,
- SkScalar x, SkScalar y,
- SkDrawFilter* drawFilter) const {
+void GrTextContext::regenerateTextBlob(GrAtlasTextBlob* cacheBlob,
+ GrGlyphCache* glyphCache,
+ const GrShaderCaps& shaderCaps,
+ const GrTextUtils::Paint& paint,
+ SkScalerContextFlags scalerContextFlags,
+ const SkMatrix& viewMatrix,
+ const SkSurfaceProps& props, const SkTextBlob* blob,
+ SkScalar x, SkScalar y,
+ SkDrawFilter* drawFilter) const {
cacheBlob->initReusableBlob(paint.luminanceColor(), viewMatrix, x, y);
// Regenerate textblob
@@ -252,15 +252,15 @@ void GrAtlasTextContext::regenerateTextBlob(GrAtlasTextBlob* cacheBlob,
}
inline sk_sp<GrAtlasTextBlob>
-GrAtlasTextContext::makeDrawTextBlob(GrTextBlobCache* blobCache,
- GrGlyphCache* glyphCache,
- const GrShaderCaps& shaderCaps,
- const GrTextUtils::Paint& paint,
- SkScalerContextFlags scalerContextFlags,
- const SkMatrix& viewMatrix,
- const SkSurfaceProps& props,
- const char text[], size_t byteLength,
- SkScalar x, SkScalar y) const {
+GrTextContext::makeDrawTextBlob(GrTextBlobCache* blobCache,
+ GrGlyphCache* glyphCache,
+ const GrShaderCaps& shaderCaps,
+ const GrTextUtils::Paint& paint,
+ SkScalerContextFlags scalerContextFlags,
+ const SkMatrix& viewMatrix,
+ const SkSurfaceProps& props,
+ const char text[], size_t byteLength,
+ SkScalar x, SkScalar y) const {
int glyphCount = paint.skPaint().countText(text, byteLength);
if (!glyphCount) {
return nullptr;
@@ -281,16 +281,16 @@ GrAtlasTextContext::makeDrawTextBlob(GrTextBlobCache* blobCache,
}
inline sk_sp<GrAtlasTextBlob>
-GrAtlasTextContext::makeDrawPosTextBlob(GrTextBlobCache* blobCache,
- GrGlyphCache* glyphCache,
- const GrShaderCaps& shaderCaps,
- const GrTextUtils::Paint& paint,
- SkScalerContextFlags scalerContextFlags,
- const SkMatrix& viewMatrix,
- const SkSurfaceProps& props,
- const char text[], size_t byteLength,
- const SkScalar pos[], int scalarsPerPosition, const
- SkPoint& offset) const {
+GrTextContext::makeDrawPosTextBlob(GrTextBlobCache* blobCache,
+ GrGlyphCache* glyphCache,
+ const GrShaderCaps& shaderCaps,
+ const GrTextUtils::Paint& paint,
+ SkScalerContextFlags scalerContextFlags,
+ const SkMatrix& viewMatrix,
+ const SkSurfaceProps& props,
+ const char text[], size_t byteLength,
+ const SkScalar pos[], int scalarsPerPosition, const
+ SkPoint& offset) const {
int glyphCount = paint.skPaint().countText(text, byteLength);
if (!glyphCount) {
return nullptr;
@@ -311,11 +311,11 @@ GrAtlasTextContext::makeDrawPosTextBlob(GrTextBlobCache* blobCache,
return blob;
}
-void GrAtlasTextContext::drawText(GrContext* context, GrTextUtils::Target* target,
- const GrClip& clip, const SkPaint& skPaint,
- const SkMatrix& viewMatrix, const SkSurfaceProps& props,
- const char text[], size_t byteLength, SkScalar x, SkScalar y,
- const SkIRect& regionClipBounds) {
+void GrTextContext::drawText(GrContext* context, GrTextUtils::Target* target,
+ const GrClip& clip, const SkPaint& skPaint,
+ const SkMatrix& viewMatrix, const SkSurfaceProps& props,
+ const char text[], size_t byteLength, SkScalar x, SkScalar y,
+ const SkIRect& regionClipBounds) {
if (context->contextPriv().abandoned()) {
return;
}
@@ -334,12 +334,12 @@ void GrAtlasTextContext::drawText(GrContext* context, GrTextUtils::Target* targe
}
}
-void GrAtlasTextContext::drawPosText(GrContext* context, GrTextUtils::Target* target,
- const GrClip& clip, const SkPaint& skPaint,
- const SkMatrix& viewMatrix, const SkSurfaceProps& props,
- const char text[], size_t byteLength, const SkScalar pos[],
- int scalarsPerPosition, const SkPoint& offset,
- const SkIRect& regionClipBounds) {
+void GrTextContext::drawPosText(GrContext* context, GrTextUtils::Target* target,
+ const GrClip& clip, const SkPaint& skPaint,
+ const SkMatrix& viewMatrix, const SkSurfaceProps& props,
+ const char text[], size_t byteLength, const SkScalar pos[],
+ int scalarsPerPosition, const SkPoint& offset,
+ const SkIRect& regionClipBounds) {
GrTextUtils::Paint paint(&skPaint, &target->colorSpaceInfo());
if (context->contextPriv().abandoned()) {
return;
@@ -358,12 +358,12 @@ void GrAtlasTextContext::drawPosText(GrContext* context, GrTextUtils::Target* ta
}
}
-void GrAtlasTextContext::DrawBmpText(GrAtlasTextBlob* blob, int runIndex,
- GrGlyphCache* glyphCache, const SkSurfaceProps& props,
- const GrTextUtils::Paint& paint,
- SkScalerContextFlags scalerContextFlags,
- const SkMatrix& viewMatrix, const char text[],
- size_t byteLength, SkScalar x, SkScalar y) {
+void GrTextContext::DrawBmpText(GrAtlasTextBlob* blob, int runIndex,
+ GrGlyphCache* glyphCache, const SkSurfaceProps& props,
+ const GrTextUtils::Paint& paint,
+ SkScalerContextFlags scalerContextFlags,
+ const SkMatrix& viewMatrix, const char text[],
+ size_t byteLength, SkScalar x, SkScalar y) {
SkASSERT(byteLength == 0 || text != nullptr);
// nothing to draw
@@ -394,13 +394,13 @@ void GrAtlasTextContext::DrawBmpText(GrAtlasTextBlob* blob, int runIndex,
});
}
-void GrAtlasTextContext::DrawBmpPosText(GrAtlasTextBlob* blob, int runIndex,
- GrGlyphCache* glyphCache, const SkSurfaceProps& props,
- const GrTextUtils::Paint& paint,
- SkScalerContextFlags scalerContextFlags,
- const SkMatrix& viewMatrix,
- const char text[], size_t byteLength, const SkScalar pos[],
- int scalarsPerPosition, const SkPoint& offset) {
+void GrTextContext::DrawBmpPosText(GrAtlasTextBlob* blob, int runIndex,
+ GrGlyphCache* glyphCache, const SkSurfaceProps& props,
+ const GrTextUtils::Paint& paint,
+ SkScalerContextFlags scalerContextFlags,
+ const SkMatrix& viewMatrix,
+ const char text[], size_t byteLength, const SkScalar pos[],
+ int scalarsPerPosition, const SkPoint& offset) {
SkASSERT(byteLength == 0 || text != nullptr);
SkASSERT(1 == scalarsPerPosition || 2 == scalarsPerPosition);
@@ -432,13 +432,13 @@ void GrAtlasTextContext::DrawBmpPosText(GrAtlasTextBlob* blob, int runIndex,
});
}
-void GrAtlasTextContext::DrawBmpTextAsPaths(GrAtlasTextBlob* blob, int runIndex,
- GrGlyphCache* glyphCache,
- const SkSurfaceProps& props,
- const GrTextUtils::Paint& origPaint,
- SkScalerContextFlags scalerContextFlags,
- const SkMatrix& viewMatrix, const char text[],
- size_t byteLength, SkScalar x, SkScalar y) {
+void GrTextContext::DrawBmpTextAsPaths(GrAtlasTextBlob* blob, int runIndex,
+ GrGlyphCache* glyphCache,
+ const SkSurfaceProps& props,
+ const GrTextUtils::Paint& origPaint,
+ SkScalerContextFlags scalerContextFlags,
+ const SkMatrix& viewMatrix, const char text[],
+ size_t byteLength, SkScalar x, SkScalar y) {
// nothing to draw
if (text == nullptr || byteLength == 0) {
return;
@@ -469,15 +469,15 @@ void GrAtlasTextContext::DrawBmpTextAsPaths(GrAtlasTextBlob* blob, int runIndex,
fallbackTextHelper.drawText(blob, runIndex, glyphCache, props, origPaint, scalerContextFlags);
}
-void GrAtlasTextContext::DrawBmpPosTextAsPaths(GrAtlasTextBlob* blob, int runIndex,
- GrGlyphCache* glyphCache,
- const SkSurfaceProps& props,
- const GrTextUtils::Paint& origPaint,
- SkScalerContextFlags scalerContextFlags,
- const SkMatrix& viewMatrix,
- const char text[], size_t byteLength,
- const SkScalar pos[], int scalarsPerPosition,
- const SkPoint& offset) {
+void GrTextContext::DrawBmpPosTextAsPaths(GrAtlasTextBlob* blob, int runIndex,
+ GrGlyphCache* glyphCache,
+ const SkSurfaceProps& props,
+ const GrTextUtils::Paint& origPaint,
+ SkScalerContextFlags scalerContextFlags,
+ const SkMatrix& viewMatrix,
+ const char text[], size_t byteLength,
+ const SkScalar pos[], int scalarsPerPosition,
+ const SkPoint& offset) {
SkASSERT(1 == scalarsPerPosition || 2 == scalarsPerPosition);
// nothing to draw
@@ -524,12 +524,12 @@ void GrAtlasTextContext::DrawBmpPosTextAsPaths(GrAtlasTextBlob* blob, int runInd
fallbackTextHelper.drawText(blob, runIndex, glyphCache, props, origPaint, scalerContextFlags);
}
-void GrAtlasTextContext::BmpAppendGlyph(GrAtlasTextBlob* blob, int runIndex,
- GrGlyphCache* grGlyphCache,
- sk_sp<GrTextStrike>* strike,
- const SkGlyph& skGlyph, SkScalar sx, SkScalar sy,
- GrColor color, SkGlyphCache* skGlyphCache,
- SkScalar textRatio, bool needsTransform) {
+void GrTextContext::BmpAppendGlyph(GrAtlasTextBlob* blob, int runIndex,
+ GrGlyphCache* grGlyphCache,
+ sk_sp<GrTextStrike>* strike,
+ const SkGlyph& skGlyph, SkScalar sx, SkScalar sy,
+ GrColor color, SkGlyphCache* skGlyphCache,
+ SkScalar textRatio, bool needsTransform) {
if (!*strike) {
*strike = grGlyphCache->getStrike(skGlyphCache);
}
@@ -562,7 +562,7 @@ void GrAtlasTextContext::BmpAppendGlyph(GrAtlasTextBlob* blob, int runIndex,
textRatio, !needsTransform);
}
-void GrAtlasTextContext::SanitizeOptions(Options* options) {
+void GrTextContext::SanitizeOptions(Options* options) {
if (options->fMaxDistanceFieldFontSize < 0.f) {
options->fMaxDistanceFieldFontSize = kDefaultMaxDistanceFieldFontSize;
}
@@ -571,10 +571,10 @@ void GrAtlasTextContext::SanitizeOptions(Options* options) {
}
}
-bool GrAtlasTextContext::CanDrawAsDistanceFields(const SkPaint& skPaint, const SkMatrix& viewMatrix,
- const SkSurfaceProps& props,
- bool contextSupportsDistanceFieldText,
- const Options& options) {
+bool GrTextContext::CanDrawAsDistanceFields(const SkPaint& skPaint, const SkMatrix& viewMatrix,
+ const SkSurfaceProps& props,
+ bool contextSupportsDistanceFieldText,
+ const Options& options) {
if (!viewMatrix.hasPerspective()) {
SkScalar maxScale = viewMatrix.getMaxScale();
SkScalar scaledTextSize = maxScale * skPaint.getTextSize();
@@ -608,12 +608,12 @@ bool GrAtlasTextContext::CanDrawAsDistanceFields(const SkPaint& skPaint, const S
return true;
}
-void GrAtlasTextContext::InitDistanceFieldPaint(GrAtlasTextBlob* blob,
- SkPaint* skPaint,
- const SkMatrix& viewMatrix,
- const Options& options,
- SkScalar* textRatio,
- SkScalerContextFlags* flags) {
+void GrTextContext::InitDistanceFieldPaint(GrAtlasTextBlob* blob,
+ SkPaint* skPaint,
+ const SkMatrix& viewMatrix,
+ const Options& options,
+ SkScalar* textRatio,
+ SkScalerContextFlags* flags) {
SkScalar textSize = skPaint->getTextSize();
SkScalar scaledTextSize = textSize;
@@ -678,12 +678,12 @@ void GrAtlasTextContext::InitDistanceFieldPaint(GrAtlasTextBlob* blob,
*flags = SkScalerContextFlags::kNone;
}
-void GrAtlasTextContext::drawDFText(GrAtlasTextBlob* blob, int runIndex,
- GrGlyphCache* glyphCache, const SkSurfaceProps& props,
- const GrTextUtils::Paint& paint,
- SkScalerContextFlags scalerContextFlags,
- const SkMatrix& viewMatrix, const char text[],
- size_t byteLength, SkScalar x, SkScalar y) const {
+void GrTextContext::drawDFText(GrAtlasTextBlob* blob, int runIndex,
+ GrGlyphCache* glyphCache, const SkSurfaceProps& props,
+ const GrTextUtils::Paint& paint,
+ SkScalerContextFlags scalerContextFlags,
+ const SkMatrix& viewMatrix, const char text[],
+ size_t byteLength, SkScalar x, SkScalar y) const {
SkASSERT(byteLength == 0 || text != nullptr);
// nothing to draw
@@ -746,13 +746,13 @@ void GrAtlasTextContext::drawDFText(GrAtlasTextBlob* blob, int runIndex,
viewMatrix, text, byteLength, positions.begin(), 2, offset);
}
-void GrAtlasTextContext::drawDFPosText(GrAtlasTextBlob* blob, int runIndex,
- GrGlyphCache* glyphCache, const SkSurfaceProps& props,
- const GrTextUtils::Paint& paint,
- SkScalerContextFlags scalerContextFlags,
- const SkMatrix& viewMatrix, const char text[],
- size_t byteLength, const SkScalar pos[],
- int scalarsPerPosition, const SkPoint& offset) const {
+void GrTextContext::drawDFPosText(GrAtlasTextBlob* blob, int runIndex,
+ GrGlyphCache* glyphCache, const SkSurfaceProps& props,
+ const GrTextUtils::Paint& paint,
+ SkScalerContextFlags scalerContextFlags,
+ const SkMatrix& viewMatrix, const char text[],
+ size_t byteLength, const SkScalar pos[],
+ int scalarsPerPosition, const SkPoint& offset) const {
SkASSERT(byteLength == 0 || text != nullptr);
SkASSERT(1 == scalarsPerPosition || 2 == scalarsPerPosition);
@@ -810,11 +810,11 @@ void GrAtlasTextContext::drawDFPosText(GrAtlasTextBlob* blob, int runIndex,
}
// TODO: merge with BmpAppendGlyph
-void GrAtlasTextContext::DfAppendGlyph(GrAtlasTextBlob* blob, int runIndex,
- GrGlyphCache* grGlyphCache, sk_sp<GrTextStrike>* strike,
- const SkGlyph& skGlyph, SkScalar sx, SkScalar sy,
- GrColor color, SkGlyphCache* skGlyphCache,
- SkScalar textRatio) {
+void GrTextContext::DfAppendGlyph(GrAtlasTextBlob* blob, int runIndex,
+ GrGlyphCache* grGlyphCache, sk_sp<GrTextStrike>* strike,
+ const SkGlyph& skGlyph, SkScalar sx, SkScalar sy,
+ GrColor color, SkGlyphCache* skGlyphCache,
+ SkScalar textRatio) {
if (!*strike) {
*strike = grGlyphCache->getStrike(skGlyphCache);
}
@@ -845,7 +845,7 @@ void GrAtlasTextContext::DfAppendGlyph(GrAtlasTextBlob* blob, int runIndex,
///////////////////////////////////////////////////////////////////////////////////////////////////
-void GrAtlasTextContext::FallbackTextHelper::appendText(const SkGlyph& glyph, int count,
+void GrTextContext::FallbackTextHelper::appendText(const SkGlyph& glyph, int count,
const char* text, SkPoint glyphPos) {
SkScalar maxDim = SkTMax(glyph.fWidth, glyph.fHeight)*fTextRatio;
if (!fUseTransformedFallback) {
@@ -868,11 +868,11 @@ void GrAtlasTextContext::FallbackTextHelper::appendText(const SkGlyph& glyph, in
*fFallbackPos.append() = glyphPos;
}
-void GrAtlasTextContext::FallbackTextHelper::drawText(GrAtlasTextBlob* blob, int runIndex,
- GrGlyphCache* glyphCache,
- const SkSurfaceProps& props,
- const GrTextUtils::Paint& paint,
- SkScalerContextFlags scalerContextFlags) {
+void GrTextContext::FallbackTextHelper::drawText(GrAtlasTextBlob* blob, int runIndex,
+ GrGlyphCache* glyphCache,
+ const SkSurfaceProps& props,
+ const GrTextUtils::Paint& paint,
+ SkScalerContextFlags scalerContextFlags) {
if (fFallbackTxt.count()) {
blob->initOverride(runIndex);
blob->setHasBitmap();
@@ -906,7 +906,7 @@ void GrAtlasTextContext::FallbackTextHelper::drawText(GrAtlasTextBlob* blob, int
glyphPos->fX = SkScalarFloorToScalar(glyphPos->fX);
glyphPos->fY = SkScalarFloorToScalar(glyphPos->fY);
}
- GrAtlasTextContext::BmpAppendGlyph(blob, runIndex, glyphCache, &currStrike, glyph,
+ GrTextContext::BmpAppendGlyph(blob, runIndex, glyphCache, &currStrike, glyph,
glyphPos->fX, glyphPos->fY, textColor,
cache.get(), textRatio, fUseTransformedFallback);
glyphPos++;
@@ -920,13 +920,12 @@ void GrAtlasTextContext::FallbackTextHelper::drawText(GrAtlasTextBlob* blob, int
#include "GrRenderTargetContext.h"
-std::unique_ptr<GrDrawOp> GrAtlasTextContext::createOp_TestingOnly(
- GrContext* context,
- GrAtlasTextContext* textContext,
- GrRenderTargetContext* rtc,
- const SkPaint& skPaint,
- const SkMatrix& viewMatrix,
- const char* text, int x, int y) {
+std::unique_ptr<GrDrawOp> GrTextContext::createOp_TestingOnly(GrContext* context,
+ GrTextContext* textContext,
+ GrRenderTargetContext* rtc,
+ const SkPaint& skPaint,
+ const SkMatrix& viewMatrix,
+ const char* text, int x, int y) {
auto glyphCache = context->contextPriv().getGlyphCache();
static SkSurfaceProps surfaceProps(SkSurfaceProps::kLegacyFontHost_InitType);
@@ -940,7 +939,7 @@ std::unique_ptr<GrDrawOp> GrAtlasTextContext::createOp_TestingOnly(
sk_sp<GrAtlasTextBlob> blob(textContext->makeDrawTextBlob(
context->contextPriv().getTextBlobCache(), glyphCache,
*context->contextPriv().caps()->shaderCaps(), utilsPaint,
- GrAtlasTextContext::kTextBlobOpScalerContextFlags, viewMatrix, surfaceProps, text,
+ GrTextContext::kTextBlobOpScalerContextFlags, viewMatrix, surfaceProps, text,
static_cast<size_t>(textLen), SkIntToScalar(x), SkIntToScalar(y)));
return blob->test_makeOp(textLen, 0, 0, viewMatrix, x, y, utilsPaint, surfaceProps,
@@ -949,12 +948,12 @@ std::unique_ptr<GrDrawOp> GrAtlasTextContext::createOp_TestingOnly(
GR_DRAW_OP_TEST_DEFINE(GrAtlasTextOp) {
static uint32_t gContextID = SK_InvalidGenID;
- static std::unique_ptr<GrAtlasTextContext> gTextContext;
+ static std::unique_ptr<GrTextContext> gTextContext;
static SkSurfaceProps gSurfaceProps(SkSurfaceProps::kLegacyFontHost_InitType);
if (context->uniqueID() != gContextID) {
gContextID = context->uniqueID();
- gTextContext = GrAtlasTextContext::Make(GrAtlasTextContext::Options());
+ gTextContext = GrTextContext::Make(GrTextContext::Options());
}
// Setup dummy SkPaint / GrPaint / GrRenderTargetContext
diff --git a/src/gpu/text/GrAtlasTextContext.h b/src/gpu/text/GrTextContext.h
index aa6557caf3..b5bb22f3d5 100644
--- a/src/gpu/text/GrAtlasTextContext.h
+++ b/src/gpu/text/GrTextContext.h
@@ -25,7 +25,7 @@ class SkGlyph;
/*
* Renders text using some kind of an atlas, ie BitmapText or DistanceField text
*/
-class GrAtlasTextContext {
+class GrTextContext {
public:
struct Options {
/**
@@ -42,7 +42,7 @@ public:
bool fDistanceFieldVerticesAlwaysHaveW = false;
};
- static std::unique_ptr<GrAtlasTextContext> Make(const Options& options);
+ static std::unique_ptr<GrTextContext> Make(const Options& options);
void drawText(GrContext*, GrTextUtils::Target*, const GrClip&, const SkPaint&,
const SkMatrix& viewMatrix, const SkSurfaceProps&, const char text[],
@@ -55,7 +55,7 @@ public:
const SkMatrix& viewMatrix, const SkSurfaceProps&, const SkTextBlob*,
SkScalar x, SkScalar y, SkDrawFilter*, const SkIRect& clipBounds);
- std::unique_ptr<GrDrawOp> createOp_TestingOnly(GrContext*, GrAtlasTextContext*,
+ std::unique_ptr<GrDrawOp> createOp_TestingOnly(GrContext*, GrTextContext*,
GrRenderTargetContext*, const SkPaint&,
const SkMatrix& viewMatrix, const char* text,
int x, int y);
@@ -73,7 +73,7 @@ public:
SkScalerContextFlags* flags);
private:
- GrAtlasTextContext(const Options& options);
+ GrTextContext(const Options& options);
class FallbackTextHelper {
public: