diff --git a/src/core/SkConvolver.cpp b/src/core/SkConvolver.cpp index 7666e6fadc..e26c8e79e6 100644 --- a/src/core/SkConvolver.cpp +++ b/src/core/SkConvolver.cpp @@ -294,8 +294,10 @@ void SkConvolutionFilter1D::AddFilter(int filterOffset, filterLength = lastNonZero + 1 - firstNonZero; SkASSERT(filterLength > 0); + // Calling fFilterValues.reset(), or push_back() in a loop, are expensive. + fFilterValues.resize_back(filterLength); for (int i = firstNonZero; i <= lastNonZero; i++) { - fFilterValues.push_back(filterValues[i]); + fFilterValues[i - firstNonZero] = filterValues[i]; } } else { // Here all the factors were zeroes.