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

Side by Side Diff: src/core/SkOpts.cpp

Issue 1264543006: Port SkXfermode opts to SkOpts.h (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 5 years, 4 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 unified diff | Download patch
« no previous file with comments | « src/core/Sk4pxXfermode.h ('k') | src/core/SkXfermode.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkOnce.h" 8 #include "SkOnce.h"
9 #include "SkOpts.h" 9 #include "SkOpts.h"
10 #include "SkXfermode_opts.h"
10 11
11 #if defined(SK_CPU_X86) 12 #if defined(SK_CPU_X86)
12 #if defined(SK_BUILD_FOR_WIN32) 13 #if defined(SK_BUILD_FOR_WIN32)
13 #include <intrin.h> 14 #include <intrin.h>
14 static void cpuid(uint32_t abcd[4]) { __cpuid((int*)abcd, 1); } 15 static void cpuid(uint32_t abcd[4]) { __cpuid((int*)abcd, 1); }
15 #else 16 #else
16 #include <cpuid.h> 17 #include <cpuid.h>
17 static void cpuid(uint32_t abcd[4]) { __get_cpuid(1, abcd+0, abcd+1, abc d+2, abcd+3); } 18 static void cpuid(uint32_t abcd[4]) { __get_cpuid(1, abcd+0, abcd+1, abc d+2, abcd+3); }
18 #endif 19 #endif
19 #elif !defined(SK_ARM_HAS_NEON) && defined(SK_CPU_ARM32) && defined(SK_BUILD_FOR _ANDROID) 20 #elif !defined(SK_ARM_HAS_NEON) && defined(SK_CPU_ARM32) && defined(SK_BUILD_FOR _ANDROID)
(...skipping 14 matching lines...) Expand all
34 return estimate; 35 return estimate;
35 } 36 }
36 37
37 template <typename T> 38 template <typename T>
38 static void memsetT(T dst[], T val, int n) { while (n --> 0) { *dst++ = val; } } 39 static void memsetT(T dst[], T val, int n) { while (n --> 0) { *dst++ = val; } }
39 40
40 } // namespace portable 41 } // namespace portable
41 42
42 namespace SkOpts { 43 namespace SkOpts {
43 // Define default function pointer values here... 44 // Define default function pointer values here...
44 decltype(rsqrt) rsqrt = portable::rsqrt; 45 decltype(rsqrt) rsqrt = portable::rsqrt;
45 decltype(memset16) memset16 = portable::memsetT<uint16_t>; 46 decltype(memset16) memset16 = portable::memsetT<uint16_t>;
46 decltype(memset32) memset32 = portable::memsetT<uint32_t>; 47 decltype(memset32) memset32 = portable::memsetT<uint32_t>;
47 48 decltype(create_xfermode) create_xfermode = SkCreate4pxXfermode;
48 49
49 // Each Init_foo() is defined in src/opts/SkOpts_foo.cpp. 50 // Each Init_foo() is defined in src/opts/SkOpts_foo.cpp.
50 void Init_sse2(); 51 void Init_sse2();
51 void Init_ssse3(); 52 void Init_ssse3();
52 void Init_sse41(); 53 void Init_sse41();
53 void Init_neon(); 54 void Init_neon();
54 //TODO: _dsp2, _armv7, _armv8, _x86, _x86_64, _sse42, _avx, avx2, ... ? 55 //TODO: _dsp2, _armv7, _armv8, _x86, _x86_64, _sse42, _avx, avx2, ... ?
55 56
56 static void init() { 57 static void init() {
57 #if defined(SK_CPU_X86) 58 #if defined(SK_CPU_X86)
(...skipping 11 matching lines...) Expand all
69 70
70 SK_DECLARE_STATIC_ONCE(gInitOnce); 71 SK_DECLARE_STATIC_ONCE(gInitOnce);
71 void Init() { SkOnce(&gInitOnce, init); } 72 void Init() { SkOnce(&gInitOnce, init); }
72 73
73 #if SK_ALLOW_STATIC_GLOBAL_INITIALIZERS 74 #if SK_ALLOW_STATIC_GLOBAL_INITIALIZERS
74 static struct AutoInit { 75 static struct AutoInit {
75 AutoInit() { Init(); } 76 AutoInit() { Init(); }
76 } gAutoInit; 77 } gAutoInit;
77 #endif 78 #endif
78 } 79 }
OLDNEW
« no previous file with comments | « src/core/Sk4pxXfermode.h ('k') | src/core/SkXfermode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698