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

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

Issue 544233002: "NULL !=" = NULL (Closed) Base URL: https://skia.googlesource.com/skia.git@are
Patch Set: rebase Created 6 years, 3 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 | « src/core/SkBitmapProcState.cpp ('k') | src/core/SkBitmap_scroll.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 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 } 308 }
309 309
310 BGRAConvolve2D(sourceSubset, static_cast<int>(source.rowBytes()), 310 BGRAConvolve2D(sourceSubset, static_cast<int>(source.rowBytes()),
311 !source.isOpaque(), filter.xFilter(), filter.yFilter(), 311 !source.isOpaque(), filter.xFilter(), filter.yFilter(),
312 static_cast<int>(result.rowBytes()), 312 static_cast<int>(result.rowBytes()),
313 static_cast<unsigned char*>(result.getPixels()), 313 static_cast<unsigned char*>(result.getPixels()),
314 convolveProcs, true); 314 convolveProcs, true);
315 315
316 *resultPtr = result; 316 *resultPtr = result;
317 resultPtr->lockPixels(); 317 resultPtr->lockPixels();
318 SkASSERT(NULL != resultPtr->getPixels()); 318 SkASSERT(resultPtr->getPixels());
319 return true; 319 return true;
320 } 320 }
321 321
322 // static -- simpler interface to the resizer; returns a default bitmap if scali ng 322 // static -- simpler interface to the resizer; returns a default bitmap if scali ng
323 // fails for any reason. This is the interface that Chrome expects. 323 // fails for any reason. This is the interface that Chrome expects.
324 SkBitmap SkBitmapScaler::Resize(const SkBitmap& source, 324 SkBitmap SkBitmapScaler::Resize(const SkBitmap& source,
325 ResizeMethod method, 325 ResizeMethod method,
326 float destWidth, float destHeight, 326 float destWidth, float destHeight,
327 SkBitmap::Allocator* allocator) { 327 SkBitmap::Allocator* allocator) {
328 SkBitmap result; 328 SkBitmap result;
329 if (!Resize(&result, source, method, destWidth, destHeight, allocator)) { 329 if (!Resize(&result, source, method, destWidth, destHeight, allocator)) {
330 return SkBitmap(); 330 return SkBitmap();
331 } 331 }
332 return result; 332 return result;
333 } 333 }
OLDNEW
« no previous file with comments | « src/core/SkBitmapProcState.cpp ('k') | src/core/SkBitmap_scroll.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698