Fix range-based for loops which copy the loop variable unnecessarily.

This will allow us to enable the ClangTidy check
performance-for-range-copy.

Change-Id: I11f152ffe458f5f353da8715ffd2fd47cf4e71a7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/306946
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
diff --git a/gm/encode_srgb.cpp b/gm/encode_srgb.cpp
index 0db8dc1..380bb7f 100644
--- a/gm/encode_srgb.cpp
+++ b/gm/encode_srgb.cpp
@@ -129,7 +129,7 @@
         for (SkColorType colorType : colorTypes) {
             for (SkAlphaType alphaType : alphaTypes) {
                 canvas->save();
-                for (sk_sp<SkColorSpace> colorSpace : colorSpaces) {
+                for (const sk_sp<SkColorSpace>& colorSpace : colorSpaces) {
                     make(&bitmap, colorType, alphaType, colorSpace);
                     auto image = SkImage::MakeFromEncoded(encode_data(bitmap, fEncodedFormat));
                     canvas->drawImage(image.get(), 0.0f, 0.0f);