aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/opts/SkTextureCompression_opts_arm.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/opts/SkTextureCompression_opts_arm.cpp')
-rw-r--r--src/opts/SkTextureCompression_opts_arm.cpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/opts/SkTextureCompression_opts_arm.cpp b/src/opts/SkTextureCompression_opts_arm.cpp
new file mode 100644
index 0000000000..3a97a5ed9a
--- /dev/null
+++ b/src/opts/SkTextureCompression_opts_arm.cpp
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2014 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include "SkTextureCompression_opts.h"
+#include "SkTextureCompression_opts_neon.h"
+#include "SkUtilsArm.h"
+
+SkTextureCompressor::CompressionProc
+SkTextureCompressorGetPlatformProc(SkColorType colorType, SkTextureCompressor::Format fmt) {
+#if SK_ARM_NEON_IS_NONE
+ return NULL;
+#else
+#if SK_ARM_NEON_IS_DYNAMIC
+ if (!sk_cpu_arm_has_neon()) {
+ return NULL;
+ }
+#endif
+ switch (colorType) {
+ case kAlpha_8_SkColorType:
+ {
+ switch (fmt) {
+ case SkTextureCompressor::kR11_EAC_Format:
+ return CompressA8toR11EAC_NEON;
+ default:
+ return NULL;
+ }
+ }
+ break;
+
+ default:
+ return NULL;
+ }
+#endif
+}