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

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

Issue 234833003: Revert of Rename kPMColor_SkColorType to kN32_SkColorType. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 8 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/SkBitmapProcShader.cpp ('k') | src/core/SkBlitter.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 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 } 275 }
276 276
277 method = ResizeMethodToAlgorithmMethod(method); 277 method = ResizeMethodToAlgorithmMethod(method);
278 278
279 // Check that we deal with an "algorithm methods" from this point onward. 279 // Check that we deal with an "algorithm methods" from this point onward.
280 SkASSERT((SkBitmapScaler::RESIZE_FIRST_ALGORITHM_METHOD <= method) && 280 SkASSERT((SkBitmapScaler::RESIZE_FIRST_ALGORITHM_METHOD <= method) &&
281 (method <= SkBitmapScaler::RESIZE_LAST_ALGORITHM_METHOD)); 281 (method <= SkBitmapScaler::RESIZE_LAST_ALGORITHM_METHOD));
282 282
283 SkAutoLockPixels locker(source); 283 SkAutoLockPixels locker(source);
284 if (!source.readyToDraw() || 284 if (!source.readyToDraw() ||
285 source.colorType() != kN32_SkColorType) { 285 source.colorType() != kPMColor_SkColorType) {
286 return false; 286 return false;
287 } 287 }
288 288
289 SkResizeFilter filter(method, source.width(), source.height(), 289 SkResizeFilter filter(method, source.width(), source.height(),
290 destWidth, destHeight, destSubset, convolveProcs); 290 destWidth, destHeight, destSubset, convolveProcs);
291 291
292 // Get a source bitmap encompassing this touched area. We construct the 292 // Get a source bitmap encompassing this touched area. We construct the
293 // offsets and row strides such that it looks like a new bitmap, while 293 // offsets and row strides such that it looks like a new bitmap, while
294 // referring to the old data. 294 // referring to the old data.
295 const unsigned char* sourceSubset = 295 const unsigned char* sourceSubset =
(...skipping 25 matching lines...) Expand all
321 bool SkBitmapScaler::Resize(SkBitmap* resultPtr, 321 bool SkBitmapScaler::Resize(SkBitmap* resultPtr,
322 const SkBitmap& source, 322 const SkBitmap& source,
323 ResizeMethod method, 323 ResizeMethod method,
324 int destWidth, int destHeight, 324 int destWidth, int destHeight,
325 const SkConvolutionProcs& convolveProcs, 325 const SkConvolutionProcs& convolveProcs,
326 SkBitmap::Allocator* allocator) { 326 SkBitmap::Allocator* allocator) {
327 SkIRect destSubset = { 0, 0, destWidth, destHeight }; 327 SkIRect destSubset = { 0, 0, destWidth, destHeight };
328 return Resize(resultPtr, source, method, destWidth, destHeight, destSubset, 328 return Resize(resultPtr, source, method, destWidth, destHeight, destSubset,
329 convolveProcs, allocator); 329 convolveProcs, allocator);
330 } 330 }
OLDNEW
« no previous file with comments | « src/core/SkBitmapProcShader.cpp ('k') | src/core/SkBlitter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698