hoist origin translation out of the run loop
Change-Id: If5da3dd75b2632a688081fce7517d08a979a3f05
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/376850
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/ops/GrAtlasTextOp.cpp b/src/gpu/ops/GrAtlasTextOp.cpp
index 14f2ccb..5e3c6c1 100644
--- a/src/gpu/ops/GrAtlasTextOp.cpp
+++ b/src/gpu/ops/GrAtlasTextOp.cpp
@@ -471,8 +471,8 @@
int y) {
size_t textLen = (int)strlen(text);
- const SkMatrix& drawMatrix(mtxProvider.localToDevice());
-
+ SkMatrix drawMatrix(mtxProvider.localToDevice());
+ drawMatrix.preTranslate(x, y);
auto drawOrigin = SkPoint::Make(x, y);
SkGlyphRunBuilder builder;
builder.drawTextUTF8(skPaint, font, text, textLen, drawOrigin);
@@ -489,7 +489,7 @@
SkGlyphRunListPainter* painter = rtc->glyphRunPainter();
painter->processGlyphRun(
*glyphRunList.begin(),
- drawMatrix, glyphRunList.origin(),
+ drawMatrix,
glyphRunList.paint(),
rtc->surfaceProps(),
rContext->priv().caps()->shaderCaps()->supportsDistanceFieldText(),