diff options
author | reed <reed@google.com> | 2014-09-02 12:50:45 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-09-02 12:50:45 -0700 |
commit | 848250415eddc54075f7eb8795e8db79e749c6ab (patch) | |
tree | eb60aea6e61c9b3a9e195ab3cfb01d571351f78b /src/effects | |
parent | 00f30bdc9e34b013da54b4406f36556c5be8d041 (diff) |
make allocPixels throw on failure
BUG=skia:
R=mtklein@google.com, fmalita@google.com, fmalita@chromium.org
Author: reed@google.com
Review URL: https://codereview.chromium.org/510423005
Diffstat (limited to 'src/effects')
-rw-r--r-- | src/effects/SkAlphaThresholdFilter.cpp | 2 | ||||
-rw-r--r-- | src/effects/SkBlurImageFilter.cpp | 4 | ||||
-rw-r--r-- | src/effects/SkDisplacementMapEffect.cpp | 2 | ||||
-rw-r--r-- | src/effects/SkLightingImageFilter.cpp | 4 | ||||
-rw-r--r-- | src/effects/SkMagnifierImageFilter.cpp | 2 | ||||
-rw-r--r-- | src/effects/SkMatrixConvolutionImageFilter.cpp | 4 | ||||
-rw-r--r-- | src/effects/SkMorphologyImageFilter.cpp | 4 |
7 files changed, 11 insertions, 11 deletions
diff --git a/src/effects/SkAlphaThresholdFilter.cpp b/src/effects/SkAlphaThresholdFilter.cpp index ce35ba2baa..261640f3e9 100644 --- a/src/effects/SkAlphaThresholdFilter.cpp +++ b/src/effects/SkAlphaThresholdFilter.cpp @@ -343,7 +343,7 @@ bool SkAlphaThresholdFilterImpl::onFilterImage(Proxy*, const SkBitmap& src, return false; } - if (!dst->allocPixels(src.info())) { + if (!dst->tryAllocPixels(src.info())) { return false; } diff --git a/src/effects/SkBlurImageFilter.cpp b/src/effects/SkBlurImageFilter.cpp index d08209874b..8590400003 100644 --- a/src/effects/SkBlurImageFilter.cpp +++ b/src/effects/SkBlurImageFilter.cpp @@ -172,7 +172,7 @@ bool SkBlurImageFilter::onFilterImage(Proxy* proxy, return false; } - if (!dst->allocPixels(src.info().makeWH(srcBounds.width(), srcBounds.height()))) { + if (!dst->tryAllocPixels(src.info().makeWH(srcBounds.width(), srcBounds.height()))) { return false; } dst->getBounds(&dstBounds); @@ -199,7 +199,7 @@ bool SkBlurImageFilter::onFilterImage(Proxy* proxy, } SkBitmap temp; - if (!temp.allocPixels(dst->info())) { + if (!temp.tryAllocPixels(dst->info())) { return false; } diff --git a/src/effects/SkDisplacementMapEffect.cpp b/src/effects/SkDisplacementMapEffect.cpp index 5d15b4f8e8..bb71aa13e9 100644 --- a/src/effects/SkDisplacementMapEffect.cpp +++ b/src/effects/SkDisplacementMapEffect.cpp @@ -254,7 +254,7 @@ bool SkDisplacementMapEffect::onFilterImage(Proxy* proxy, return false; } - if (!dst->allocPixels(color.info().makeWH(bounds.width(), bounds.height()))) { + if (!dst->tryAllocPixels(color.info().makeWH(bounds.width(), bounds.height()))) { return false; } diff --git a/src/effects/SkLightingImageFilter.cpp b/src/effects/SkLightingImageFilter.cpp index 69e27609f6..1eb2a3642e 100644 --- a/src/effects/SkLightingImageFilter.cpp +++ b/src/effects/SkLightingImageFilter.cpp @@ -1016,7 +1016,7 @@ bool SkDiffuseLightingImageFilter::onFilterImage(Proxy* proxy, return false; } - if (!dst->allocPixels(src.info().makeWH(bounds.width(), bounds.height()))) { + if (!dst->tryAllocPixels(src.info().makeWH(bounds.width(), bounds.height()))) { return false; } @@ -1134,7 +1134,7 @@ bool SkSpecularLightingImageFilter::onFilterImage(Proxy* proxy, return false; } - if (!dst->allocPixels(src.info().makeWH(bounds.width(), bounds.height()))) { + if (!dst->tryAllocPixels(src.info().makeWH(bounds.width(), bounds.height()))) { return false; } diff --git a/src/effects/SkMagnifierImageFilter.cpp b/src/effects/SkMagnifierImageFilter.cpp index 70e95f6e77..9293f7fc2a 100644 --- a/src/effects/SkMagnifierImageFilter.cpp +++ b/src/effects/SkMagnifierImageFilter.cpp @@ -321,7 +321,7 @@ bool SkMagnifierImageFilter::onFilterImage(Proxy*, const SkBitmap& src, return false; } - if (!dst->allocPixels(src.info())) { + if (!dst->tryAllocPixels(src.info())) { return false; } diff --git a/src/effects/SkMatrixConvolutionImageFilter.cpp b/src/effects/SkMatrixConvolutionImageFilter.cpp index aa8b8049c9..c8959eecfb 100644 --- a/src/effects/SkMatrixConvolutionImageFilter.cpp +++ b/src/effects/SkMatrixConvolutionImageFilter.cpp @@ -265,7 +265,7 @@ static SkBitmap unpremultiplyBitmap(const SkBitmap& src) return SkBitmap(); } SkBitmap result; - if (!result.allocPixels(src.info())) { + if (!result.tryAllocPixels(src.info())) { return SkBitmap(); } for (int y = 0; y < src.height(); ++y) { @@ -307,7 +307,7 @@ bool SkMatrixConvolutionImageFilter::onFilterImage(Proxy* proxy, return false; } - if (!result->allocPixels(src.info().makeWH(bounds.width(), bounds.height()))) { + if (!result->tryAllocPixels(src.info().makeWH(bounds.width(), bounds.height()))) { return false; } diff --git a/src/effects/SkMorphologyImageFilter.cpp b/src/effects/SkMorphologyImageFilter.cpp index 2b9c91eb53..c6c470c390 100644 --- a/src/effects/SkMorphologyImageFilter.cpp +++ b/src/effects/SkMorphologyImageFilter.cpp @@ -166,7 +166,7 @@ bool SkMorphologyImageFilter::filterImageGeneric(SkMorphologyImageFilter::Proc p return false; } - if (!dst->allocPixels(src.info().makeWH(bounds.width(), bounds.height()))) { + if (!dst->tryAllocPixels(src.info().makeWH(bounds.width(), bounds.height()))) { return false; } @@ -191,7 +191,7 @@ bool SkMorphologyImageFilter::filterImageGeneric(SkMorphologyImageFilter::Proc p } SkBitmap temp; - if (!temp.allocPixels(dst->info())) { + if (!temp.tryAllocPixels(dst->info())) { return false; } |