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

Unified Diff: src/opts/SkTextureCompression_opts_arm.cpp

Issue 390453002: Add support for NEON intrinsics to speed up texture compression. We can (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix arm and neon compatibility Created 6 years, 5 months 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 | « src/opts/SkTextureCompression_opts.h ('k') | src/opts/SkTextureCompression_opts_neon.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/opts/SkTextureCompression_opts_arm.cpp
diff --git a/src/opts/SkTextureCompression_opts_arm.cpp b/src/opts/SkTextureCompression_opts_arm.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..3a97a5ed9a161a099f60324c1d6ca86f1b6f49d7
--- /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
+}
« no previous file with comments | « src/opts/SkTextureCompression_opts.h ('k') | src/opts/SkTextureCompression_opts_neon.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698