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

Unified Diff: src/core/SkOpts.cpp

Issue 1577703006: Optimized premultiplying swizzles for NEON (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove unnecessary if statement Created 4 years, 11 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 | « no previous file | src/opts/SkOpts_neon.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkOpts.cpp
diff --git a/src/core/SkOpts.cpp b/src/core/SkOpts.cpp
index ee88b231690b0e8d7f0cd895a9609f9bf680235b..5f1a36c1bef13765646fa5c8fa5759e86500e33b 100644
--- a/src/core/SkOpts.cpp
+++ b/src/core/SkOpts.cpp
@@ -16,6 +16,7 @@
#include "SkFloatingPoint_opts.h"
#include "SkMatrix_opts.h"
#include "SkMorphologyImageFilter_opts.h"
+#include "SkSwizzler_opts.h"
#include "SkTextureCompressor_opts.h"
#include "SkUtils_opts.h"
#include "SkXfermode_opts.h"
@@ -49,58 +50,6 @@
#include <cpu-features.h>
#endif
-namespace sk_default {
-
-// These variable names in these functions just pretend the input is BGRA.
-// They work fine with both RGBA and BGRA.
-
-static void premul_xxxa(uint32_t dst[], const uint32_t src[], int count) {
- for (int i = 0; i < count; i++) {
- uint8_t a = src[i] >> 24,
- r = src[i] >> 16,
- g = src[i] >> 8,
- b = src[i] >> 0;
- r = (r*a+127)/255;
- g = (g*a+127)/255;
- b = (b*a+127)/255;
- dst[i] = (uint32_t)a << 24
- | (uint32_t)r << 16
- | (uint32_t)g << 8
- | (uint32_t)b << 0;
- }
-}
-
-static void swaprb_xxxa(uint32_t dst[], const uint32_t src[], int count) {
- for (int i = 0; i < count; i++) {
- uint8_t a = src[i] >> 24,
- r = src[i] >> 16,
- g = src[i] >> 8,
- b = src[i] >> 0;
- dst[i] = (uint32_t)a << 24
- | (uint32_t)b << 16
- | (uint32_t)g << 8
- | (uint32_t)r << 0;
- }
-}
-
-static void premul_swaprb_xxxa(uint32_t dst[], const uint32_t src[], int count) {
- for (int i = 0; i < count; i++) {
- uint8_t a = src[i] >> 24,
- r = src[i] >> 16,
- g = src[i] >> 8,
- b = src[i] >> 0;
- r = (r*a+127)/255;
- g = (g*a+127)/255;
- b = (b*a+127)/255;
- dst[i] = (uint32_t)a << 24
- | (uint32_t)b << 16
- | (uint32_t)g << 8
- | (uint32_t)r << 0;
- }
-}
-
-} // namespace sk_default
-
namespace SkOpts {
// Define default function pointer values here...
// If our global compile options are set high enough, these defaults might even be
« no previous file with comments | « no previous file | src/opts/SkOpts_neon.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698