Skip to content

Commit 5592f9e

Browse files
author
bors-servo
authored
Auto merge of #2299 - faern:upgrade-core-foundation, r=jrmuizel
Upgrade core foundation This is a PR in a series of PRs originating at servo/core-foundation-rs#132 The plan is to make a breaking change to `core-foundation` and release it as `0.5.0`. Hopefully we can manage to bring Servo and its entire dependency tree up to date as rapidly as possible in combination with this, as to use only the new core-foundation in Servo and all its deps. :) TODO before merge: - [x] Merge `core-foundation`, `core-graphics`, `core-text`, `servo-glutin` PRs and publish. - [x] Merge `font-loader` PR and publish. - [x] Remove the last commit from this PR, so we depend on code from crates.io. - [x] Update Cargo.lock again, to not contain urls to temporary feature branhces. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/webrender/2299) <!-- Reviewable:end -->
2 parents 1d8157c + f773b62 commit 5592f9e

File tree

6 files changed

+89
-103
lines changed

6 files changed

+89
-103
lines changed

Cargo.lock

Lines changed: 65 additions & 79 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webrender/Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "webrender"
3-
version = "0.56.1"
3+
version = "0.57.0"
44
authors = ["Glenn Watson <[email protected]>"]
55
license = "MPL-2.0"
66
repository = "https://github.com/servo/webrender"
@@ -42,7 +42,7 @@ ron = { optional = true, version = "0.1.7" }
4242
angle = {git = "https://github.com/servo/angle", branch = "servo"}
4343
env_logger = "0.4"
4444
rand = "0.3" # for the benchmarks
45-
servo-glutin = "0.13" # for the example apps
45+
servo-glutin = "0.14" # for the example apps
4646

4747
[target.'cfg(any(target_os = "android", all(unix, not(target_os = "macos"))))'.dependencies]
4848
freetype = { version = "0.3", default-features = false }
@@ -51,6 +51,6 @@ freetype = { version = "0.3", default-features = false }
5151
dwrote = "0.4.1"
5252

5353
[target.'cfg(target_os = "macos")'.dependencies]
54-
core-foundation = "0.4.6"
55-
core-graphics = "0.12.3"
56-
core-text = { version = "8.0", default-features = false }
54+
core-foundation = "0.5"
55+
core-graphics = "0.13"
56+
core-text = { version = "9.0", default-features = false }

