• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2023 Google LLC
3  *
4  * Use of this source code is governed by a BSD-style license that can be
5  * found in the LICENSE file.
6  */
7 
8 #include "include/private/base/SkFeatures.h"
9 #include "src/core/SkBlitRow.h"
10 #include "src/core/SkCpu.h"
11 #include "src/core/SkOptsTargets.h"
12 
13 #define SK_OPTS_TARGET SK_OPTS_TARGET_DEFAULT
14 #include "src/opts/SkOpts_SetTarget.h"
15 
16 #include "src/opts/SkBlitRow_opts.h"  // IWYU pragma: keep
17 
18 #include "src/opts/SkOpts_RestoreTarget.h"
19 
20 namespace SkOpts {
21     DEFINE_DEFAULT(blit_row_color32);
22     DEFINE_DEFAULT(blit_row_s32a_opaque);
23 
24     void Init_BlitRow_hsw();
25 
init()26     static bool init() {
27     #if defined(SK_ENABLE_OPTIMIZE_SIZE)
28         // All Init_foo functions are omitted when optimizing for size
29     #elif defined(SK_CPU_X86)
30         #if SK_CPU_SSE_LEVEL < SK_CPU_SSE_LEVEL_AVX2
31             if (SkCpu::Supports(SkCpu::HSW)) { Init_BlitRow_hsw(); }
32         #endif
33     #endif
34       return true;
35     }
36 
Init_BlitRow()37     void Init_BlitRow() {
38         [[maybe_unused]] static bool gInitialized = init();
39     }
40 }  // namespace SkOpts
41