mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Move ByteIndex to gfx_traits.
This commit is contained in:
parent
c270622bfd
commit
e5cab36671
5 changed files with 19 additions and 8 deletions
|
@ -11,6 +11,8 @@ use std::cmp::{Ordering, PartialOrd};
|
|||
use std::vec::Vec;
|
||||
use std::{fmt, mem, u16};
|
||||
|
||||
pub use gfx_traits::ByteIndex;
|
||||
|
||||
/// GlyphEntry is a port of Gecko's CompressedGlyph scheme for storing glyph data compactly.
|
||||
///
|
||||
/// In the common case (reasonable glyph advances, no offsets from the font em-box, and one glyph
|
||||
|
@ -426,14 +428,6 @@ pub struct GlyphStore {
|
|||
is_rtl: bool,
|
||||
}
|
||||
|
||||
int_range_index! {
|
||||
#[derive(Deserialize, Serialize, RustcEncodable)]
|
||||
#[doc = "An index that refers to a byte offset in a text run. This could \
|
||||
point to the middle of a glyph."]
|
||||
#[derive(HeapSizeOf)]
|
||||
struct ByteIndex(isize)
|
||||
}
|
||||
|
||||
impl<'a> GlyphStore {
|
||||
/// Initializes the glyph store, but doesn't actually shape anything.
|
||||
///
|
||||
|
|
|
@ -13,6 +13,8 @@ azure = {git = "https://github.com/servo/rust-azure", features = ["plugins"]}
|
|||
layers = {git = "https://github.com/servo/rust-layers", features = ["plugins"]}
|
||||
msg = {path = "../msg"}
|
||||
plugins = {path = "../plugins"}
|
||||
range = {path = "../range"}
|
||||
rustc-serialize = "0.3"
|
||||
euclid = {version = "0.6.5", features = ["plugins"]}
|
||||
heapsize = "0.3.0"
|
||||
heapsize_plugin = "0.1.2"
|
||||
|
|
|
@ -15,6 +15,9 @@ extern crate euclid;
|
|||
extern crate heapsize;
|
||||
extern crate layers;
|
||||
extern crate msg;
|
||||
#[macro_use]
|
||||
extern crate range;
|
||||
extern crate rustc_serialize;
|
||||
extern crate serde;
|
||||
|
||||
pub mod color;
|
||||
|
@ -25,6 +28,7 @@ use azure::azure_hl::Color;
|
|||
use euclid::Matrix4D;
|
||||
use euclid::rect::Rect;
|
||||
use msg::constellation_msg::PipelineId;
|
||||
use range::RangeIndex;
|
||||
use std::fmt::{self, Debug, Formatter};
|
||||
use std::sync::atomic::{ATOMIC_USIZE_INIT, AtomicUsize, Ordering};
|
||||
|
||||
|
@ -255,3 +259,10 @@ impl FragmentType {
|
|||
}
|
||||
}
|
||||
|
||||
int_range_index! {
|
||||
#[derive(Deserialize, Serialize, RustcEncodable)]
|
||||
#[doc = "An index that refers to a byte offset in a text run. This could \
|
||||
point to the middle of a glyph."]
|
||||
#[derive(HeapSizeOf)]
|
||||
struct ByteIndex(isize)
|
||||
}
|
||||
|
|
2
components/servo/Cargo.lock
generated
2
components/servo/Cargo.lock
generated
|
@ -814,6 +814,8 @@ dependencies = [
|
|||
"layers 0.2.5 (git+https://github.com/servo/rust-layers)",
|
||||
"msg 0.0.1",
|
||||
"plugins 0.0.1",
|
||||
"range 0.0.1",
|
||||
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_macros 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
|
2
ports/cef/Cargo.lock
generated
2
ports/cef/Cargo.lock
generated
|
@ -727,6 +727,8 @@ dependencies = [
|
|||
"layers 0.2.5 (git+https://github.com/servo/rust-layers)",
|
||||
"msg 0.0.1",
|
||||
"plugins 0.0.1",
|
||||
"range 0.0.1",
|
||||
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_macros 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue