Skip to content

Commit

Permalink
Revert "Remove and disable next Skia version for Cobalt 23"
Browse files Browse the repository at this point in the history
This reverts commit 53b50e6.

b/304784019
  • Loading branch information
sherryzy committed Oct 12, 2023
1 parent 2e52587 commit c8849b4
Show file tree
Hide file tree
Showing 9,085 changed files with 1,528,020 additions and 9 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
12 changes: 4 additions & 8 deletions cobalt/renderer/rasterizer/skia/skia/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,15 @@ skia_common("skia_library_no_asan") {
sources = skia_effects_imagefilter_sources_no_asan
if (use_skia_next) {
include_dirs = [ skia_include_dir ]
defines = [
"USE_SKIA_NEXT",
"SKIA_STRUCTURED_BINDINGS_BACKPORT",
]
defines = [ "USE_SKIA_NEXT" ]
if (is_clang) {
if (using_old_compiler) {
cflags_cc = [ "-Wno-c++1z-extensions" ]
} else {
cflags_cc = [
"-Wno-c++17-extensions",
"-Wno-invalid-offsetof",
"-Wno-psabi",
]
}
}
Expand Down Expand Up @@ -93,17 +91,15 @@ config("skia_library_config_public") {
defines = [ "SK_BUILD_NO_OPTS" ]

if (use_skia_next) {
defines += [
"USE_SKIA_NEXT",
"SKIA_STRUCTURED_BINDINGS_BACKPORT",
]
defines += [ "USE_SKIA_NEXT" ]
if (is_clang) {
if (using_old_compiler) {
cflags_cc = [ "-Wno-c++1z-extensions" ]
} else {
cflags_cc = [
"-Wno-c++17-extensions",
"-Wno-invalid-offsetof",
"-Wno-psabi",
]
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,13 @@ SkFontStyleSet_Cobalt::SkFontStyleSet_Cobalt(
// to 4 axes, and although OpenType font variations may have more, they tend
// not to -- it's usually just weight, width, and slant. But just in case,
// use a relatively high reservation.
#ifdef USE_SKIA_NEXT
computed_variation_position.reserve_back(16);
axis_definitions.reserve_back(16);
#else
computed_variation_position.reserve(16);
axis_definitions.reserve(16);
#endif

for (int i = 0; i < family_info.fonts.count(); ++i) {
const FontFileInfo& font_file = family_info.fonts[i];
Expand Down
2 changes: 1 addition & 1 deletion starboard/build/config/base_configuration.gni
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ declare_args() {
# Enables an NPLB audit of C++17 support.
sb_enable_cpp17_audit = true

# Flag to use a future version of Skia, currently not available.
# Set to true to use Skia m97.
use_skia_next = false

# Enable when using clang 16.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,7 @@ if (current_toolchain == default_toolchain &&

sb_enable_cpp17_audit = false

use_skia_next = true

v8_enable_webassembly = false
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@
# limitations under the License.

import("//starboard/linux/x64x11/platform_configuration/configuration.gni")

use_skia_next = true
23 changes: 23 additions & 0 deletions third_party/skia_next/METADATA
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: "skia"
description:
"Skia is an open-source graphics library for drawing, geometries, and "
"images, with both hardware and software support. Cobalt most recently "
"updated its version of Skia from m79 to m97."

third_party {
url {
type: GIT
value: "https://skia.googlesource.com/skia"
}
version: "b4d28b2f35396ae4dd69338254415066629dfd25"
last_upgrade_date {
year: 2023
month: 10
day: 12
}
license_type: NOTICE
local_modifications:
"The current nested third_party/skia_next/third_party/skia is used to "
"support existing include paths without significant modification and is a "
"temporary measure during migration."
}
6 changes: 6 additions & 0 deletions third_party/skia_next/third_party/skia/.bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
build:clang --crosstool_top=//toolchain:clang_suite
build:clang --compiler=clang

# Use the default Bazel C++ toolchain to build the tools used during the
# build.
build:clang --host_crosstool_top=@bazel_tools//tools/cpp:toolchain
196 changes: 196 additions & 0 deletions third_party/skia_next/third_party/skia/.clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
---
# Typical usage is to apply this to the lines you've modified in a local
# change. Stage your changes with "git add" and then run:
# $ git clang-format
# You can optionally use the "--" file filter to restrict formatting to certain
# files or directories. The tool will display the list of files that were
# modified. These have been modified without being staged. You can review the
# modifications using "git diff".
#
# IF YOU UPDATE THE CPP SECTION ALSO UPDATE THE OBJECTIVE-C SECTION. IF YOU
# KNOW HOW TO SHARE SETTINGS BETWEEN THE TWO YOU'RE A TRUE HERO.

Language: Cpp
# BasedOnStyle: Google
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: true
AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: false
BinPackArguments: false
BinPackParameters: false
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: true
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 100
CommentPragmas: '^ IWYU pragma:'
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 8
ContinuationIndentWidth: 8
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
IncludeCategories:
- Regex: '^<.*\.h>'
Priority: 1
- Regex: '^<.*'
Priority: 2
- Regex: '.*'
Priority: 3
IncludeIsMainRegex: '([-_](test|unittest))?$'
IndentCaseLabels: true
IndentWidth: 4
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: false
PenaltyBreakBeforeFirstCallParameter: 1
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200
PointerAlignment: Left
ReflowComments: true
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Auto
TabWidth: 4
UseTab: Never
---
Language: ObjC
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: true
AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: false
BinPackArguments: false
BinPackParameters: false
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: true
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 100
CommentPragmas: '^ IWYU pragma:'
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 8
ContinuationIndentWidth: 8
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
IncludeCategories:
- Regex: '^<.*\.h>'
Priority: 1
- Regex: '^<.*'
Priority: 2
- Regex: '.*'
Priority: 3
IncludeIsMainRegex: '([-_](test|unittest))?$'
IndentCaseLabels: true
IndentWidth: 4
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: false
PenaltyBreakBeforeFirstCallParameter: 1
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200
PointerAlignment: Left
ReflowComments: true
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Auto
TabWidth: 4
UseTab: Never
...

25 changes: 25 additions & 0 deletions third_party/skia_next/third_party/skia/.clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Checks: >
-*,
bugprone-argument-comment,
bugprone-bool-pointer-implicit-conversion,
bugprone-suspicious-string-compare,
bugprone-undelegated-constructor,
bugprone-unused-raii,
bugprone-use-after-move,
google-build-namespaces,
llvm-namespace-comment,
misc-definitions-in-headers,
modernize-make-unique,
modernize-use-nullptr,
modernize-use-override,
performance-for-range-copy,
performance-unnecessary-copy-initialization,
readability-const-return-type,
readability-redundant-preprocessor,
readability-redundant-smartptr-get,
readability-static-accessed-through-instance
CheckOptions:
- key: llvm-namespace-comment.ShortNamespaceLines
value: 40
- key: llvm-namespace-comment.SpacesBeforeComments
value: 2
55 changes: 55 additions & 0 deletions third_party/skia_next/third_party/skia/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
*.pyc
*.swp
*.iml
.DS_Store
.android_config
.gclient*
.gradle
.idea
.cproject
.project
.recipe_deps/
.settings/
.vscode/
.win_toolchain/
TAGS
bower_components
imgui.ini
infra/bots/gen_tasks_aux.go
infra/bots/tools/luci-go/linux64/cipd
infra/bots/tools/luci-go/linux64/isolate
infra/bots/tools/luci-go/mac64/cipd
infra/bots/tools/luci-go/mac64/isolate
infra/bots/tools/luci-go/win64/cipd.exe
infra/bots/tools/luci-go/win64/isolate.exe
out
platform_tools/android/apps/build
platform_tools/android/apps/*.properties
platform_tools/android/apps/*/build
platform_tools/android/apps/*/src/main/libs
platform_tools/android/apps/*/*/src/main/libs
platform_tools/android/apps/*.hprof
platform_tools/android/apps/*/.externalNativeBuild

/mskps
/skps
/svgs
tools/skp/page_sets/data/*.json
tools/skp/page_sets/data/*.wpr

common
buildtools
third_party/externals

bin/gn
bin/gn.exe
bin/clang-format
bin/clang-format.exe
bin/sk
bin/sk.exe
bin/sk.version

node_modules
tools/lottiecap/filmstrip.png

bazel-*
5 changes: 5 additions & 0 deletions third_party/skia_next/third_party/skia/.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
buildconfig = "//gn/BUILDCONFIG.gn"

default_args = {
angle_standalone = false
}
1 change: 1 addition & 0 deletions third_party/skia_next/third_party/skia/.vpython
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python_version: "3.8"
Loading

0 comments on commit c8849b4

Please sign in to comment.