webrender/src/platform/macos/font.rs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use api::{GlyphKey, SubpixelDirection};
88
use app_units::Au;
99
use core_foundation::array::{CFArray, CFArrayRef};
1010
use core_foundation::base::TCFType;
11-
use core_foundation::dictionary::{CFDictionary, CFDictionaryRef};
11+
use core_foundation::dictionary::CFDictionary;
1212
use core_foundation::number::{CFNumber, CFNumberRef};
1313
use core_foundation::string::{CFString, CFStringRef};
1414
use core_graphics::base::{kCGImageAlphaNoneSkipFirst, kCGImageAlphaPremultipliedFirst};
@@ -171,17 +171,16 @@ fn new_ct_font_with_variations(cg_font: &CGFont, size: f64, variations: &[FontVa
171171
if axes_ref.is_null() {
172172
return ct_font;
173173
}
174-
let axes: CFArray = TCFType::wrap_under_create_rule(axes_ref);
174+
let axes: CFArray<CFDictionary> = TCFType::wrap_under_create_rule(axes_ref);
175175
let mut vals: Vec<(CFString, CFNumber)> = Vec::with_capacity(variations.len() as usize);
176-
for axis_ptr in axes.iter() {
177-
let axis: CFDictionary = TCFType::wrap_under_get_rule(axis_ptr as CFDictionaryRef);
178-
if !axis.instance_of::<CFDictionaryRef, CFDictionary>() {
176+
for axis in axes.iter() {
177+
if !axis.instance_of::<CFDictionary>() {
179178
return ct_font;
180179
}
181180
let tag_val = match axis.find(kCTFontVariationAxisIdentifierKey as *const _) {
182181
Some(tag_ptr) => {
183182
let tag: CFNumber = TCFType::wrap_under_get_rule(tag_ptr as CFNumberRef);
184-
if !tag.instance_of::<CFNumberRef, CFNumber>() {
183+
if !tag.instance_of::<CFNumber>() {
185184
return ct_font;
186185
}
187186
match tag.to_i64() {
@@ -200,14 +199,14 @@ fn new_ct_font_with_variations(cg_font: &CGFont, size: f64, variations: &[FontVa
200199
Some(name_ptr) => TCFType::wrap_under_get_rule(name_ptr as CFStringRef),
201200
None => return ct_font,
202201
};
203-
if !name.instance_of::<CFStringRef, CFString>() {
202+
if !name.instance_of::<CFString>() {
204203
return ct_font;
205204
}
206205

207206
let min_val = match axis.find(kCTFontVariationAxisMinimumValueKey as *const _) {
208207
Some(min_ptr) => {
209208
let min: CFNumber = TCFType::wrap_under_get_rule(min_ptr as CFNumberRef);
210-
if !min.instance_of::<CFNumberRef, CFNumber>() {
209+
if !min.instance_of::<CFNumber>() {
211210
return ct_font;
212211
}
213212
match min.to_f64() {
@@ -220,7 +219,7 @@ fn new_ct_font_with_variations(cg_font: &CGFont, size: f64, variations: &[FontVa
220219
let max_val = match axis.find(kCTFontVariationAxisMaximumValueKey as *const _) {
221220
Some(max_ptr) => {
222221
let max: CFNumber = TCFType::wrap_under_get_rule(max_ptr as CFNumberRef);
223-
if !max.instance_of::<CFNumberRef, CFNumber>() {
222+
if !max.instance_of::<CFNumber>() {
224223
return ct_font;
225224
}
226225
match max.to_f64() {
@@ -233,7 +232,7 @@ fn new_ct_font_with_variations(cg_font: &CGFont, size: f64, variations: &[FontVa
233232
let def_val = match axis.find(kCTFontVariationAxisDefaultValueKey as *const _) {
234233
Some(def_ptr) => {
235234
let def: CFNumber = TCFType::wrap_under_get_rule(def_ptr as CFNumberRef);
236-
if !def.instance_of::<CFNumberRef, CFNumber>() {
235+
if !def.instance_of::<CFNumber>() {
237236
return ct_font;
238237
}
239238
match def.to_f64() {

webrender_api/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "webrender_api"
3-
version = "0.56.1"
3+
version = "0.57.0"
44
authors = ["Glenn Watson <[email protected]>"]
55
license = "MPL-2.0"
66
repository = "https://github.com/servo/webrender"
@@ -22,8 +22,8 @@ serde_derive = { version = "=1.0.27", features = ["deserialize_in_place"] }
2222
time = "0.1"
2323

2424
[target.'cfg(target_os = "macos")'.dependencies]
25-
core-foundation = "0.4.6"
26-
core-graphics = "0.12.3"
25+
core-foundation = "0.5"
26+
core-graphics = "0.13"
2727

2828
[target.'cfg(target_os = "windows")'.dependencies]
2929
dwrote = "0.4.1"

wrench/Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "wrench"
3-
version = "0.2.6"
3+
version = "0.3.0"
44
authors = ["Vladimir Vukicevic <[email protected]>"]
55
build = "build.rs"
66
license = "MPL-2.0"
@@ -12,7 +12,7 @@ byteorder = "1.0"
1212
env_logger = { version = "0.4", optional = true }
1313
euclid = "0.16"
1414
gleam = "0.4"
15-
servo-glutin = "0.13"
15+
servo-glutin = "0.14"
1616
app_units = "0.6"
1717
image = "0.17"
1818
clap = { version = "2", features = ["yaml"] }
@@ -30,8 +30,8 @@ webrender_api = {path = "../webrender_api", features=["debug-serialization"]}
3030
serde = {version = "1.0", features = ["derive"] }
3131

3232
[target.'cfg(target_os = "macos")'.dependencies]
33-
core-graphics = "0.12.4"
34-
core-foundation = "0.4"
33+
core-graphics = "0.13"
34+
core-foundation = "0.5"
3535

3636
[features]
3737
headless = [ "osmesa-sys", "osmesa-src" ]
@@ -41,4 +41,4 @@ logging = [ "env_logger" ]
4141
dwrote = "0.4.1"
4242

4343
[target.'cfg(any(target_os = "linux", target_os = "macos"))'.dependencies]
44-
font-loader = "0.5"
44+
font-loader = "0.6"

wrench/src/cgfont_to_data.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ pub fn font_to_data(font: CGFont) -> Result<Vec<u8>, std::io::Error> {
5858
let mut offset: u32 = 0;
5959
offset += 4 * 3;
6060
offset += 4 * 4 * (count as u32);
61-
for tag in tags.iter() {
61+
for tag_ref in tags.iter() {
62+
let tag = *tag_ref;
6263
if tag == CFF_TAG {
6364
cff = true;
6465
}

0 commit comments

Comments
 (0)