Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(193)

Side by Side Diff: src/core/SkBitmapScaler.cpp

Issue 163663002: Allowing Lanczos3 to be used in chromium (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update to ToT Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « expectations/gm/ignored-tests.txt ('k') | src/effects/SkBitmapSource.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #include "SkBitmapScaler.h" 1 #include "SkBitmapScaler.h"
2 #include "SkBitmapFilter.h" 2 #include "SkBitmapFilter.h"
3 #include "SkRect.h" 3 #include "SkRect.h"
4 #include "SkTArray.h" 4 #include "SkTArray.h"
5 #include "SkErrorInternals.h" 5 #include "SkErrorInternals.h"
6 #include "SkConvolver.h" 6 #include "SkConvolver.h"
7 7
8 // SkResizeFilter -------------------------------------------------------------- -- 8 // SkResizeFilter -------------------------------------------------------------- --
9 9
10 // Encapsulates computation and storage of the filters required for one complete 10 // Encapsulates computation and storage of the filters required for one complete
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 return SkBitmapScaler::RESIZE_TRIANGLE; 221 return SkBitmapScaler::RESIZE_TRIANGLE;
222 // Users of RESIZE_BETTER are willing to trade some quality in order 222 // Users of RESIZE_BETTER are willing to trade some quality in order
223 // to improve performance, but are guaranteed not to devolve to a linear 223 // to improve performance, but are guaranteed not to devolve to a linear
224 // resampling. In visual tests we see that Hamming-1 is not as good as 224 // resampling. In visual tests we see that Hamming-1 is not as good as
225 // Lanczos-2, however it is about 40% faster and Lanczos-2 itself is 225 // Lanczos-2, however it is about 40% faster and Lanczos-2 itself is
226 // about 30% faster than Lanczos-3. The use of Hamming-1 has been deemed 226 // about 30% faster than Lanczos-3. The use of Hamming-1 has been deemed
227 // an acceptable trade-off between quality and speed. 227 // an acceptable trade-off between quality and speed.
228 case SkBitmapScaler::RESIZE_BETTER: 228 case SkBitmapScaler::RESIZE_BETTER:
229 return SkBitmapScaler::RESIZE_HAMMING; 229 return SkBitmapScaler::RESIZE_HAMMING;
230 default: 230 default:
231 #ifdef SK_HIGH_QUALITY_IS_LANCZOS
232 return SkBitmapScaler::RESIZE_LANCZOS3;
233 #else
231 return SkBitmapScaler::RESIZE_MITCHELL; 234 return SkBitmapScaler::RESIZE_MITCHELL;
235 #endif
232 } 236 }
233 } 237 }
234 238
235 // static 239 // static
236 bool SkBitmapScaler::Resize(SkBitmap* resultPtr, 240 bool SkBitmapScaler::Resize(SkBitmap* resultPtr,
237 const SkBitmap& source, 241 const SkBitmap& source,
238 ResizeMethod method, 242 ResizeMethod method,
239 int destWidth, int destHeight, 243 int destWidth, int destHeight,
240 const SkIRect& destSubset, 244 const SkIRect& destSubset,
241 const SkConvolutionProcs& convolveProcs, 245 const SkConvolutionProcs& convolveProcs,
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 bool SkBitmapScaler::Resize(SkBitmap* resultPtr, 314 bool SkBitmapScaler::Resize(SkBitmap* resultPtr,
311 const SkBitmap& source, 315 const SkBitmap& source,
312 ResizeMethod method, 316 ResizeMethod method,
313 int destWidth, int destHeight, 317 int destWidth, int destHeight,
314 const SkConvolutionProcs& convolveProcs, 318 const SkConvolutionProcs& convolveProcs,
315 SkBitmap::Allocator* allocator) { 319 SkBitmap::Allocator* allocator) {
316 SkIRect destSubset = { 0, 0, destWidth, destHeight }; 320 SkIRect destSubset = { 0, 0, destWidth, destHeight };
317 return Resize(resultPtr, source, method, destWidth, destHeight, destSubset, 321 return Resize(resultPtr, source, method, destWidth, destHeight, destSubset,
318 convolveProcs, allocator); 322 convolveProcs, allocator);
319 } 323 }
OLDNEW
« no previous file with comments | « expectations/gm/ignored-tests.txt ('k') | src/effects/SkBitmapSource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698