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

Unified Diff: src/effects/SkMatrixConvolutionImageFilter.cpp

Issue 510423005: make allocPixels throw on failure (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: can't use (void) to suppress the "must check return result" Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: src/effects/SkMatrixConvolutionImageFilter.cpp
diff --git a/src/effects/SkMatrixConvolutionImageFilter.cpp b/src/effects/SkMatrixConvolutionImageFilter.cpp
index aa8b8049c9a94e95d1c64224f859ec5ccadf98ec..c8959eecfbe01dbab865cc8e25e248fa3ddcc6e7 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;
}

Powered by Google App Engine
This is Rietveld 408576698