Flutter Engine
The Flutter Engine
SkOpts.cpp
Go to the documentation of this file.
1/*
2 * Copyright 2015 Google Inc.
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#include "src/core/SkOpts.h"
8
10#include "src/core/SkCpu.h"
12
13#define SK_OPTS_TARGET SK_OPTS_TARGET_DEFAULT
15
16#include "src/opts/SkRasterPipeline_opts.h" // IWYU pragma: keep
17
19
20namespace SkOpts {
21 // Define default function pointer values here...
22 // If our global compile options are set high enough, these defaults might even be
23 // CPU-specialized, e.g. a typical x86-64 machine might start with SSE2 defaults.
24 // They'll still get a chance to be replaced with even better ones, e.g. using SSE4.1.
27
28#define M(st) (StageFn)SK_OPTS_NS::st,
31 void (*start_pipeline_highp)(size_t, size_t, size_t, size_t, SkRasterPipelineStage*,
33 uint8_t*) =
35#undef M
36
37#define M(st) (StageFn)SK_OPTS_NS::lowp::st,
40 void (*start_pipeline_lowp)(size_t, size_t, size_t, size_t, SkRasterPipelineStage*,
42 uint8_t*) =
44#undef M
45
46 // Each Init_foo() is defined in src/opts/SkOpts_foo.cpp.
47 void Init_hsw();
48 void Init_skx();
49
50 static bool init() {
51 #if defined(SK_ENABLE_OPTIMIZE_SIZE)
52 // All Init_foo functions are omitted when optimizing for size
53 #elif defined(SK_CPU_X86)
54 #if SK_CPU_SSE_LEVEL < SK_CPU_SSE_LEVEL_AVX2
56 #endif
57
58 #if (SK_CPU_SSE_LEVEL < SK_CPU_SSE_LEVEL_SKX) && defined(SK_ENABLE_AVX512_OPTS)
60 #endif
61
62 #endif
63 return true;
64 }
65
66 void Init() {
67 [[maybe_unused]] static bool gInitialized = init();
68 }
69} // namespace SkOpts
#define SK_RASTER_PIPELINE_OPS_ALL(M)
#define SK_RASTER_PIPELINE_OPS_LOWP(M)
static void(* just_return)(void)
static void start_pipeline(size_t, size_t, size_t, size_t, SkRasterPipelineStage *, SkSpan< SkRasterPipeline_MemoryCtxPatch >, uint8_t *tailPointer)
constexpr size_t raster_pipeline_highp_stride()
static void start_pipeline(size_t dx, size_t dy, size_t xlimit, size_t ylimit, SkRasterPipelineStage *program, SkSpan< SkRasterPipeline_MemoryCtxPatch > memoryCtxPatches, uint8_t *tailPointer)
static void ABI just_return(Params *, SkRasterPipelineStage *, F, F, F, F)
constexpr size_t raster_pipeline_lowp_stride()
static bool init()
void Init()
Definition: SkOpts.cpp:66
StageFn just_return_lowp
Definition: SkOpts.cpp:39
StageFn ops_highp[]
Definition: SkOpts.cpp:29
void(*)(void) StageFn
Definition: SkOpts.h:72
size_t raster_pipeline_highp_stride
Definition: SkOpts.cpp:26
void Init_skx()
Definition: SkOpts_skx.cpp:16
void(* start_pipeline_lowp)(size_t, size_t, size_t, size_t, SkRasterPipelineStage *, SkSpan< SkRasterPipeline_MemoryCtxPatch >, uint8_t *)
Definition: SkOpts.cpp:40
size_t raster_pipeline_lowp_stride
Definition: SkOpts.cpp:25
void(* start_pipeline_highp)(size_t, size_t, size_t, size_t, SkRasterPipelineStage *, SkSpan< SkRasterPipeline_MemoryCtxPatch >, uint8_t *)
Definition: SkOpts.cpp:31
StageFn just_return_highp
Definition: SkOpts.cpp:30
void Init_hsw()
Definition: SkOpts_hsw.cpp:16
StageFn ops_lowp[]
Definition: SkOpts.cpp:38
#define M(PROC, DITHER)
static bool Supports(uint32_t)
Definition: SkCpu.h:58
@ HSW
Definition: SkCpu.h:30
@ SKX
Definition: SkCpu.h:42