More viewMatrix renaming
Change-Id: I9e6ecab124da0c03f31968270b2df79e3cd129d4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/259979
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
diff --git a/src/core/SkGlyphRunPainter.cpp b/src/core/SkGlyphRunPainter.cpp
index b20a9de..f6e0823 100644
--- a/src/core/SkGlyphRunPainter.cpp
+++ b/src/core/SkGlyphRunPainter.cpp
@@ -135,7 +135,7 @@
#if SK_SUPPORT_GPU
void SkGlyphRunListPainter::processGlyphRunList(const SkGlyphRunList& glyphRunList,
- const SkMatrix& viewMatrix,
+ const SkMatrix& drawMatrix,
const SkSurfaceProps& props,
bool contextSupportsDistanceFieldText,
const GrTextContext::Options& options,
@@ -151,17 +151,17 @@
bool useSDFT = GrTextContext::CanDrawAsDistanceFields(
- runPaint, runFont, viewMatrix, props, contextSupportsDistanceFieldText, options);
+ runPaint, runFont, drawMatrix, props, contextSupportsDistanceFieldText, options);
bool usePaths =
- useSDFT ? false : SkStrikeSpec::ShouldDrawAsPath(runPaint, runFont, viewMatrix);
+ useSDFT ? false : SkStrikeSpec::ShouldDrawAsPath(runPaint, runFont, drawMatrix);
if (useSDFT) {
// Process SDFT - This should be the .009% case.
SkScalar minScale, maxScale;
SkStrikeSpec strikeSpec;
std::tie(strikeSpec, minScale, maxScale) =
- SkStrikeSpec::MakeSDFT(runFont, runPaint, fDeviceProps, viewMatrix, options);
+ SkStrikeSpec::MakeSDFT(runFont, runPaint, fDeviceProps, drawMatrix, options);
if (!strikeSpec.isEmpty()) {
SkScopedStrikeForGPU strike = strikeSpec.findOrCreateScopedStrike(fStrikeCache);
@@ -183,11 +183,11 @@
// Process masks including ARGB - this should be the 99.99% case.
SkStrikeSpec strikeSpec = SkStrikeSpec::MakeMask(
- runFont, runPaint, fDeviceProps, fScalerContextFlags, viewMatrix);
+ runFont, runPaint, fDeviceProps, fScalerContextFlags, drawMatrix);
SkScopedStrikeForGPU strike = strikeSpec.findOrCreateScopedStrike(fStrikeCache);
- fDrawable.startDevice(fRejects.source(), origin, viewMatrix, strike->roundingSpec());
+ fDrawable.startDevice(fRejects.source(), origin, drawMatrix, strike->roundingSpec());
strike->prepareForMaskDrawing(&fDrawable, &fRejects);
fRejects.flipRejectsToSource();
@@ -272,7 +272,7 @@
void GrTextContext::drawGlyphRunList(
GrRecordingContext* context, GrTextTarget* target, const GrClip& clip,
- const SkMatrix& viewMatrix, const SkSurfaceProps& props,
+ const SkMatrix& drawMatrix, const SkSurfaceProps& props,
const SkGlyphRunList& glyphRunList) {
auto contextPriv = context->priv();
// If we have been abandoned, then don't draw
@@ -322,35 +322,35 @@
SkGlyphRunListPainter* painter = target->glyphPainter();
if (cachedBlob) {
if (cachedBlob->mustRegenerate(blobPaint, glyphRunList.anyRunsSubpixelPositioned(),
- blurRec, viewMatrix, origin.x(), origin.y())) {
+ blurRec, drawMatrix, origin.x(), origin.y())) {
// We have to remake the blob because changes may invalidate our masks.
// 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
textBlobCache->remove(cachedBlob.get());
cachedBlob = textBlobCache->makeCachedBlob(
- glyphRunList, grStrikeCache, key, blurRec, viewMatrix,
+ glyphRunList, grStrikeCache, key, blurRec, drawMatrix,
initialVertexColor, forceW);
painter->processGlyphRunList(
- glyphRunList, viewMatrix, props, supportsSDFT, fOptions, cachedBlob.get());
+ glyphRunList, drawMatrix, props, supportsSDFT, fOptions, cachedBlob.get());
} else {
textBlobCache->makeMRU(cachedBlob.get());
}
} else {
if (canCache) {
cachedBlob = textBlobCache->makeCachedBlob(
- glyphRunList, grStrikeCache, key, blurRec, viewMatrix,
+ glyphRunList, grStrikeCache, key, blurRec, drawMatrix,
initialVertexColor, forceW);
} else {
cachedBlob = textBlobCache->makeBlob(
- glyphRunList, grStrikeCache, viewMatrix, initialVertexColor, forceW);
+ glyphRunList, grStrikeCache, drawMatrix, initialVertexColor, forceW);
}
painter->processGlyphRunList(
- glyphRunList, viewMatrix, props, supportsSDFT, fOptions, cachedBlob.get());
+ glyphRunList, drawMatrix, props, supportsSDFT, fOptions, cachedBlob.get());
}
cachedBlob->flush(target, props, fDistanceAdjustTable.get(), blobPaint, drawingColor,
- clip, viewMatrix, origin.x(), origin.y());
+ clip, drawMatrix, origin.x(), origin.y());
}
#if GR_TEST_UTILS
@@ -363,7 +363,7 @@
GrRenderTargetContext* rtc,
const SkPaint& skPaint,
const SkFont& font,
- const SkMatrix& viewMatrix,
+ const SkMatrix& drawMatrix,
const char* text,
int x,
int y) {
@@ -389,14 +389,15 @@
sk_sp<GrTextBlob> blob;
if (!glyphRunList.empty()) {
blob = direct->priv().getTextBlobCache()->makeBlob(
- glyphRunList, strikeCache, viewMatrix, color, false);
+ glyphRunList, strikeCache, drawMatrix, color, false);
SkGlyphRunListPainter* painter = rtc->textTarget()->glyphPainter();
- painter->processGlyphRunList(glyphRunList, viewMatrix, surfaceProps,
+ painter->processGlyphRunList(
+ glyphRunList, drawMatrix, surfaceProps,
context->priv().caps()->shaderCaps()->supportsDistanceFieldText(),
textContext->fOptions, blob.get());
}
- return blob->test_makeOp(textLen, viewMatrix, x, y, skPaint, filteredColor, surfaceProps,
+ return blob->test_makeOp(textLen, drawMatrix, x, y, skPaint, filteredColor, surfaceProps,
textContext->dfAdjustTable(), rtc->textTarget());
}
@@ -413,7 +414,8 @@
fPainter->fRejects.reset();
}
-SkVector SkGlyphPositionRoundingSpec::HalfAxisSampleFreq(bool isSubpixel, SkAxisAlignment axisAlignment) {
+SkVector SkGlyphPositionRoundingSpec::HalfAxisSampleFreq(
+ bool isSubpixel, SkAxisAlignment axisAlignment) {
if (!isSubpixel) {
return {SK_ScalarHalf, SK_ScalarHalf};
} else {
diff --git a/src/core/SkGlyphRunPainter.h b/src/core/SkGlyphRunPainter.h
index b2d50ab..6b64566 100644
--- a/src/core/SkGlyphRunPainter.h
+++ b/src/core/SkGlyphRunPainter.h
@@ -83,7 +83,7 @@
// A nullptr for process means that the calls to the cache will be performed, but none of the
// callbacks will be called.
void processGlyphRunList(const SkGlyphRunList& glyphRunList,
- const SkMatrix& viewMatrix,
+ const SkMatrix& drawMatrix,
const SkSurfaceProps& props,
bool contextSupportsDistanceFieldText,
const GrTextContext::Options& options,
diff --git a/src/gpu/text/GrTextContext.h b/src/gpu/text/GrTextContext.h
index 1b6a049..b4640af 100644
--- a/src/gpu/text/GrTextContext.h
+++ b/src/gpu/text/GrTextContext.h
@@ -46,13 +46,13 @@
static std::unique_ptr<GrTextContext> Make(const Options& options);
void drawGlyphRunList(GrRecordingContext*, GrTextTarget*, const GrClip&,
- const SkMatrix& viewMatrix, const SkSurfaceProps&, const SkGlyphRunList&);
+ const SkMatrix& drawMatrix, const SkSurfaceProps&, const SkGlyphRunList&);
std::unique_ptr<GrDrawOp> createOp_TestingOnly(GrRecordingContext*,
GrTextContext*,
GrRenderTargetContext*,
const SkPaint&, const SkFont&,
- const SkMatrix& viewMatrix,
+ const SkMatrix& drawMatrix,
const char* text,
int x,
int y);