Skip to content

Commit 76daa70

Browse files
committed
Revert "This patch attempts to fix static linkage issues by disabling AVX2 and AVX512 by default, and includes a minor SkUnicode fix."
This reverts commit b5c13d8.
1 parent e848d49 commit 76daa70

File tree

3 files changed

+27
-35
lines changed

3 files changed

+27
-35
lines changed

BUILD.gn

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -170,10 +170,8 @@ is_loong64 = current_cpu == "loong64"
170170
opts("hsw") {
171171
enabled = is_x86
172172
sources = skia_opts.hsw_sources
173-
if (is_win) {
174-
if (!is_mingw) {
175-
cflags = [ "/arch:AVX2" ]
176-
}
173+
if (is_win && !is_mingw) {
174+
cflags = [ "/arch:AVX2" ]
177175
} else {
178176
cflags = [ "-march=haswell" ]
179177
}
@@ -182,10 +180,8 @@ opts("hsw") {
182180
opts("skx") {
183181
enabled = is_x86
184182
sources = skia_opts.skx_sources
185-
if (is_win) {
186-
if (!is_mingw) {
187-
cflags = [ "/arch:AVX512" ]
188-
}
183+
if (is_win && !is_mingw) {
184+
cflags = [ "/arch:AVX512" ]
189185
} else {
190186
cflags = [ "-march=skylake-avx512" ]
191187
}

modules/skcms/BUILD.gn

Lines changed: 22 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,15 @@ template("arch") {
3333
arch("skcms_TransformHsw") {
3434
enabled = current_cpu == "x64" && target_os != "android"
3535
sources = skcms_TransformHsw
36-
if (is_win) {
37-
if (!is_mingw) {
38-
if (is_clang) {
39-
cflags = [
40-
"/clang:-mavx2",
41-
"/clang:-mf16c",
42-
"/clang:-ffp-contract=off",
43-
]
44-
} else {
45-
cflags = [ "/arch:AVX2" ]
46-
}
36+
if (is_win && !is_mingw) {
37+
if (is_clang) {
38+
cflags = [
39+
"/clang:-mavx2",
40+
"/clang:-mf16c",
41+
"/clang:-ffp-contract=off",
42+
]
43+
} else {
44+
cflags = [ "/arch:AVX2" ]
4745
}
4846
} else {
4947
cflags = [
@@ -57,20 +55,18 @@ arch("skcms_TransformHsw") {
5755
arch("skcms_TransformSkx") {
5856
enabled = current_cpu == "x64" && target_os != "android"
5957
sources = skcms_TransformSkx
60-
if (is_win) {
61-
if (!is_mingw) {
62-
if (is_clang) {
63-
cflags = [
64-
"/clang:-mavx512f",
65-
"/clang:-mavx512dq",
66-
"/clang:-mavx512cd",
67-
"/clang:-mavx512bw",
68-
"/clang:-mavx512vl",
69-
"/clang:-ffp-contract=off",
70-
]
71-
} else {
72-
cflags = [ "/arch:AVX512" ]
73-
}
58+
if (is_win && !is_mingw) {
59+
if (is_clang) {
60+
cflags = [
61+
"/clang:-mavx512f",
62+
"/clang:-mavx512dq",
63+
"/clang:-mavx512cd",
64+
"/clang:-mavx512bw",
65+
"/clang:-mavx512vl",
66+
"/clang:-ffp-contract=off",
67+
]
68+
} else {
69+
cflags = [ "/arch:AVX512" ]
7470
}
7571
} else {
7672
cflags = [
@@ -91,7 +87,7 @@ static_library("skcms") {
9187
} else if (is_clang) {
9288
cflags_c += [ "-std=c11" ]
9389
}
94-
if (target_cpu != "x64" || target_os == "android" || (is_win && !is_mingw)) {
90+
if (target_cpu != "x64" || target_os == "android") {
9591
defines = [
9692
"SKCMS_DISABLE_HSW",
9793
"SKCMS_DISABLE_SKX",

sk4d/modules/skunicode/src/sk4d_unicode.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ sk_unicode_t* sk4d_unicode_create(void) {
1414
}
1515

1616
void sk4d_unicode_destroy(sk_unicode_t* self) {
17-
AsUnicode(self)->unref();
17+
delete AsUnicode(self);
1818
}
1919

2020
void sk4d_unicode_for_each_bidi_region(sk_unicode_t* self, const uint16_t utf16_text[], int32_t utf16_units, sk_direction_t direction, sk_unicode_bidi_region_proc proc, void* context) {

0 commit comments

Comments
 (0)