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

Unified Diff: src/effects/SkBlurImageFilter.cpp

Issue 68473003: Remove some now-unused #ifdefs. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 1 month 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 | src/effects/SkBlurMask.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkBlurImageFilter.cpp
diff --git a/src/effects/SkBlurImageFilter.cpp b/src/effects/SkBlurImageFilter.cpp
index fa8ccc866e3f751c3f0697d320fedea2154d61b7..262733a74b4bd810e63ff07859e262e6ca957f5f 100644
--- a/src/effects/SkBlurImageFilter.cpp
+++ b/src/effects/SkBlurImageFilter.cpp
@@ -72,10 +72,8 @@ static void boxBlur(const SkPMColor* src, int srcStride, SkPMColor* dst, int ker
int dstStrideX = dstDirection == kX ? 1 : height;
int srcStrideY = srcDirection == kX ? srcStride : 1;
int dstStrideY = dstDirection == kX ? width : 1;
-#ifndef SK_DISABLE_BLUR_DIVISION_OPTIMIZATION
uint32_t scale = (1 << 24) / kernelSize;
uint32_t half = 1 << 23;
-#endif
for (int y = 0; y < height; ++y) {
int sumA = 0, sumR = 0, sumG = 0, sumB = 0;
const SkPMColor* p = src;
@@ -90,17 +88,10 @@ static void boxBlur(const SkPMColor* src, int srcStride, SkPMColor* dst, int ker
const SkPMColor* sptr = src;
SkColor* dptr = dst;
for (int x = 0; x < width; ++x) {
-#ifndef SK_DISABLE_BLUR_DIVISION_OPTIMIZATION
*dptr = SkPackARGB32((sumA * scale + half) >> 24,
(sumR * scale + half) >> 24,
(sumG * scale + half) >> 24,
(sumB * scale + half) >> 24);
-#else
- *dptr = SkPackARGB32(sumA / kernelSize,
- sumR / kernelSize,
- sumG / kernelSize,
- sumB / kernelSize);
-#endif
if (x >= leftOffset) {
SkColor l = *(sptr - leftOffset * srcStrideX);
sumA -= SkGetPackedA32(l);
@@ -202,21 +193,12 @@ bool SkBlurImageFilter::onFilterImage(Proxy* proxy,
}
if (kernelSizeX > 0 && kernelSizeY > 0) {
-#ifndef SK_DISABLE_BLUR_DIVISION_OPTIMIZATION
boxBlurX(s, sw, t, kernelSizeX, lowOffsetX, highOffsetX, w, h);
boxBlurX(t, w, d, kernelSizeX, highOffsetX, lowOffsetX, w, h);
boxBlurXY(d, w, t, kernelSizeX3, highOffsetX, highOffsetX, w, h);
boxBlurX(t, h, d, kernelSizeY, lowOffsetY, highOffsetY, h, w);
boxBlurX(d, h, t, kernelSizeY, highOffsetY, lowOffsetY, h, w);
boxBlurXY(t, h, d, kernelSizeY3, highOffsetY, highOffsetY, h, w);
-#else
- boxBlurX(s, sw, t, kernelSizeX, lowOffsetX, highOffsetX, w, h);
- boxBlurY(t, w, d, kernelSizeY, lowOffsetY, highOffsetY, h, w);
- boxBlurX(d, w, t, kernelSizeX, highOffsetX, lowOffsetX, w, h);
- boxBlurY(t, w, d, kernelSizeY, highOffsetY, lowOffsetY, h, w);
- boxBlurX(d, w, t, kernelSizeX3, highOffsetX, highOffsetX, w, h);
- boxBlurY(t, w, d, kernelSizeY3, highOffsetY, highOffsetY, h, w);
-#endif
} else if (kernelSizeX > 0) {
boxBlurX(s, sw, d, kernelSizeX, lowOffsetX, highOffsetX, w, h);
boxBlurX(d, w, t, kernelSizeX, highOffsetX, lowOffsetX, w, h);
« no previous file with comments | « no previous file | src/effects/SkBlurMask.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698