diff --git a/src/gpu/GrUniformDataManager.cpp b/src/gpu/GrUniformDataManager.cpp index 4d42826694..5c49193d6e 100644 --- a/src/gpu/GrUniformDataManager.cpp +++ b/src/gpu/GrUniformDataManager.cpp @@ -76,10 +76,6 @@ int GrUniformDataManager::copyUniforms(void* dest, return 4; } -static void* advance_buffer(void* buffer, int numUniforms, int uniformSize) { - return static_cast(buffer) + (uniformSize * numUniforms); -} - template void GrUniformDataManager::set(UniformHandle u, const void* v) const { const Uniform& uni = fUniforms[u.toIndex()]; @@ -103,7 +99,7 @@ void GrUniformDataManager::setv(UniformHandle u, int arrayCount, const void* v) } else { for (int i = 0; i < arrayCount; ++i) { int uniformSize = this->copyUniforms(buffer, v, N, uni.fType); - buffer = advance_buffer(buffer, /*numUniforms=*/4, uniformSize); + buffer = SkTAddOffset(buffer, /*numUniforms*/4 * uniformSize); v = static_cast(v) + N * 4; } } @@ -248,7 +244,7 @@ inline void GrUniformDataManager::setMatrices(UniformHandle u, const float* matrix = &matrices[N * N * i]; for (int j = 0; j < N; ++j) { int uniformSize = this->copyUniforms(buffer, &matrix[j * N], N, uni.fType); - buffer = advance_buffer(buffer, /*numUniforms=*/4, uniformSize); + buffer = SkTAddOffset(buffer, /*numUniforms*/4 * uniformSize); } } }