aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMs2ger <Ms2ger@gmail.com>2016-06-14 16:05:08 +0100
committerMs2ger <Ms2ger@gmail.com>2016-06-20 19:02:35 +0200
commite5cab3667165765669f2546aa683cfe73e0494af (patch)
tree168fc7da58bc31d529c876cfb452cfec87ce8cc4
parentc270622bfdd7a409c1a940322f630fd6cbd985c0 (diff)
downloadservo-e5cab3667165765669f2546aa683cfe73e0494af.tar.gz
servo-e5cab3667165765669f2546aa683cfe73e0494af.zip
Move ByteIndex to gfx_traits.
-rw-r--r--components/gfx/text/glyph.rs10
-rw-r--r--components/gfx_traits/Cargo.toml2
-rw-r--r--components/gfx_traits/lib.rs11
-rw-r--r--components/servo/Cargo.lock2
-rw-r--r--ports/cef/Cargo.lock2
5 files changed, 19 insertions, 8 deletions
diff --git a/components/gfx/text/glyph.rs b/components/gfx/text/glyph.rs
index fe9dc415625..9e5e7cf732e 100644
--- a/components/gfx/text/glyph.rs
+++ b/components/gfx/text/glyph.rs
@@ -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.
///
diff --git a/components/gfx_traits/Cargo.toml b/components/gfx_traits/Cargo.toml
index 18b2d5abce8..133faf344b3 100644
--- a/components/gfx_traits/Cargo.toml
+++ b/components/gfx_traits/Cargo.toml
@@ -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"
diff --git a/components/gfx_traits/lib.rs b/components/gfx_traits/lib.rs
index eb832c1c788..a131792331d 100644
--- a/components/gfx_traits/lib.rs
+++ b/components/gfx_traits/lib.rs
@@ -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)
+}
diff --git a/components/servo/Cargo.lock b/components/servo/Cargo.lock
index caba1fc1beb..83f29f58b55 100644
--- a/components/servo/Cargo.lock
+++ b/components/servo/Cargo.lock
@@ -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)",
]
diff --git a/ports/cef/Cargo.lock b/ports/cef/Cargo.lock
index 69af9dcbedf..4f38089fbc3 100644
--- a/ports/cef/Cargo.lock
+++ b/ports/cef/Cargo.lock
@@ -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)",
]