xref: /aosp_15_r20/external/skia/src/core/SkSwizzler_opts_hsw.cpp (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1 
2 /*
3  * Copyright 2023 Google LLC
4  *
5  * Use of this source code is governed by a BSD-style license that can be
6  * found in the LICENSE file.
7  */
8 
9 #include "include/private/base/SkFeatures.h"
10 #include "src/core/SkOptsTargets.h"
11 #include "src/core/SkSwizzlePriv.h"
12 
13 #if defined(SK_CPU_X86) && \
14     !defined(SK_ENABLE_OPTIMIZE_SIZE) && \
15     SK_CPU_SSE_LEVEL < SK_CPU_SSE_LEVEL_AVX2
16 
17 // The order of these includes is important:
18 // 1) Select the target CPU architecture by defining SK_OPTS_TARGET and including SkOpts_SetTarget
19 // 2) Include the code to compile, typically in a _opts.inc file.
20 // 3) Include SkOpts_RestoreTarget to switch back to the default CPU architecture
21 
22 #define SK_OPTS_TARGET SK_OPTS_TARGET_HSW
23 #include "src/opts/SkOpts_SetTarget.h"
24 
25 #include "src/opts/SkSwizzler_opts.inc"
26 
27 #include "src/opts/SkOpts_RestoreTarget.h"
28 
29 namespace SkOpts {
Init_Swizzler_hsw()30     void Init_Swizzler_hsw() {
31         RGBA_to_BGRA          = hsw::RGBA_to_BGRA;
32         RGBA_to_rgbA          = hsw::RGBA_to_rgbA;
33         RGBA_to_bgrA          = hsw::RGBA_to_bgrA;
34         gray_to_RGB1          = hsw::gray_to_RGB1;
35         grayA_to_RGBA         = hsw::grayA_to_RGBA;
36         grayA_to_rgbA         = hsw::grayA_to_rgbA;
37         inverted_CMYK_to_RGB1 = hsw::inverted_CMYK_to_RGB1;
38         inverted_CMYK_to_BGR1 = hsw::inverted_CMYK_to_BGR1;
39     }
40 }  // namespace SkOpts
41 
42 #endif // SK_CPU_X86 && !SK_ENABLE_OPTIMIZE_SIZE
43