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

Unified Diff: src/effects/SkBlurMask.cpp

Issue 1311583005: Add special case circle blur for Ganesh (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix no-GPU build Created 5 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
« no previous file with comments | « src/effects/SkBlurMask.h ('k') | src/effects/SkBlurMaskFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkBlurMask.cpp
diff --git a/src/effects/SkBlurMask.cpp b/src/effects/SkBlurMask.cpp
index 0fc554fdd22e91c65efeb39594c0df98d73ebca2..acee70ff254afe85ff88fb03aaa608d5d8112cf7 100644
--- a/src/effects/SkBlurMask.cpp
+++ b/src/effects/SkBlurMask.cpp
@@ -678,7 +678,7 @@ static float gaussianIntegral(float x) {
memory returned in profile_out.
*/
-void SkBlurMask::ComputeBlurProfile(SkScalar sigma, uint8_t **profile_out) {
+uint8_t* SkBlurMask::ComputeBlurProfile(SkScalar sigma) {
int size = SkScalarCeilToInt(6*sigma);
int center = size >> 1;
@@ -693,7 +693,7 @@ void SkBlurMask::ComputeBlurProfile(SkScalar sigma, uint8_t **profile_out) {
profile[x] = 255 - (uint8_t) (255.f * gi);
}
- *profile_out = profile;
+ return profile;
}
// TODO MAYBE: Maintain a profile cache to avoid recomputing this for
@@ -769,10 +769,8 @@ bool SkBlurMask::BlurRect(SkScalar sigma, SkMask *dst,
}
return true;
}
- uint8_t *profile = nullptr;
- ComputeBlurProfile(sigma, &profile);
- SkAutoTDeleteArray<uint8_t> ada(profile);
+ SkAutoTDeleteArray<uint8_t> profile(ComputeBlurProfile(sigma));
size_t dstSize = dst->computeImageSize();
if (0 == dstSize) {
@@ -791,8 +789,8 @@ bool SkBlurMask::BlurRect(SkScalar sigma, SkMask *dst,
SkAutoTMalloc<uint8_t> horizontalScanline(dstWidth);
SkAutoTMalloc<uint8_t> verticalScanline(dstHeight);
- ComputeBlurredScanline(horizontalScanline, profile, dstWidth, sigma);
- ComputeBlurredScanline(verticalScanline, profile, dstHeight, sigma);
+ ComputeBlurredScanline(horizontalScanline, profile.get(), dstWidth, sigma);
+ ComputeBlurredScanline(verticalScanline, profile.get(), dstHeight, sigma);
for (int y = 0 ; y < dstHeight ; ++y) {
for (int x = 0 ; x < dstWidth ; x++) {
« no previous file with comments | « src/effects/SkBlurMask.h ('k') | src/effects/SkBlurMaskFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698