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

Unified Diff: src/effects/SkBlurImageFilter.cpp

Issue 61643011: SSE2 implementation of RGBA box blurs. This yields ~2X perf improvement on (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Fixes from review comments 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 | « gyp/opts.gyp ('k') | src/opts/SkBlurImage_opts.h » ('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 c04c258829ed846faeb7c1a89508e6e13fde902d..852c0afad36549e82b765e2e55cf760072263c08 100644
--- a/src/effects/SkBlurImageFilter.cpp
+++ b/src/effects/SkBlurImageFilter.cpp
@@ -10,6 +10,7 @@
#include "SkColorPriv.h"
#include "SkFlattenableBuffers.h"
#include "SkGpuBlurUtils.h"
+#include "SkBlurImage_opts.h"
#if SK_SUPPORT_GPU
#include "GrContext.h"
#include "SkImageFilterUtils.h"
@@ -125,26 +126,6 @@ static void boxBlur(const SkPMColor* src, int srcStride, SkPMColor* dst, int ker
}
}
-static void boxBlurX(const SkPMColor* src, int srcStride, SkPMColor* dst, int kernelSize,
- int leftOffset, int rightOffset, int width, int height)
-{
- boxBlur<kX, kX>(src, srcStride, dst, kernelSize, leftOffset, rightOffset, width, height);
-}
-
-#ifndef SK_DISABLE_BLUR_DIVISION_OPTIMIZATION
-static void boxBlurXY(const SkPMColor* src, int srcStride, SkPMColor* dst, int kernelSize,
- int leftOffset, int rightOffset, int width, int height)
-{
- boxBlur<kX, kY>(src, srcStride, dst, kernelSize, leftOffset, rightOffset, width, height);
-}
-#endif
-
-static void boxBlurY(const SkPMColor* src, int srcStride, SkPMColor* dst, int kernelSize,
- int topOffset, int bottomOffset, int width, int height)
-{
- boxBlur<kY, kY>(src, srcStride, dst, kernelSize, topOffset, bottomOffset, width, height);
-}
-
static void getBox3Params(SkScalar s, int *kernelSize, int* kernelSize3, int *lowOffset,
int *highOffset)
{
@@ -212,6 +193,13 @@ bool SkBlurImageFilter::onFilterImage(Proxy* proxy,
SkPMColor* d = dst->getAddr32(0, 0);
int w = dstBounds.width(), h = dstBounds.height();
int sw = src.rowBytesAsPixels();
+ SkBoxBlurProc boxBlurX, boxBlurY, boxBlurXY;
+ if (!SkBoxBlurGetPlatformProcs(&boxBlurX, &boxBlurY, &boxBlurXY)) {
+ boxBlurX = boxBlur<kX, kX>;
+ boxBlurY = boxBlur<kY, kY>;
+ boxBlurXY = boxBlur<kX, kY>;
+ }
+
if (kernelSizeX > 0 && kernelSizeY > 0) {
#ifndef SK_DISABLE_BLUR_DIVISION_OPTIMIZATION
boxBlurX(s, sw, t, kernelSizeX, lowOffsetX, highOffsetX, w, h);
« no previous file with comments | « gyp/opts.gyp ('k') | src/opts/SkBlurImage_opts.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698