aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/opts
diff options
context:
space:
mode:
authorGravatar senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-01-23 18:45:23 +0000
committerGravatar senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-01-23 18:45:23 +0000
commit76d4d04b18a773061559533a3b774a82ddc94d0f (patch)
tree3d59803f296480315e39d2a8996b0a848221d5bf /src/opts
parent9e63883725f2733fd05cbe7104f28e0ff5383db6 (diff)
Refactor SkMorphologyImageFilter, CPU and GPU paths. This required making opts/ dependent on effects/, so that we could use the SkMorphologyProc type in SkMorphologyImageFilter.h.
Correctness and performance covered by existing tests; no change in functionality. R=bsalomon@google.com, djsollen@google.com, reed@google.com Review URL: https://codereview.chromium.org/135013004 git-svn-id: http://skia.googlecode.com/svn/trunk@13154 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/opts')
-rw-r--r--src/opts/SkMorphology_opts.h17
-rw-r--r--src/opts/SkMorphology_opts_none.cpp2
-rw-r--r--src/opts/opts_check_SSE2.cpp2
-rw-r--r--src/opts/opts_check_arm.cpp2
4 files changed, 9 insertions, 14 deletions
diff --git a/src/opts/SkMorphology_opts.h b/src/opts/SkMorphology_opts.h
index e3ad853cf6..7ea7c54623 100644
--- a/src/opts/SkMorphology_opts.h
+++ b/src/opts/SkMorphology_opts.h
@@ -5,17 +5,10 @@
* found in the LICENSE file.
*/
-#include <SkColor.h>
+#ifndef SkMorphology_opts_DEFINED
+#define SkMorphology_opts_DEFINED
-/**
- * All morphology procs have the same signature: src is the source buffer, dst the
- * destination buffer, radius is the morphology radius, width and height are the bounds
- * of the destination buffer (in pixels), and srcStride and dstStride are the
- * number of pixels per row in each buffer. All buffers are 8888.
- */
-
-typedef void (*SkMorphologyProc)(const SkPMColor* src, SkPMColor* dst, int radius,
- int width, int height, int srcStride, int dstStride);
+#include <SkMorphologyImageFilter.h>
enum SkMorphologyProcType {
kDilateX_SkMorphologyProcType,
@@ -24,4 +17,6 @@ enum SkMorphologyProcType {
kErodeY_SkMorphologyProcType
};
-SkMorphologyProc SkMorphologyGetPlatformProc(SkMorphologyProcType type);
+SkMorphologyImageFilter::Proc SkMorphologyGetPlatformProc(SkMorphologyProcType type);
+
+#endif
diff --git a/src/opts/SkMorphology_opts_none.cpp b/src/opts/SkMorphology_opts_none.cpp
index 66d58ba571..ade261fc7d 100644
--- a/src/opts/SkMorphology_opts_none.cpp
+++ b/src/opts/SkMorphology_opts_none.cpp
@@ -7,6 +7,6 @@
#include "SkMorphology_opts.h"
-SkMorphologyProc SkMorphologyGetPlatformProc(SkMorphologyProcType) {
+SkMorphologyImageFilter::Proc SkMorphologyGetPlatformProc(SkMorphologyProcType) {
return NULL;
}
diff --git a/src/opts/opts_check_SSE2.cpp b/src/opts/opts_check_SSE2.cpp
index aaf6b2ef82..d0d88fe4a0 100644
--- a/src/opts/opts_check_SSE2.cpp
+++ b/src/opts/opts_check_SSE2.cpp
@@ -251,7 +251,7 @@ SkMemset32Proc SkMemset32GetPlatformProc() {
}
}
-SkMorphologyProc SkMorphologyGetPlatformProc(SkMorphologyProcType type) {
+SkMorphologyImageFilter::Proc SkMorphologyGetPlatformProc(SkMorphologyProcType type) {
if (!cachedHasSSE2()) {
return NULL;
}
diff --git a/src/opts/opts_check_arm.cpp b/src/opts/opts_check_arm.cpp
index 3a322aa0e9..9e8b472bdf 100644
--- a/src/opts/opts_check_arm.cpp
+++ b/src/opts/opts_check_arm.cpp
@@ -69,7 +69,7 @@ SkBlitRow::ColorRectProc PlatformColorRectProcFactory() {
return NULL;
}
-SkMorphologyProc SkMorphologyGetPlatformProc(SkMorphologyProcType type) {
+SkMorphologyImageFilter::Proc SkMorphologyGetPlatformProc(SkMorphologyProcType type) {
#if SK_ARM_NEON_IS_NONE
return NULL;
#else