Skip to content

Commit

Permalink
Merge branch 'skiasharp' into dev/update-harfbuzz-v3
Browse files Browse the repository at this point in the history
  • Loading branch information
mattleibow committed Aug 26, 2023
2 parents ddbb86b + b286cfa commit 070307c
Show file tree
Hide file tree
Showing 9 changed files with 485 additions and 91 deletions.
11 changes: 11 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
blank_issues_enabled: false
contact_links:
- name: Bug Report
url: https://github.com/mono/SkiaSharp/issues
about: Create a report in the SkiaSharp repository.
- name: Feature Request
url: https://github.com/mono/SkiaSharp/issues
about: Suggest an idea in the SkiaSharp repository.
- name: Questions and/or Discussions
url: https://github.com/mono/SkiaSharp/discussions
about: Please ask and answer questions in the SkiaSharp repository.
51 changes: 51 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
**Description of Change**

<!--
Describe your changes here.
-->

**SkiaSharp Issue**

<!--
Provide links to SkiaSharp issues here.
Ensure that a GitHub issue was created for your feature or bug fix before sending PR.
-->

Related to https://github.com/mono/SkiaSharp/issues/<issue-number>

**API Changes**

None.

<!--
List all API changes here (or just put None), example:
Added:
- `void skobject_method_name()`
Changed:
- `void skobject_old_method_name()` => `void skobject_new_method_name()`
-->

**Behavioral Changes**

None.

<!--
Describe any non-bug related behavioral changes that may change how users app behaves
when upgrading to this version of the codebase.
-->

**Required SkiaSharp PR**

Requires https://github.com/mono/SkiaSharp/pull/<pr-number>

<!--
Replace this with the full URL to the skia PR.
-->

**PR Checklist**

- [ ] Rebased on top of `skiasharp` at time of PR
- [ ] Changes adhere to coding standard
- [ ] Updated documentation
33 changes: 33 additions & 0 deletions .github/workflows/backport.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Backport

on:
pull_request_target:
types:
- closed
- labeled

