Skip to content

Commit 2c8b212

Browse files
Feature/fonts (#7049)
This brings Skia porting classes from C25 to the main branch with small edits (mostly type updates) and changes callsites to not assume we're using fontconfig/linux-style font classes. Bug: 428969097
1 parent 225559d commit 2c8b212

57 files changed

Lines changed: 3963 additions & 113 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

base/test/BUILD.gn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ static_library("test_support") {
208208
]
209209
}
210210

211-
if (is_linux || is_chromeos) {
211+
if (is_linux && !is_cobalt_hermetic_build || is_chromeos) {
212212
sources += [ "test_file_util_linux.cc" ]
213213
public_deps += [ "//third_party/test_fonts/fontconfig:test_support" ]
214214
}

base/test/test_suite.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,7 @@ void TestSuite::Initialize() {
657657
// TODO(jshin): Should we set the locale via an OS X locale API here?
658658
i18n::SetICUDefaultLocale("en_US");
659659

660-
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
660+
#if BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_COBALT_HERMETIC_BUILD) || BUILDFLAG(IS_CHROMEOS)
661661
test_fonts::SetUpFontconfig();
662662
#endif
663663

cobalt/browser/h5vcc_system/BUILD.gn

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
import("//starboard/build/buildflags.gni")
16-
1715
source_set("h5vcc_system") {
1816
sources = [
1917
"h5vcc_system_impl.cc",
@@ -30,10 +28,6 @@ source_set("h5vcc_system") {
3028
]
3129

3230
if (is_starboard) {
33-
sources += [
34-
"configuration.cc",
35-
"configuration.h",
36-
]
37-
deps += [ "//starboard:starboard_headers_only" ]
31+
deps += [ "//cobalt/configuration" ]
3832
}
3933
}

cobalt/browser/h5vcc_system/h5vcc_system_impl.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ using starboard::android::shared::StarboardBridge;
2626
#endif
2727

2828
#if BUILDFLAG(IS_STARBOARD)
29-
#include "cobalt/browser/h5vcc_system/configuration.h"
29+
#include "cobalt/configuration/configuration.h"
3030
#include "starboard/common/system_property.h"
3131
#include "starboard/system.h"
3232
#endif

cobalt/configuration/BUILD.gn

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Copyright 2025 The Cobalt Authors. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
source_set("configuration") {
16+
sources = [
17+
"configuration.cc",
18+
"configuration.h",
19+
]
20+
deps = [
21+
"//base",
22+
"//starboard:starboard_group",
23+
]
24+
}

cobalt/browser/h5vcc_system/configuration.cc renamed to cobalt/configuration/configuration.cc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#include "cobalt/browser/h5vcc_system/configuration.h"
15+
#include "cobalt/configuration/configuration.h"
1616

1717
#include <string>
1818

@@ -51,5 +51,12 @@ Configuration::UserOnExitStrategy Configuration::CobaltUserOnExitStrategy() {
5151
#endif
5252
}
5353

54+
int Configuration::CobaltLocalTypefaceCacheSizeInBytes() {
55+
if (configuration_api_) {
56+
return configuration_api_->CobaltSkiaCacheSizeInBytes();
57+
}
58+
return 1024 * 1024 * 16;
59+
}
60+
5461
} // namespace configuration
5562
} // namespace cobalt

cobalt/browser/h5vcc_system/configuration.h renamed to cobalt/configuration/configuration.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ class Configuration {
4141
static Configuration* GetInstance();
4242

4343
UserOnExitStrategy CobaltUserOnExitStrategy();
44+
int CobaltLocalTypefaceCacheSizeInBytes();
4445

4546
private:
4647
Configuration();

0 commit comments

Comments
 (0)