mirror of
https://github.com/servo/servo.git
synced 2025-08-08 06:55:31 +01:00
Auto merge of #7559 - ddrmanxbxfr:RFC-0344-Work, r=nox
Remove 'get_*' on getters as per RFC 0344 on canevas, compositing, devtools, gfx, layout, net, profile, servo and webdriver_server Hi guys, I just gave a big pass of RFC-0344 as per issue #6224 . Pretty much renamed all the get_* fn that were used to fetch values. I hope I didn't rename too much. As said in the issue discussion, I didn't touch at the scripts folder so we keep the unsafe ones pretty explicit. I've ran the whole pass of test, everything seems to be still working right :). Please give feedback on this PR. Thanks for looking into it. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7559) <!-- Reviewable:end -->
This commit is contained in:
commit
b05f4aa3aa
30 changed files with 167 additions and 168 deletions
|
@ -242,7 +242,7 @@ impl<'a> DetailedGlyphStore {
|
|||
self.lookup_is_sorted = false;
|
||||
}
|
||||
|
||||
fn get_detailed_glyphs_for_entry(&'a self, entry_offset: CharIndex, count: u16)
|
||||
fn detailed_glyphs_for_entry(&'a self, entry_offset: CharIndex, count: u16)
|
||||
-> &'a [DetailedGlyph] {
|
||||
debug!("Requesting detailed glyphs[n={}] for entry[off={:?}]", count, entry_offset);
|
||||
|
||||
|
@ -268,7 +268,7 @@ impl<'a> DetailedGlyphStore {
|
|||
&self.detail_buffer[i .. i + count as usize]
|
||||
}
|
||||
|
||||
fn get_detailed_glyph_with_index(&'a self,
|
||||
fn detailed_glyph_with_index(&'a self,
|
||||
entry_offset: CharIndex,
|
||||
detail_offset: u16)
|
||||
-> &'a DetailedGlyph {
|
||||
|
@ -361,7 +361,7 @@ impl<'a> GlyphInfo<'a> {
|
|||
match self {
|
||||
GlyphInfo::Simple(store, entry_i) => store.entry_buffer[entry_i.to_usize()].id(),
|
||||
GlyphInfo::Detail(store, entry_i, detail_j) => {
|
||||
store.detail_store.get_detailed_glyph_with_index(entry_i, detail_j).id
|
||||
store.detail_store.detailed_glyph_with_index(entry_i, detail_j).id
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -372,7 +372,7 @@ impl<'a> GlyphInfo<'a> {
|
|||
match self {
|
||||
GlyphInfo::Simple(store, entry_i) => store.entry_buffer[entry_i.to_usize()].advance(),
|
||||
GlyphInfo::Detail(store, entry_i, detail_j) => {
|
||||
store.detail_store.get_detailed_glyph_with_index(entry_i, detail_j).advance
|
||||
store.detail_store.detailed_glyph_with_index(entry_i, detail_j).advance
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -381,7 +381,7 @@ impl<'a> GlyphInfo<'a> {
|
|||
match self {
|
||||
GlyphInfo::Simple(_, _) => None,
|
||||
GlyphInfo::Detail(store, entry_i, detail_j) => {
|
||||
Some(store.detail_store.get_detailed_glyph_with_index(entry_i, detail_j).offset)
|
||||
Some(store.detail_store.detailed_glyph_with_index(entry_i, detail_j).offset)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -672,7 +672,7 @@ impl<'a> GlyphIterator<'a> {
|
|||
#[inline(never)]
|
||||
fn next_complex_glyph(&mut self, entry: &GlyphEntry, i: CharIndex)
|
||||
-> Option<(CharIndex, GlyphInfo<'a>)> {
|
||||
let glyphs = self.store.detail_store.get_detailed_glyphs_for_entry(i, entry.glyph_count());
|
||||
let glyphs = self.store.detail_store.detailed_glyphs_for_entry(i, entry.glyph_count());
|
||||
self.glyph_range = Some(range::each_index(CharIndex(0), CharIndex(glyphs.len() as isize)));
|
||||
self.next()
|
||||
}
|
||||
|
|
|
@ -103,7 +103,7 @@ impl ShapedGlyphData {
|
|||
}
|
||||
|
||||
/// Returns shaped glyph data for one glyph, and updates the y-position of the pen.
|
||||
pub fn get_entry_for_glyph(&self, i: usize, y_pos: &mut Au) -> ShapedGlyphEntry {
|
||||
pub fn entry_for_glyph(&self, i: usize, y_pos: &mut Au) -> ShapedGlyphEntry {
|
||||
assert!(i < self.count);
|
||||
|
||||
unsafe {
|
||||
|
@ -170,7 +170,7 @@ impl Shaper {
|
|||
options: *options,
|
||||
};
|
||||
let hb_face: *mut hb_face_t =
|
||||
RUST_hb_face_create_for_tables(get_font_table_func,
|
||||
RUST_hb_face_create_for_tables(font_table_func,
|
||||
(&mut *font_and_shaping_options)
|
||||
as *mut FontAndShapingOptions
|
||||
as *mut c_void,
|
||||
|
@ -448,7 +448,7 @@ impl Shaper {
|
|||
if is_bidi_control(character) {
|
||||
glyphs.add_nonglyph_for_char_index(char_idx, false, false);
|
||||
} else {
|
||||
let shape = glyph_data.get_entry_for_glyph(glyph_span.begin(), &mut y_pos);
|
||||
let shape = glyph_data.entry_for_glyph(glyph_span.begin(), &mut y_pos);
|
||||
let advance = self.advance_for_shaped_glyph(shape.advance, character, options);
|
||||
let data = GlyphData::new(shape.codepoint,
|
||||
advance,
|
||||
|
@ -463,7 +463,7 @@ impl Shaper {
|
|||
let mut datas = vec!();
|
||||
|
||||
for glyph_i in glyph_span.each_index() {
|
||||
let shape = glyph_data.get_entry_for_glyph(glyph_i, &mut y_pos);
|
||||
let shape = glyph_data.entry_for_glyph(glyph_i, &mut y_pos);
|
||||
datas.push(GlyphData::new(shape.codepoint,
|
||||
shape.advance,
|
||||
shape.offset,
|
||||
|
@ -601,7 +601,7 @@ extern fn glyph_h_kerning_func(_: *mut hb_font_t,
|
|||
}
|
||||
|
||||
// Callback to get a font table out of a font.
|
||||
extern fn get_font_table_func(_: *mut hb_face_t,
|
||||
extern fn font_table_func(_: *mut hb_face_t,
|
||||
tag: hb_tag_t,
|
||||
user_data: *mut c_void)
|
||||
-> *mut hb_blob_t {
|
||||
|
@ -613,7 +613,7 @@ extern fn get_font_table_func(_: *mut hb_face_t,
|
|||
assert!(!(*font_and_shaping_options).font.is_null());
|
||||
|
||||
// TODO(Issue #197): reuse font table data, which will change the unsound trickery here.
|
||||
match (*(*font_and_shaping_options).font).get_table_for_tag(tag as FontTableTag) {
|
||||
match (*(*font_and_shaping_options).font).table_for_tag(tag as FontTableTag) {
|
||||
None => ptr::null_mut(),
|
||||
Some(font_table) => {
|
||||
// `Box::into_raw` intentionally leaks the FontTable so we don't destroy the buffer
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue