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/src/gpu/ccpr/GrCCPathCache.cpp b/src/gpu/ccpr/GrCCPathCache.cpp
index b1037bb..cb86b55 100644
--- a/src/gpu/ccpr/GrCCPathCache.cpp
+++ b/src/gpu/ccpr/GrCCPathCache.cpp
@@ -106,7 +106,7 @@
 
     // Now take all the atlas textures we just invalidated and purge them from the GrResourceCache.
     // We just purge via message bus since we don't have any access to the resource cache right now.
-    for (sk_sp<GrTextureProxy>& proxy : fInvalidatedProxies) {
+    for (const sk_sp<GrTextureProxy>& proxy : fInvalidatedProxies) {
         SkMessageBus<GrUniqueKeyInvalidatedMessage>::Post(
                 GrUniqueKeyInvalidatedMessage(proxy->getUniqueKey(), fContextUniqueID));
     }
@@ -295,7 +295,7 @@
 }
 
 void GrCCPathCache::purgeInvalidatedAtlasTextures(GrOnFlushResourceProvider* onFlushRP) {
-    for (sk_sp<GrTextureProxy>& proxy : fInvalidatedProxies) {
+    for (const sk_sp<GrTextureProxy>& proxy : fInvalidatedProxies) {
         onFlushRP->removeUniqueKeyFromProxy(proxy.get());
     }
     fInvalidatedProxies.reset();
@@ -307,7 +307,7 @@
 }
 
 void GrCCPathCache::purgeInvalidatedAtlasTextures(GrProxyProvider* proxyProvider) {
-    for (sk_sp<GrTextureProxy>& proxy : fInvalidatedProxies) {
+    for (const sk_sp<GrTextureProxy>& proxy : fInvalidatedProxies) {
         proxyProvider->removeUniqueKeyFromProxy(proxy.get());
     }
     fInvalidatedProxies.reset();