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

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

Issue 19569012: Turn on -Wall -Wextra on Mac, and fix all the warnings that crop up for /usr/bin/g++ and Clang 3.3. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: nit Created 7 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « gyp/common_conditions.gypi ('k') | src/core/SkPicture.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 27 matching lines...) Expand all
38 // 38 //
39 // Likewise, the range of destination values to compute and the scale factor 39 // Likewise, the range of destination values to compute and the scale factor
40 // for the transform is also specified. 40 // for the transform is also specified.
41 41
42 void computeFilters(int srcSize, 42 void computeFilters(int srcSize,
43 int destSubsetLo, int destSubsetSize, 43 int destSubsetLo, int destSubsetSize,
44 float scale, 44 float scale,
45 SkConvolutionFilter1D* output, 45 SkConvolutionFilter1D* output,
46 SkConvolutionProcs* convolveProcs); 46 SkConvolutionProcs* convolveProcs);
47 47
48 // Subset of scaled destination bitmap to compute.
49 SkIRect fOutBounds;
50
51 SkConvolutionFilter1D fXFilter; 48 SkConvolutionFilter1D fXFilter;
52 SkConvolutionFilter1D fYFilter; 49 SkConvolutionFilter1D fYFilter;
53 }; 50 };
54 51
55 SkResizeFilter::SkResizeFilter(SkBitmapScaler::ResizeMethod method, 52 SkResizeFilter::SkResizeFilter(SkBitmapScaler::ResizeMethod method,
56 int srcFullWidth, int srcFullHeight, 53 int srcFullWidth, int srcFullHeight,
57 int destWidth, int destHeight, 54 int destWidth, int destHeight,
58 const SkIRect& destSubset, 55 const SkIRect& destSubset,
59 SkConvolutionProcs* convolveProcs) 56 SkConvolutionProcs* convolveProcs) {
60 : fOutBounds(destSubset) {
61 57
62 // method will only ever refer to an "algorithm method". 58 // method will only ever refer to an "algorithm method".
63 SkASSERT((SkBitmapScaler::RESIZE_FIRST_ALGORITHM_METHOD <= method) && 59 SkASSERT((SkBitmapScaler::RESIZE_FIRST_ALGORITHM_METHOD <= method) &&
64 (method <= SkBitmapScaler::RESIZE_LAST_ALGORITHM_METHOD)); 60 (method <= SkBitmapScaler::RESIZE_LAST_ALGORITHM_METHOD));
65 61
66 switch(method) { 62 switch(method) {
67 case SkBitmapScaler::RESIZE_BOX: 63 case SkBitmapScaler::RESIZE_BOX:
68 fBitmapFilter = SkNEW(SkBoxFilter); 64 fBitmapFilter = SkNEW(SkBoxFilter);
69 break; 65 break;
70 case SkBitmapScaler::RESIZE_TRIANGLE: 66 case SkBitmapScaler::RESIZE_TRIANGLE:
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 // static 302 // static
307 SkBitmap SkBitmapScaler::Resize(const SkBitmap& source, 303 SkBitmap SkBitmapScaler::Resize(const SkBitmap& source,
308 ResizeMethod method, 304 ResizeMethod method,
309 int destWidth, int destHeight, 305 int destWidth, int destHeight,
310 SkConvolutionProcs* convolveProcs, 306 SkConvolutionProcs* convolveProcs,
311 SkBitmap::Allocator* allocator) { 307 SkBitmap::Allocator* allocator) {
312 SkIRect destSubset = { 0, 0, destWidth, destHeight }; 308 SkIRect destSubset = { 0, 0, destWidth, destHeight };
313 return Resize(source, method, destWidth, destHeight, destSubset, 309 return Resize(source, method, destWidth, destHeight, destSubset,
314 convolveProcs, allocator); 310 convolveProcs, allocator);
315 } 311 }
OLDNEW
« no previous file with comments | « gyp/common_conditions.gypi ('k') | src/core/SkPicture.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698