aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHerb Derby <herb@google.com>2018-10-25 16:25:09 -0400
committerSkia Commit-Bot <skia-commit-bot@chromium.org>2018-10-25 21:12:58 +0000
commit93d73d98e1e3e898faea1782d1f36f35b548d982 (patch)
tree7515cc2f96a528a07660091a22d1407df9fc0811 /src
parent71f5a0b56d388844193a1c95feae759b68422b8c (diff)
downloadskqp-93d73d98e1e3e898faea1782d1f36f35b548d982.tar.gz
Move perX closures into loops
Change-Id: Ic92efd4184442f80b3169df4911b33cf31d446f3 Reviewed-on: https://skia-review.googlesource.com/c/165180 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Herb Derby <herb@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/core/SkGlyphRunPainter.cpp8
-rw-r--r--src/core/SkGlyphRunPainter.h18
2 files changed, 15 insertions, 11 deletions
diff --git a/src/core/SkGlyphRunPainter.cpp b/src/core/SkGlyphRunPainter.cpp
index 61637537e8..ecab64306f 100644
--- a/src/core/SkGlyphRunPainter.cpp
+++ b/src/core/SkGlyphRunPainter.cpp
@@ -560,7 +560,7 @@ void GrTextContext::regenerateGlyphRunList(GrTextBlob* cacheBlob,
glyphPainter->drawGlyphRunAsSDFWithARGBFallback(
cache.get(), glyphRun, origin, viewMatrix, textRatio,
- perSDF, perPath, argbFallback);
+ std::move(perSDF), std::move(perPath), std::move(argbFallback));
}
} else if (SkDraw::ShouldDrawTextAsPaths(runPaint, viewMatrix)) {
@@ -592,7 +592,8 @@ void GrTextContext::regenerateGlyphRunList(GrTextBlob* cacheBlob,
glyphCache, filteredColor};
glyphPainter->drawGlyphRunAsPathWithARGBFallback(
- pathCache.get(), glyphRun, origin, viewMatrix, textScale, perPath, argbFallback);
+ pathCache.get(), glyphRun, origin, viewMatrix, textScale,
+ std::move(perPath), std::move(argbFallback));
} else {
// Ensure the blob is set for bitmaptext
cacheBlob->setHasBitmap();
@@ -630,7 +631,8 @@ void GrTextContext::regenerateGlyphRunList(GrTextBlob* cacheBlob,
};
glyphPainter->drawGlyphRunAsBMPWithPathFallback(
- cache.get(), glyphRun, origin, viewMatrix, perGlyph, perPath);
+ cache.get(), glyphRun, origin, viewMatrix,
+ std::move(perGlyph), std::move(perPath));
}
runIndex += 1;
}
diff --git a/src/core/SkGlyphRunPainter.h b/src/core/SkGlyphRunPainter.h
index a2e2586732..2a6327bbe3 100644
--- a/src/core/SkGlyphRunPainter.h
+++ b/src/core/SkGlyphRunPainter.h
@@ -44,7 +44,7 @@ public:
void drawGlyphRunAsBMPWithPathFallback(
SkGlyphCacheInterface* cache, const SkGlyphRun& glyphRun,
SkPoint origin, const SkMatrix& deviceMatrix,
- PerGlyphT perGlyph, PerPathT perPath);
+ PerGlyphT&& perGlyph, PerPathT&& perPath);
enum NeedsTransform : bool { kTransformDone = false, kDoTransform = true };
@@ -66,13 +66,13 @@ public:
void drawGlyphRunAsPathWithARGBFallback(
SkGlyphCacheInterface* cache, const SkGlyphRun& glyphRun,
SkPoint origin, const SkMatrix& viewMatrix, SkScalar textScale,
- PerPath perPath, ARGBFallback fallbackARGB);
+ PerPath&& perPath, ARGBFallback&& fallbackARGB);
template <typename PerSDFT, typename PerPathT>
void drawGlyphRunAsSDFWithARGBFallback(
SkGlyphCacheInterface* cache, const SkGlyphRun& glyphRun,
SkPoint origin, const SkMatrix& viewMatrix, SkScalar textRatio,
- PerSDFT perSDF, PerPathT perPath, ARGBFallback perFallback);
+ PerSDFT&& perSDF, PerPathT&& perPath, ARGBFallback&& perFallback);
private:
static bool ShouldDrawAsPath(const SkPaint& paint, const SkMatrix& matrix);
@@ -135,7 +135,7 @@ template <typename PerPathT>
void SkGlyphRunListPainter::drawGlyphRunAsPathWithARGBFallback(
SkGlyphCacheInterface* pathCache, const SkGlyphRun& glyphRun,
SkPoint origin, const SkMatrix& viewMatrix, SkScalar textScale,
- PerPathT perPath, ARGBFallback argbFallback) {
+ PerPathT&& perPath, ARGBFallback&& argbFallback) {
fARGBGlyphsIDs.clear();
fARGBPositions.clear();
SkScalar maxFallbackDimension{-SK_ScalarInfinity};
@@ -158,7 +158,8 @@ void SkGlyphRunListPainter::drawGlyphRunAsPathWithARGBFallback(
if (!fARGBGlyphsIDs.empty()) {
this->processARGBFallback(
- maxFallbackDimension, glyphRun.paint(), origin, viewMatrix, textScale, argbFallback);
+ maxFallbackDimension, glyphRun.paint(), origin, viewMatrix, textScale,
+ std::move(argbFallback));
}
}
@@ -167,7 +168,7 @@ template <typename PerGlyphT, typename PerPathT>
void SkGlyphRunListPainter::drawGlyphRunAsBMPWithPathFallback(
SkGlyphCacheInterface* cache, const SkGlyphRun& glyphRun,
SkPoint origin, const SkMatrix& deviceMatrix,
- PerGlyphT perGlyph, PerPathT perPath) {
+ PerGlyphT&& perGlyph, PerPathT&& perPath) {
SkMatrix mapping = deviceMatrix;
mapping.preTranslate(origin.x(), origin.y());
@@ -204,7 +205,7 @@ template <typename PerSDFT, typename PerPathT>
void SkGlyphRunListPainter::drawGlyphRunAsSDFWithARGBFallback(
SkGlyphCacheInterface* cache, const SkGlyphRun& glyphRun,
SkPoint origin, const SkMatrix& viewMatrix, SkScalar textScale,
- PerSDFT perSDF, PerPathT perPath, ARGBFallback argbFallback) {
+ PerSDFT&& perSDF, PerPathT&& perPath, ARGBFallback&& argbFallback) {
fARGBGlyphsIDs.clear();
fARGBPositions.clear();
SkScalar maxFallbackDimension{-SK_ScalarInfinity};
@@ -229,7 +230,8 @@ void SkGlyphRunListPainter::drawGlyphRunAsSDFWithARGBFallback(
if (!fARGBGlyphsIDs.empty()) {
this->processARGBFallback(
- maxFallbackDimension, glyphRun.paint(), origin, viewMatrix, textScale, argbFallback);
+ maxFallbackDimension, glyphRun.paint(), origin, viewMatrix, textScale,
+ std::move(argbFallback));
}
}