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

Unified Diff: bench/BlurRectBench.cpp

Issue 1539553002: Add default ctor to SkMask (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add warning for ignored return values Created 5 years 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
« no previous file with comments | « no previous file | gm/blurrect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/BlurRectBench.cpp
diff --git a/bench/BlurRectBench.cpp b/bench/BlurRectBench.cpp
index b8a72118153e33cb70a45fc111a5fce7bccceb2d..53cf2da1b5213867a51c96757c365d3f55ff2d0d 100644
--- a/bench/BlurRectBench.cpp
+++ b/bench/BlurRectBench.cpp
@@ -63,7 +63,7 @@ protected:
preBenchSetup(r);
for (int i = 0; i < loops; i++) {
- makeBlurryRect(r);
+ this->makeBlurryRect(r);
}
}
@@ -90,8 +90,10 @@ class BlurRectDirectBench: public BlurRectBench {
protected:
void makeBlurryRect(const SkRect& r) override {
SkMask mask;
- SkBlurMask::BlurRect(SkBlurMask::ConvertRadiusToSigma(this->radius()),
- &mask, r, kNormal_SkBlurStyle);
+ if (!SkBlurMask::BlurRect(SkBlurMask::ConvertRadiusToSigma(this->radius()),
+ &mask, r, kNormal_SkBlurStyle)) {
+ return;
+ }
SkMask::FreeImage(mask.fImage);
}
private:
@@ -101,9 +103,7 @@ private:
class BlurRectSeparableBench: public BlurRectBench {
public:
- BlurRectSeparableBench(SkScalar rad) : INHERITED(rad) {
- fSrcMask.fImage = nullptr;
- }
+ BlurRectSeparableBench(SkScalar rad) : INHERITED(rad) { }
~BlurRectSeparableBench() {
SkMask::FreeImage(fSrcMask.fImage);
@@ -144,9 +144,10 @@ protected:
void makeBlurryRect(const SkRect&) override {
SkMask mask;
- mask.fImage = nullptr;
- SkBlurMask::BoxBlur(&mask, fSrcMask, SkBlurMask::ConvertRadiusToSigma(this->radius()),
- kNormal_SkBlurStyle, kHigh_SkBlurQuality);
+ if (!SkBlurMask::BoxBlur(&mask, fSrcMask, SkBlurMask::ConvertRadiusToSigma(this->radius()),
+ kNormal_SkBlurStyle, kHigh_SkBlurQuality)) {
+ return;
+ }
SkMask::FreeImage(mask.fImage);
}
private:
@@ -171,9 +172,10 @@ protected:
void makeBlurryRect(const SkRect&) override {
SkMask mask;
- mask.fImage = nullptr;
- SkBlurMask::BlurGroundTruth(SkBlurMask::ConvertRadiusToSigma(this->radius()),
- &mask, fSrcMask, kNormal_SkBlurStyle);
+ if (!SkBlurMask::BlurGroundTruth(SkBlurMask::ConvertRadiusToSigma(this->radius()),
+ &mask, fSrcMask, kNormal_SkBlurStyle)) {
+ return;
+ }
SkMask::FreeImage(mask.fImage);
}
private:
« no previous file with comments | « no previous file | gm/blurrect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698