diff options
author | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-01-07 16:04:01 +0000 |
---|---|---|
committer | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-01-07 16:04:01 +0000 |
commit | 9109e188c77abfd2832767530d33fdec35290a84 (patch) | |
tree | d29806201a7bf4b052bdba2949e26bb3abd6715d /src/effects/SkAlphaThresholdFilter.cpp | |
parent | 179f6c5e62615ebf50cecae2a5479210084787f1 (diff) |
Fix build warnings in SkAlphaThresholdFilter
BUG=None
R=bsalomon@google.com
Author: zork@chromium.org
Review URL: https://codereview.chromium.org/101763010
git-svn-id: http://skia.googlecode.com/svn/trunk@12937 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/effects/SkAlphaThresholdFilter.cpp')
-rw-r--r-- | src/effects/SkAlphaThresholdFilter.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/effects/SkAlphaThresholdFilter.cpp b/src/effects/SkAlphaThresholdFilter.cpp index a53731f3b4..f15a13dd8b 100644 --- a/src/effects/SkAlphaThresholdFilter.cpp +++ b/src/effects/SkAlphaThresholdFilter.cpp @@ -308,18 +308,18 @@ bool SkAlphaThresholdFilterImpl::onFilterImage(Proxy*, const SkBitmap& src, SkASSERT(src.config() == SkBitmap::kARGB_8888_Config); if (src.config() != SkBitmap::kARGB_8888_Config) { - return false; + return false; } SkMatrix localInverse; if (!matrix.invert(&localInverse)) { - return NULL; + return false; } SkAutoLockPixels alp(src); SkASSERT(src.getPixels()); if (!src.getPixels() || src.width() <= 0 || src.height() <= 0) { - return false; + return false; } dst->setConfig(src.config(), src.width(), src.height()); @@ -328,8 +328,8 @@ bool SkAlphaThresholdFilterImpl::onFilterImage(Proxy*, const SkBitmap& src, return false; } - U8CPU innerThreshold = fInnerThreshold * 0xFF; - U8CPU outerThreshold = fOuterThreshold * 0xFF; + U8CPU innerThreshold = (U8CPU)(fInnerThreshold * 0xFF); + U8CPU outerThreshold = (U8CPU)(fOuterThreshold * 0xFF); SkColor* sptr = src.getAddr32(0, 0); SkColor* dptr = dst->getAddr32(0, 0); int width = src.width(), height = src.height(); @@ -338,25 +338,25 @@ bool SkAlphaThresholdFilterImpl::onFilterImage(Proxy*, const SkBitmap& src, const SkColor& source = sptr[y * width + x]; SkColor output_color(source); SkPoint position; - localInverse.mapXY(x, y, &position); - if (fRegion.contains(position.x(), position.y())) { + localInverse.mapXY((SkScalar)x, (SkScalar)y, &position); + if (fRegion.contains((int32_t)position.x(), (int32_t)position.y())) { if (SkColorGetA(source) < innerThreshold) { U8CPU alpha = SkColorGetA(source); if (alpha == 0) alpha = 1; float scale = (float)innerThreshold / alpha; output_color = SkColorSetARGB(innerThreshold, - SkColorGetR(source) * scale, - SkColorGetG(source) * scale, - SkColorGetB(source) * scale); + (U8CPU)(SkColorGetR(source) * scale), + (U8CPU)(SkColorGetG(source) * scale), + (U8CPU)(SkColorGetB(source) * scale)); } } else { if (SkColorGetA(source) > outerThreshold) { float scale = (float)outerThreshold / SkColorGetA(source); output_color = SkColorSetARGB(outerThreshold, - SkColorGetR(source) * scale, - SkColorGetG(source) * scale, - SkColorGetB(source) * scale); + (U8CPU)(SkColorGetR(source) * scale), + (U8CPU)(SkColorGetG(source) * scale), + (U8CPU)(SkColorGetB(source) * scale)); } } dptr[y * dst->width() + x] = output_color; |