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

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

Issue 110383005: detect if the scaledimagecache returns a purged bitmap (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years 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 | « src/core/SkBitmapProcState.cpp ('k') | src/core/SkScaledImageCache.h » ('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 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
OLDNEW
« no previous file with comments | « src/core/SkBitmapProcState.cpp ('k') | src/core/SkScaledImageCache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698