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

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

Issue 1885633003: Revert AlphaThresholdFilter to its old behavior wrt premul (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Revert AlphaThresholdFilter to prior behavior wrt premul Created 4 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 | « no previous file | no next file » | 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 9
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 return nullptr; 405 return nullptr;
406 } 406 }
407 407
408 408
409 SkMatrix localInverse; 409 SkMatrix localInverse;
410 if (!ctx.ctm().invert(&localInverse)) { 410 if (!ctx.ctm().invert(&localInverse)) {
411 return nullptr; 411 return nullptr;
412 } 412 }
413 413
414 SkImageInfo info = SkImageInfo::MakeN32(bounds.width(), bounds.height(), 414 SkImageInfo info = SkImageInfo::MakeN32(bounds.width(), bounds.height(),
415 inputBM.alphaType()); 415 kPremul_SkAlphaType);
416 416
417 SkBitmap dst; 417 SkBitmap dst;
418 if (!dst.tryAllocPixels(info)) { 418 if (!dst.tryAllocPixels(info)) {
419 return nullptr; 419 return nullptr;
420 } 420 }
421 421
422 SkAutoLockPixels dstLock(dst); 422 SkAutoLockPixels dstLock(dst);
423 423
424 U8CPU innerThreshold = (U8CPU)(fInnerThreshold * 0xFF); 424 U8CPU innerThreshold = (U8CPU)(fInnerThreshold * 0xFF);
425 U8CPU outerThreshold = (U8CPU)(fOuterThreshold * 0xFF); 425 U8CPU outerThreshold = (U8CPU)(fOuterThreshold * 0xFF);
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 dst); 465 dst);
466 } 466 }
467 467
468 #ifndef SK_IGNORE_TO_STRING 468 #ifndef SK_IGNORE_TO_STRING
469 void SkAlphaThresholdFilterImpl::toString(SkString* str) const { 469 void SkAlphaThresholdFilterImpl::toString(SkString* str) const {
470 str->appendf("SkAlphaThresholdImageFilter: ("); 470 str->appendf("SkAlphaThresholdImageFilter: (");
471 str->appendf("inner: %f outer: %f", fInnerThreshold, fOuterThreshold); 471 str->appendf("inner: %f outer: %f", fInnerThreshold, fOuterThreshold);
472 str->append(")"); 472 str->append(")");
473 } 473 }
474 #endif 474 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698