jobs:
backport:
name: Backport
runs-on: ubuntu-latest
# Only react to merged PRs for security reasons.
# See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target.
if: >
github.event.pull_request.merged
&& (
github.event.action == 'closed'
|| (
github.event.action == 'labeled'
&& contains(github.event.label.name, 'backport')
)
)
steps:
- uses: tibdex/backport@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
body_template: >
Backport of <%= mergeCommitSha %> from #<%= number %>.
head_template: "backport/pr-<%= number %>-to-<%= base %>"
label_pattern: "^backport/(?<base>([^ ]+))$"
labels_template: "[ \"backport\" ]"
title_template: "[<%= base %>] <%= title %>"
2 changes: 1 addition & 1 deletion DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ deps = {
"third_party/externals/imgui" : "https://skia.googlesource.com/external/github.com/ocornut/imgui.git@55d35d8387c15bf0cfd71861df67af8cfbda7456",
"third_party/externals/libavif" : "https://github.com/AOMediaCodec/libavif.git@f49462dc93784bf34148715eee36ab6697ca0b35",
"third_party/externals/libgav1" : "https://chromium.googlesource.com/codecs/libgav1.git@0fb779c1e169fe6c229cd1fa9cc6ea6feeb441da",
"third_party/externals/libjpeg-turbo" : "https://chromium.googlesource.com/chromium/deps/libjpeg_turbo.git@ed683925e4897a84b3bffc5c1414c85b97a129a3",
"third_party/externals/libjpeg-turbo" : "https://github.com/libjpeg-turbo/libjpeg-turbo.git@6c87537f60941f3c265c339fe60d1e31d2a42ccf",
"third_party/externals/libjxl" : "https://chromium.googlesource.com/external/gitlab.com/wg1/jpeg-xl.git@a205468bc5d3a353fb15dae2398a101dff52f2d3",
"third_party/externals/libpng" : "https://skia.googlesource.com/third_party/libpng.git@f135775ad4e5d4408d2e12ffcc71bb36e6b48551",
"third_party/externals/libwebp" : "https://chromium.googlesource.com/webm/libwebp.git@fd7b5d48464475408d32d2611bdb6947d4246b97",
Expand Down
229 changes: 139 additions & 90 deletions third_party/libjpeg-turbo/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -14,106 +14,155 @@ if (skia_use_system_libjpeg_turbo) {
libs = [ "jpeg" ]
}
} else {
third_party("libjpeg") {
public_include_dirs = [
".",
"../externals/libjpeg-turbo",
]
use_simd_optimizations = false
if (!is_win && (current_cpu == "arm" || current_cpu == "arm64")) {
use_simd_optimizations = true
}

libjpeg_include_dirs = [
".",
"../externals/libjpeg-turbo",
]
libjpeg16_sources = [
"../externals/libjpeg-turbo/jcapistd.c",
"../externals/libjpeg-turbo/jccolor.c",
"../externals/libjpeg-turbo/jcdiffct.c",
"../externals/libjpeg-turbo/jclossls.c",
"../externals/libjpeg-turbo/jcmainct.c",
"../externals/libjpeg-turbo/jcprepct.c",
"../externals/libjpeg-turbo/jcsample.c",
"../externals/libjpeg-turbo/jdapistd.c",
"../externals/libjpeg-turbo/jdcolor.c",
"../externals/libjpeg-turbo/jddiffct.c",
"../externals/libjpeg-turbo/jdlossls.c",
"../externals/libjpeg-turbo/jdmainct.c",
"../externals/libjpeg-turbo/jdpostct.c",
"../externals/libjpeg-turbo/jdsample.c",
"../externals/libjpeg-turbo/jutils.c",
]
libjpeg12_sources = [
"../externals/libjpeg-turbo/jccoefct.c",
"../externals/libjpeg-turbo/jcdctmgr.c",
"../externals/libjpeg-turbo/jdcoefct.c",
"../externals/libjpeg-turbo/jddctmgr.c",
"../externals/libjpeg-turbo/jdmerge.c",
"../externals/libjpeg-turbo/jfdctfst.c",
"../externals/libjpeg-turbo/jfdctint.c",
"../externals/libjpeg-turbo/jidctflt.c",
"../externals/libjpeg-turbo/jidctfst.c",
"../externals/libjpeg-turbo/jidctint.c",
"../externals/libjpeg-turbo/jidctred.c",
"../externals/libjpeg-turbo/jquant1.c",
"../externals/libjpeg-turbo/jquant2.c",
]
libjpeg_sources = [
"../externals/libjpeg-turbo/jcapimin.c",
"../externals/libjpeg-turbo/jchuff.c",
"../externals/libjpeg-turbo/jcicc.c",
"../externals/libjpeg-turbo/jcinit.c",
"../externals/libjpeg-turbo/jclhuff.c",
"../externals/libjpeg-turbo/jcmarker.c",
"../externals/libjpeg-turbo/jcmaster.c",
"../externals/libjpeg-turbo/jcomapi.c",
"../externals/libjpeg-turbo/jcparam.c",
"../externals/libjpeg-turbo/jcphuff.c",
"../externals/libjpeg-turbo/jctrans.c",
"../externals/libjpeg-turbo/jdapimin.c",
"../externals/libjpeg-turbo/jdatadst.c",
"../externals/libjpeg-turbo/jdatasrc.c",
"../externals/libjpeg-turbo/jdhuff.c",
"../externals/libjpeg-turbo/jdicc.c",
"../externals/libjpeg-turbo/jdinput.c",
"../externals/libjpeg-turbo/jdlhuff.c",
"../externals/libjpeg-turbo/jdmarker.c",
"../externals/libjpeg-turbo/jdmaster.c",
"../externals/libjpeg-turbo/jdphuff.c",
"../externals/libjpeg-turbo/jdtrans.c",
"../externals/libjpeg-turbo/jerror.c",
"../externals/libjpeg-turbo/jfdctflt.c",
"../externals/libjpeg-turbo/jmemmgr.c",
"../externals/libjpeg-turbo/jmemnobs.c",
"../externals/libjpeg-turbo/jaricom.c", # WITH_ARITH_ENC or WITH_ARITH_DEC
"../externals/libjpeg-turbo/jcarith.c", # WITH_ARITH_ENC
"../externals/libjpeg-turbo/jdarith.c", # WITH_ARITH_DEC
]

source_set("libjpeg16") {
visibility = [ ":*" ]
defines = [ "BITS_IN_JSAMPLE=16" ]
if (!use_simd_optimizations) {
defines += [ "CPU_NO_SIMD" ]
}
include_dirs = libjpeg_include_dirs
sources = libjpeg16_sources
}

defines = [
"TURBO_FOR_WINDOWS",
source_set("libjpeg12") {
visibility = [ ":*" ]
defines = [ "BITS_IN_JSAMPLE=12" ]
if (!use_simd_optimizations) {
defines += [ "CPU_NO_SIMD" ]
}
include_dirs = libjpeg_include_dirs
sources = libjpeg16_sources + libjpeg12_sources
}

# Add support for arithmetic encoding (C_) and decoding (D_).
# This matches Android. Note that such JPEGs are likely rare, given lack of
# support by major browsers.
"C_ARITH_CODING_SUPPORTED=1",
"D_ARITH_CODING_SUPPORTED=1",
source_set("libjpegsimd") {
visibility = [ ":*" ]
defines = [ "NEON_INTRINSICS" ]
include_dirs = libjpeg_include_dirs
include_dirs += [
"../externals/libjpeg-turbo/simd/arm",
]
sources = [
"../externals/libjpeg-turbo/simd/arm/jccolor-neon.c",
"../externals/libjpeg-turbo/simd/arm/jcgray-neon.c",
"../externals/libjpeg-turbo/simd/arm/jcphuff-neon.c",
"../externals/libjpeg-turbo/simd/arm/jcsample-neon.c",
"../externals/libjpeg-turbo/simd/arm/jdcolor-neon.c",
"../externals/libjpeg-turbo/simd/arm/jdmerge-neon.c",
"../externals/libjpeg-turbo/simd/arm/jdsample-neon.c",
"../externals/libjpeg-turbo/simd/arm/jfdctfst-neon.c",
"../externals/libjpeg-turbo/simd/arm/jfdctint-neon.c",
"../externals/libjpeg-turbo/simd/arm/jidctfst-neon.c",
"../externals/libjpeg-turbo/simd/arm/jidctint-neon.c",
"../externals/libjpeg-turbo/simd/arm/jidctred-neon.c",
"../externals/libjpeg-turbo/simd/arm/jquanti-neon.c",
]
if (current_cpu == "arm") {
sources += [
"../externals/libjpeg-turbo/simd/arm/aarch32/jchuff-neon.c",
"../externals/libjpeg-turbo/simd/arm/aarch32/jsimd.c",
]
} else if (current_cpu == "arm64") {
sources += [
"../externals/libjpeg-turbo/simd/arm/aarch64/jchuff-neon.c",
"../externals/libjpeg-turbo/simd/arm/aarch64/jsimd.c",
]
}
}

third_party("libjpeg") {
public_include_dirs = libjpeg_include_dirs

defines = []
if (!is_win || is_clang) {
defines += [ "USE_CLZ_INTRINSIC" ] # Cuts a 64K table.
}
if (!use_simd_optimizations) {
defines += [ "CPU_NO_SIMD" ]
}

sources = [
"../externals/libjpeg-turbo/jaricom.c",
"../externals/libjpeg-turbo/jcapimin.c",
"../externals/libjpeg-turbo/jcapistd.c",
"../externals/libjpeg-turbo/jcarith.c",
"../externals/libjpeg-turbo/jccoefct.c",
"../externals/libjpeg-turbo/jccolor.c",
"../externals/libjpeg-turbo/jcdctmgr.c",
"../externals/libjpeg-turbo/jchuff.c",
"../externals/libjpeg-turbo/jcinit.c",
"../externals/libjpeg-turbo/jcmainct.c",
"../externals/libjpeg-turbo/jcmarker.c",
"../externals/libjpeg-turbo/jcmaster.c",
"../externals/libjpeg-turbo/jcomapi.c",
"../externals/libjpeg-turbo/jcparam.c",
"../externals/libjpeg-turbo/jcphuff.c",
"../externals/libjpeg-turbo/jcprepct.c",
"../externals/libjpeg-turbo/jcsample.c",
"../externals/libjpeg-turbo/jdapimin.c",
"../externals/libjpeg-turbo/jdapistd.c",
"../externals/libjpeg-turbo/jdarith.c",
"../externals/libjpeg-turbo/jdcoefct.c",
"../externals/libjpeg-turbo/jdcolor.c",
"../externals/libjpeg-turbo/jddctmgr.c",
"../externals/libjpeg-turbo/jdhuff.c",
"../externals/libjpeg-turbo/jdinput.c",
"../externals/libjpeg-turbo/jdmainct.c",
"../externals/libjpeg-turbo/jdmarker.c",
"../externals/libjpeg-turbo/jdmaster.c",
"../externals/libjpeg-turbo/jdmerge.c",
"../externals/libjpeg-turbo/jdphuff.c",
"../externals/libjpeg-turbo/jdpostct.c",
"../externals/libjpeg-turbo/jdsample.c",
"../externals/libjpeg-turbo/jerror.c",
"../externals/libjpeg-turbo/jfdctflt.c",
"../externals/libjpeg-turbo/jfdctfst.c",
"../externals/libjpeg-turbo/jfdctint.c",
"../externals/libjpeg-turbo/jidctflt.c",
"../externals/libjpeg-turbo/jidctfst.c",
"../externals/libjpeg-turbo/jidctint.c",
"../externals/libjpeg-turbo/jidctred.c",
"../externals/libjpeg-turbo/jmemmgr.c",
"../externals/libjpeg-turbo/jmemnobs.c",
"../externals/libjpeg-turbo/jpeg_nbits_table.c",
"../externals/libjpeg-turbo/jquant1.c",
"../externals/libjpeg-turbo/jquant2.c",
"../externals/libjpeg-turbo/jutils.c",
]
sources = libjpeg16_sources + libjpeg12_sources + libjpeg_sources

if (!is_win && (current_cpu == "arm" || current_cpu == "arm64")) {
defines += [ "NEON_INTRINSICS" ]
sources += [
"../externals/libjpeg-turbo/simd/arm/jccolor-neon.c",
"../externals/libjpeg-turbo/simd/arm/jcgray-neon.c",
"../externals/libjpeg-turbo/simd/arm/jcphuff-neon.c",
"../externals/libjpeg-turbo/simd/arm/jcsample-neon.c",
"../externals/libjpeg-turbo/simd/arm/jdcolor-neon.c",
"../externals/libjpeg-turbo/simd/arm/jdmerge-neon.c",
"../externals/libjpeg-turbo/simd/arm/jdsample-neon.c",
"../externals/libjpeg-turbo/simd/arm/jfdctfst-neon.c",
"../externals/libjpeg-turbo/simd/arm/jfdctint-neon.c",
"../externals/libjpeg-turbo/simd/arm/jidctfst-neon.c",
"../externals/libjpeg-turbo/simd/arm/jidctint-neon.c",
"../externals/libjpeg-turbo/simd/arm/jidctred-neon.c",
"../externals/libjpeg-turbo/simd/arm/jquanti-neon.c",
deps = [
":libjpeg16",
":libjpeg12",
]
if (use_simd_optimizations) {
deps += [
":libjpegsimd",
]
include_dirs = [ "../externals/libjpeg-turbo/simd/arm" ]
if (current_cpu == "arm") {
sources += [
"../externals/libjpeg-turbo/simd/arm/aarch32/jchuff-neon.c",
"../externals/libjpeg-turbo/simd/arm/aarch32/jsimd.c",
]
} else if (current_cpu == "arm64") {
sources += [
"../externals/libjpeg-turbo/simd/arm/aarch64/jchuff-neon.c",
"../externals/libjpeg-turbo/simd/arm/aarch64/jsimd.c",
]
}
} else {
sources += [ "../externals/libjpeg-turbo/jsimd_none.c" ]
}
}
}
Loading

0 comments on commit 070307c

Please sign in to comment.