Move ByteIndex to gfx_traits.

This commit is contained in:
Ms2ger 2016-06-14 16:05:08 +01:00
parent c270622bfd
commit e5cab36671
5 changed files with 19 additions and 8 deletions

View file

@ -11,6 +11,8 @@ use std::cmp::{Ordering, PartialOrd};
use std::vec::Vec; use std::vec::Vec;
use std::{fmt, mem, u16}; use std::{fmt, mem, u16};
pub use gfx_traits::ByteIndex;
/// GlyphEntry is a port of Gecko's CompressedGlyph scheme for storing glyph data compactly. /// 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 /// 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, 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 { impl<'a> GlyphStore {
/// Initializes the glyph store, but doesn't actually shape anything. /// Initializes the glyph store, but doesn't actually shape anything.
/// ///

View file

@ -13,6 +13,8 @@ azure = {git = "https://github.com/servo/rust-azure", features = ["plugins"]}
layers = {git = "https://github.com/servo/rust-layers", features = ["plugins"]} layers = {git = "https://github.com/servo/rust-layers", features = ["plugins"]}
msg = {path = "../msg"} msg = {path = "../msg"}
plugins = {path = "../plugins"} plugins = {path = "../plugins"}
range = {path = "../range"}
rustc-serialize = "0.3"
euclid = {version = "0.6.5", features = ["plugins"]} euclid = {version = "0.6.5", features = ["plugins"]}
heapsize = "0.3.0" heapsize = "0.3.0"
heapsize_plugin = "0.1.2" heapsize_plugin = "0.1.2"

View file

@ -15,6 +15,9 @@ extern crate euclid;
extern crate heapsize; extern crate heapsize;
extern crate layers; extern crate layers;
extern crate msg; extern crate msg;
#[macro_use]
extern crate range;
extern crate rustc_serialize;
extern crate serde; extern crate serde;
pub mod color; pub mod color;
@ -25,6 +28,7 @@ use azure::azure_hl::Color;
use euclid::Matrix4D; use euclid::Matrix4D;
use euclid::rect::Rect; use euclid::rect::Rect;
use msg::constellation_msg::PipelineId; use msg::constellation_msg::PipelineId;
use range::RangeIndex;
use std::fmt::{self, Debug, Formatter}; use std::fmt::{self, Debug, Formatter};
use std::sync::atomic::{ATOMIC_USIZE_INIT, AtomicUsize, Ordering}; 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)
}

View file

@ -814,6 +814,8 @@ dependencies = [
"layers 0.2.5 (git+https://github.com/servo/rust-layers)", "layers 0.2.5 (git+https://github.com/servo/rust-layers)",
"msg 0.0.1", "msg 0.0.1",
"plugins 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 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)", "serde_macros 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)",
] ]

2
ports/cef/Cargo.lock generated
View file

@ -727,6 +727,8 @@ dependencies = [
"layers 0.2.5 (git+https://github.com/servo/rust-layers)", "layers 0.2.5 (git+https://github.com/servo/rust-layers)",
"msg 0.0.1", "msg 0.0.1",
"plugins 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 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)", "serde_macros 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)",
] ]