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

Side by Side Diff: src/effects/SkMagnifierImageFilter.cpp

Issue 227433009: Rename kPMColor_SkColorType to kN32_SkColorType. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase 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/effects/SkLightingImageFilter.cpp ('k') | src/effects/SkMatrixConvolutionImageFilter.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 /* 1 /*
2 * Copyright 2012 The Android Open Source Project 2 * Copyright 2012 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkBitmap.h" 8 #include "SkBitmap.h"
9 #include "SkMagnifierImageFilter.h" 9 #include "SkMagnifierImageFilter.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 buffer.writeScalar(fSrcRect.x()); 275 buffer.writeScalar(fSrcRect.x());
276 buffer.writeScalar(fSrcRect.y()); 276 buffer.writeScalar(fSrcRect.y());
277 buffer.writeScalar(fSrcRect.width()); 277 buffer.writeScalar(fSrcRect.width());
278 buffer.writeScalar(fSrcRect.height()); 278 buffer.writeScalar(fSrcRect.height());
279 buffer.writeScalar(fInset); 279 buffer.writeScalar(fInset);
280 } 280 }
281 281
282 bool SkMagnifierImageFilter::onFilterImage(Proxy*, const SkBitmap& src, 282 bool SkMagnifierImageFilter::onFilterImage(Proxy*, const SkBitmap& src,
283 const Context&, SkBitmap* dst, 283 const Context&, SkBitmap* dst,
284 SkIPoint* offset) const { 284 SkIPoint* offset) const {
285 SkASSERT(src.colorType() == kPMColor_SkColorType); 285 SkASSERT(src.colorType() == kN32_SkColorType);
286 SkASSERT(fSrcRect.width() < src.width()); 286 SkASSERT(fSrcRect.width() < src.width());
287 SkASSERT(fSrcRect.height() < src.height()); 287 SkASSERT(fSrcRect.height() < src.height());
288 288
289 if ((src.colorType() != kPMColor_SkColorType) || 289 if ((src.colorType() != kN32_SkColorType) ||
290 (fSrcRect.width() >= src.width()) || 290 (fSrcRect.width() >= src.width()) ||
291 (fSrcRect.height() >= src.height())) { 291 (fSrcRect.height() >= src.height())) {
292 return false; 292 return false;
293 } 293 }
294 294
295 SkAutoLockPixels alp(src); 295 SkAutoLockPixels alp(src);
296 SkASSERT(src.getPixels()); 296 SkASSERT(src.getPixels());
297 if (!src.getPixels() || src.width() <= 0 || src.height() <= 0) { 297 if (!src.getPixels() || src.width() <= 0 || src.height() <= 0) {
298 return false; 298 return false;
299 } 299 }
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 343
344 int x_val = SkPin32(SkScalarFloorToInt(x_interp), 0, width - 1); 344 int x_val = SkPin32(SkScalarFloorToInt(x_interp), 0, width - 1);
345 int y_val = SkPin32(SkScalarFloorToInt(y_interp), 0, height - 1); 345 int y_val = SkPin32(SkScalarFloorToInt(y_interp), 0, height - 1);
346 346
347 *dptr = sptr[y_val * width + x_val]; 347 *dptr = sptr[y_val * width + x_val];
348 dptr++; 348 dptr++;
349 } 349 }
350 } 350 }
351 return true; 351 return true;
352 } 352 }
OLDNEW
« no previous file with comments | « src/effects/SkLightingImageFilter.cpp ('k') | src/effects/SkMatrixConvolutionImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698