SK_ARRAY_COUNT shouldn't work on pointers.

Simpler version of https://codereview.chromium.org/1123923002/

BUG=skia:3593
R=brucedawson@chromium.org,reed@google.com,tfarina@chromium.org

No public API changes.
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1114283003
diff --git a/include/core/SkTypes.h b/include/core/SkTypes.h
index a1719f8..1b0b12c 100644
--- a/include/core/SkTypes.h
+++ b/include/core/SkTypes.h
@@ -296,9 +296,9 @@
     #define SK_OFFSETOF(type, field)    (size_t)((char*)&(((type*)1)->field) - (char*)1)
 #endif
 
-/** Returns the number of entries in an array (not a pointer)
-*/
-#define SK_ARRAY_COUNT(array)       (sizeof(array) / sizeof(array[0]))
+/** Returns the number of entries in an array (not a pointer) */
+template <typename T, size_t N> char (&SkArrayCountHelper(T (&array)[N]))[N];
+#define SK_ARRAY_COUNT(array) (sizeof(SkArrayCountHelper(array)))
 
 #define SkAlign2(x)     (((x) + 1) >> 1 << 1)
 #define SkIsAlign2(x)   (0 == ((x) & 1))