Split Au type into separate crate, with minimal dependencies.

This commit is contained in:
Glenn Watson 2015-09-28 16:53:00 +10:00
parent fb6d0946cb
commit 339a3f869b
72 changed files with 376 additions and 235 deletions

View file

@ -25,6 +25,9 @@ string_cache = "0.1"
time = "0.1.12"
unicode-script = { version = "0.1", features = ["harfbuzz"] }
[dependencies.app_units]
path = "../app_units"
[dependencies.plugins]
path = "../plugins"

View file

@ -14,6 +14,7 @@
//! They are therefore not exactly analogous to constructs like Skia pictures, which consist of
//! low-level drawing primitives.
use app_units::Au;
use azure::azure::AzFloat;
use azure::azure_hl::{Color, DrawTarget};
use display_list::optimizer::DisplayListOptimizer;
@ -40,7 +41,7 @@ use style::properties::ComputedValues;
use text::TextRun;
use text::glyph::CharIndex;
use util::cursor::Cursor;
use util::geometry::{self, Au, MAX_RECT, ZERO_RECT};
use util::geometry::{self, MAX_RECT, ZERO_RECT};
use util::linked_list::prepend_from;
use util::mem::HeapSizeOf;
use util::opts;

View file

@ -4,12 +4,13 @@
//! Transforms a display list to produce a visually-equivalent, but cheaper-to-paint, one.
use app_units::Au;
use display_list::{DisplayItem, DisplayList, StackingContext};
use euclid::rect::Rect;
use euclid::{Matrix2D, Matrix4};
use std::collections::linked_list::LinkedList;
use std::sync::Arc;
use util::geometry::{self, Au};
use util::geometry;
/// Transforms a display list to produce a visually-equivalent, but cheaper-to-paint, one.
pub struct DisplayListOptimizer {

View file

@ -4,13 +4,13 @@
//! CSS and SVG filter support.
use app_units::Au;
use azure::AzFloat;
use azure::azure_hl::{ColorMatrixAttribute, ColorMatrixInput, CompositeInput, DrawTarget};
use azure::azure_hl::{FilterNode, FilterType, LinearTransferAttribute, LinearTransferInput};
use azure::azure_hl::{GaussianBlurAttribute, GaussianBlurInput};
use azure::azure_hl::{Matrix5x4, TableTransferAttribute, TableTransferInput};
use style::computed_values::filter;
use util::geometry::Au;
/// Creates a filter pipeline from a set of CSS filters. Returns the destination end of the filter
/// pipeline and the opacity.

View file

@ -2,6 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use app_units::Au;
use euclid::{Point2D, Rect, Size2D};
use font_template::FontTemplateDescriptor;
use platform::font::{FontHandle, FontTable};
@ -20,7 +21,6 @@ use text::glyph::{GlyphId, GlyphStore};
use text::shaping::ShaperMethods;
use unicode_script::Script;
use util::cache::HashCache;
use util::geometry::Au;
// FontHandle encapsulates access to the platform's font API,
// e.g. quartz, FreeType. It provides access to metrics and tables

View file

@ -2,6 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use app_units::Au;
use azure::azure_hl::BackendType;
#[cfg(any(target_os = "linux", target_os = "android"))]
use azure::scaled_font::FontInfo;
@ -28,7 +29,6 @@ use std::sync::atomic::{AtomicUsize, Ordering, ATOMIC_USIZE_INIT};
use string_cache::Atom;
use style::computed_values::{font_style, font_variant};
use util::cache::HashCache;
use util::geometry::Au;
use util::mem::HeapSizeOf;
#[cfg(any(target_os = "linux", target_os = "android"))]

View file

@ -20,6 +20,7 @@
#![plugin(plugins)]
#![plugin(serde_macros)]
extern crate app_units;
#[macro_use]
extern crate bitflags;
#[macro_use]

View file

@ -4,6 +4,7 @@
//! Painting of display lists using Moz2D/Azure.
use app_units::Au;
use azure::azure::AzIntSize;
use azure::azure_hl::{AntialiasMode, Color, ColorPattern, CompositionOp};
use azure::azure_hl::{CapStyle, JoinStyle};
@ -34,7 +35,7 @@ use std::{f32, mem, ptr};
use style::computed_values::{border_style, filter, image_rendering, mix_blend_mode};
use text::TextRun;
use text::glyph::CharIndex;
use util::geometry::{self, Au, MAX_RECT, ZERO_POINT, ZERO_RECT};
use util::geometry::{self, MAX_RECT, ZERO_POINT, ZERO_RECT};
use util::opts;
use util::range::Range;

View file

@ -4,6 +4,7 @@
//! The task that handles all painting.
use app_units::Au;
use azure::AzFloat;
use azure::azure_hl::{BackendType, Color, DrawTarget, SurfaceFormat};
use canvas_traits::CanvasMsg;
@ -33,7 +34,7 @@ use std::mem as std_mem;
use std::sync::Arc;
use std::sync::mpsc::{Receiver, Select, Sender, channel};
use url::Url;
use util::geometry::{Au, ZERO_POINT};
use util::geometry::ZERO_POINT;
use util::opts;
use util::task::spawn_named;
use util::task::spawn_named_with_send_on_failure;

View file

@ -4,6 +4,7 @@
extern crate freetype;
use app_units::Au;
use font::{FontHandleMethods, FontMetrics, FontTableMethods};
use font::{FontTableTag, FractionalPixel};
use freetype::freetype::{FTErrorMethods, FT_F26Dot6, FT_Face, FT_FaceRec};
@ -24,7 +25,6 @@ use std::{mem, ptr};
use style::computed_values::{font_stretch, font_weight};
use text::glyph::GlyphId;
use text::util::{fixed_to_float, float_to_fixed};
use util::geometry::Au;
use util::str::c_str_to_string;
fn float_to_fixed_ft(f: f64) -> i32 {

View file

@ -8,6 +8,7 @@ extern crate core_foundation;
extern crate core_graphics;
extern crate core_text;
use app_units::Au;
use core_foundation::base::CFIndex;
use core_foundation::data::CFData;
use core_foundation::string::UniChar;
@ -25,7 +26,6 @@ use std::ptr;
use std::sync::Arc;
use style::computed_values::{font_stretch, font_weight};
use text::glyph::GlyphId;
use util::geometry::Au;
pub struct FontTable {
data: CFData,

View file

@ -2,13 +2,13 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use app_units::Au;
use euclid::point::Point2D;
#[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))]
use simd::u32x4;
use std::cmp::{Ordering, PartialOrd};
use std::vec::Vec;
use std::{fmt, mem, u16};
use util::geometry::Au;
use util::range::{self, EachIndex, Range, RangeIndex};
use util::vec::*;

View file

@ -2,6 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use app_units::Au;
use euclid::Point2D;
use font::{DISABLE_KERNING_SHAPING_FLAG, Font, FontHandleMethods, FontTableMethods, FontTableTag};
use font::{IGNORE_LIGATURES_SHAPING_FLAG, RTL_FLAG, ShapingOptions};
@ -37,7 +38,6 @@ use std::{char, cmp, ptr};
use text::glyph::{CharIndex, GlyphData, GlyphId, GlyphStore};
use text::shaping::ShaperMethods;
use text::util::{fixed_to_float, float_to_fixed, is_bidi_control};
use util::geometry::Au;
use util::range::Range;
macro_rules! hb_tag {

View file

@ -2,6 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use app_units::Au;
use font::{Font, FontHandleMethods, FontMetrics, IS_WHITESPACE_SHAPING_FLAG, RunMetrics};
use font::{ShapingOptions};
use platform::font_template::FontTemplateData;
@ -9,7 +10,6 @@ use std::cmp::{Ordering, max};
use std::slice::Iter;
use std::sync::Arc;
use text::glyph::{CharIndex, GlyphStore};
use util::geometry::Au;
use util::range::Range;
use util::vec::{Comparator, FullBinarySearchMethods};