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

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

Issue 233813004: Revert of 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/SkSpriteBlitter_RGB16.cpp ('k') | src/effects/SkBicubicImageFilter.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 2013 Google Inc. 2 * Copyright 2013 Google Inc.
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 "SkAlphaThresholdFilter.h" 8 #include "SkAlphaThresholdFilter.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkReadBuffer.h" 10 #include "SkReadBuffer.h"
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 void SkAlphaThresholdFilterImpl::flatten(SkWriteBuffer& buffer) const { 299 void SkAlphaThresholdFilterImpl::flatten(SkWriteBuffer& buffer) const {
300 this->INHERITED::flatten(buffer); 300 this->INHERITED::flatten(buffer);
301 buffer.writeScalar(fInnerThreshold); 301 buffer.writeScalar(fInnerThreshold);
302 buffer.writeScalar(fOuterThreshold); 302 buffer.writeScalar(fOuterThreshold);
303 buffer.writeRegion(fRegion); 303 buffer.writeRegion(fRegion);
304 } 304 }
305 305
306 bool SkAlphaThresholdFilterImpl::onFilterImage(Proxy*, const SkBitmap& src, 306 bool SkAlphaThresholdFilterImpl::onFilterImage(Proxy*, const SkBitmap& src,
307 const Context& ctx, SkBitmap* dst , 307 const Context& ctx, SkBitmap* dst ,
308 SkIPoint* offset) const { 308 SkIPoint* offset) const {
309 SkASSERT(src.colorType() == kPMColor_SkColorType); 309 SkASSERT(src.colorType() == kN32_SkColorType);
310 310
311 if (src.colorType() != kPMColor_SkColorType) { 311 if (src.colorType() != kN32_SkColorType) {
312 return false; 312 return false;
313 } 313 }
314 314
315 SkMatrix localInverse; 315 SkMatrix localInverse;
316 if (!ctx.ctm().invert(&localInverse)) { 316 if (!ctx.ctm().invert(&localInverse)) {
317 return false; 317 return false;
318 } 318 }
319 319
320 SkAutoLockPixels alp(src); 320 SkAutoLockPixels alp(src);
321 SkASSERT(src.getPixels()); 321 SkASSERT(src.getPixels());
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 (U8CPU)(SkColorGetG(source) * scale), 358 (U8CPU)(SkColorGetG(source) * scale),
359 (U8CPU)(SkColorGetB(source) * scale)); 359 (U8CPU)(SkColorGetB(source) * scale));
360 } 360 }
361 } 361 }
362 dptr[y * dst->width() + x] = output_color; 362 dptr[y * dst->width() + x] = output_color;
363 } 363 }
364 } 364 }
365 365
366 return true; 366 return true;
367 } 367 }
OLDNEW
« no previous file with comments | « src/core/SkSpriteBlitter_RGB16.cpp ('k') | src/effects/SkBicubicImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698