OLD | NEW |
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 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 return false; | 294 return false; |
295 } | 295 } |
296 | 296 |
297 BGRAConvolve2D(sourceSubset, static_cast<int>(source.rowBytes()), | 297 BGRAConvolve2D(sourceSubset, static_cast<int>(source.rowBytes()), |
298 !source.isOpaque(), filter.xFilter(), filter.yFilter(), | 298 !source.isOpaque(), filter.xFilter(), filter.yFilter(), |
299 static_cast<int>(result.rowBytes()), | 299 static_cast<int>(result.rowBytes()), |
300 static_cast<unsigned char*>(result.getPixels()), | 300 static_cast<unsigned char*>(result.getPixels()), |
301 convolveProcs, true); | 301 convolveProcs, true); |
302 | 302 |
303 *resultPtr = result; | 303 *resultPtr = result; |
| 304 resultPtr->lockPixels(); |
| 305 SkASSERT(NULL != resultPtr->getPixels()); |
304 return true; | 306 return true; |
305 } | 307 } |
306 | 308 |
307 // static | 309 // static |
308 bool SkBitmapScaler::Resize(SkBitmap* resultPtr, | 310 bool SkBitmapScaler::Resize(SkBitmap* resultPtr, |
309 const SkBitmap& source, | 311 const SkBitmap& source, |
310 ResizeMethod method, | 312 ResizeMethod method, |
311 int destWidth, int destHeight, | 313 int destWidth, int destHeight, |
312 const SkConvolutionProcs& convolveProcs, | 314 const SkConvolutionProcs& convolveProcs, |
313 SkBitmap::Allocator* allocator) { | 315 SkBitmap::Allocator* allocator) { |
314 SkIRect destSubset = { 0, 0, destWidth, destHeight }; | 316 SkIRect destSubset = { 0, 0, destWidth, destHeight }; |
315 return Resize(resultPtr, source, method, destWidth, destHeight, destSubset, | 317 return Resize(resultPtr, source, method, destWidth, destHeight, destSubset, |
316 convolveProcs, allocator); | 318 convolveProcs, allocator); |
317 } | 319 } |
OLD | NEW |