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" // IWYU pragma: keep 10 #include "src/core/SkOptsTargets.h" // IWYU pragma: keep 11 #include "src/core/SkSwizzlePriv.h" // IWYU pragma: keep 12 13 #if defined(SK_CPU_LOONGARCH) && !defined(SK_ENABLE_OPTIMIZE_SIZE) 14 15 // The order of these includes is important: 16 // 1) Select the target CPU architecture by defining SK_OPTS_TARGET and including SkOpts_SetTarget 17 // 2) Include the code to compile, typically in a _opts.inc file. 18 // 3) Include SkOpts_RestoreTarget to switch back to the default CPU architecture 19 20 #define SK_OPTS_TARGET SK_OPTS_TARGET_LASX 21 #include "src/opts/SkOpts_SetTarget.h" 22 23 #include "src/opts/SkSwizzler_opts.inc" 24 25 #include "src/opts/SkOpts_RestoreTarget.h" 26 27 namespace SkOpts { Init_Swizzler_lasx()28 void Init_Swizzler_lasx() { 29 RGBA_to_BGRA = lasx::RGBA_to_BGRA; 30 RGBA_to_rgbA = lasx::RGBA_to_rgbA; 31 RGBA_to_bgrA = lasx::RGBA_to_bgrA; 32 gray_to_RGB1 = lasx::gray_to_RGB1; 33 grayA_to_RGBA = lasx::grayA_to_RGBA; 34 grayA_to_rgbA = lasx::grayA_to_rgbA; 35 inverted_CMYK_to_RGB1 = lasx::inverted_CMYK_to_RGB1; 36 inverted_CMYK_to_BGR1 = lasx::inverted_CMYK_to_BGR1; 37 } 38 } // namespace SkOpts 39 40 #endif // SK_CPU_LOONGARCH && !SK_ENABLE_OPTIMIZE_SIZE 41