From b5502b20129a71c6bdb937792f940b7581dbb5ec Mon Sep 17 00:00:00 2001 From: Kevin Lubick Date: Mon, 12 Mar 2018 10:17:06 -0400 Subject: [PATCH] Small cleanups suggested by ClangTidy Bug: skia: Cq-Include-Trybots: skia.primary:Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-SKNX_NO_SIMD Change-Id: Idd95e359838fdaecbdccc3a2c5a1b36971f20b8b Reviewed-on: https://skia-review.googlesource.com/113703 Reviewed-by: Mike Klein Commit-Queue: Kevin Lubick --- src/core/SkDeferredDisplayListRecorder.cpp | 2 +- src/gpu/GrContextPriv.h | 2 +- src/gpu/GrDDLContext.cpp | 2 +- src/gpu/GrProxyProvider.h | 2 +- src/gpu/ops/GrSmallPathRenderer.cpp | 2 +- src/opts/SkRasterPipeline_opts.h | 12 ++++++------ tests/DrawOpAtlasTest.cpp | 4 ++-- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/core/SkDeferredDisplayListRecorder.cpp b/src/core/SkDeferredDisplayListRecorder.cpp index aa7a1e1572..78bd35f493 100644 --- a/src/core/SkDeferredDisplayListRecorder.cpp +++ b/src/core/SkDeferredDisplayListRecorder.cpp @@ -173,7 +173,7 @@ sk_sp SkDeferredDisplayListRecorder::makePromiseTexture( origin, colorType, alphaType, - colorSpace, + std::move(colorSpace), textureFulfillProc, textureReleaseProc, textureContext); diff --git a/src/gpu/GrContextPriv.h b/src/gpu/GrContextPriv.h index 745397658c..f7bd911b1e 100644 --- a/src/gpu/GrContextPriv.h +++ b/src/gpu/GrContextPriv.h @@ -28,7 +28,7 @@ public: /** * Create a GrContext without a resource cache */ - static sk_sp MakeDDL(sk_sp); + static sk_sp MakeDDL(const sk_sp&); GrDrawingManager* drawingManager() { return fContext->fDrawingManager.get(); } diff --git a/src/gpu/GrDDLContext.cpp b/src/gpu/GrDDLContext.cpp index eba0379aa8..9a91ab8526 100644 --- a/src/gpu/GrDDLContext.cpp +++ b/src/gpu/GrDDLContext.cpp @@ -61,7 +61,7 @@ private: typedef GrContext INHERITED; }; -sk_sp GrContextPriv::MakeDDL(sk_sp proxy) { +sk_sp GrContextPriv::MakeDDL(const sk_sp& proxy) { sk_sp context(new GrDDLContext(proxy)); // Note: we aren't creating a Gpu here. This causes the resource provider & cache to diff --git a/src/gpu/GrProxyProvider.h b/src/gpu/GrProxyProvider.h index 45a3c1a1b7..e1ddf5c1f6 100644 --- a/src/gpu/GrProxyProvider.h +++ b/src/gpu/GrProxyProvider.h @@ -140,7 +140,7 @@ public: /* * Create a render target proxy that wraps a backend texture */ - sk_sp wrapBackendTextureAsRenderTarget(const GrBackendTexture& tex, + sk_sp wrapBackendTextureAsRenderTarget(const GrBackendTexture& backendTex, GrSurfaceOrigin origin, int sampleCnt); diff --git a/src/gpu/ops/GrSmallPathRenderer.cpp b/src/gpu/ops/GrSmallPathRenderer.cpp index 94204c8f74..f8c21095d0 100644 --- a/src/gpu/ops/GrSmallPathRenderer.cpp +++ b/src/gpu/ops/GrSmallPathRenderer.cpp @@ -123,7 +123,7 @@ public: return data.fKey; } - static inline uint32_t Hash(ShapeDataKey key) { + static inline uint32_t Hash(const ShapeDataKey& key) { return SkOpts::hash(key.data(), sizeof(uint32_t) * key.count32()); } }; diff --git a/src/opts/SkRasterPipeline_opts.h b/src/opts/SkRasterPipeline_opts.h index 56c8fa11d7..212a5d16aa 100644 --- a/src/opts/SkRasterPipeline_opts.h +++ b/src/opts/SkRasterPipeline_opts.h @@ -2828,21 +2828,21 @@ SI void store(T* ptr, size_t tail, V v) { } template<> - F gather(const float* p, U32 ix) { + F gather(const float* ptr, U32 ix) { __m256i lo, hi; split(ix, &lo, &hi); - return join(_mm256_i32gather_ps(p, lo, 4), - _mm256_i32gather_ps(p, hi, 4)); + return join(_mm256_i32gather_ps(ptr, lo, 4), + _mm256_i32gather_ps(ptr, hi, 4)); } template<> - U32 gather(const uint32_t* p, U32 ix) { + U32 gather(const uint32_t* ptr, U32 ix) { __m256i lo, hi; split(ix, &lo, &hi); - return join(_mm256_i32gather_epi32(p, lo, 4), - _mm256_i32gather_epi32(p, hi, 4)); + return join(_mm256_i32gather_epi32(ptr, lo, 4), + _mm256_i32gather_epi32(ptr, hi, 4)); } #else template diff --git a/tests/DrawOpAtlasTest.cpp b/tests/DrawOpAtlasTest.cpp index e45ef525a1..ef219d9412 100644 --- a/tests/DrawOpAtlasTest.cpp +++ b/tests/DrawOpAtlasTest.cpp @@ -28,10 +28,10 @@ int GrDrawOpAtlas::numAllocated_TestingOnly() const { return count; } -void GrAtlasManager::setMaxPages_TestingOnly(uint32_t numPages) { +void GrAtlasManager::setMaxPages_TestingOnly(uint32_t maxPages) { for (int i = 0; i < kMaskFormatCount; i++) { if (fAtlases[i]) { - fAtlases[i]->setMaxPages_TestingOnly(numPages); + fAtlases[i]->setMaxPages_TestingOnly(maxPages); } } }