Skip to content

Commit 2756e7e

Browse files
authored
Auto merge of #4757 - moz-gfx:github-sync, r=auto
Sync changes from mozilla-central gfx/wr None
2 parents 51d3960 + bd50e95 commit 2756e7e

34 files changed

+858
-259
lines changed

Cargo.lock

Lines changed: 31 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webrender/Cargo.toml

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ build = "build.rs"
99
edition = "2018"
1010

1111
[features]
12-
default = ["freetype-lib"]
13-
freetype-lib = ["freetype/freetype-sys"]
12+
default = ["static_freetype"]
1413
profiler = ["tracy-rs/enable_profiler"]
15-
capture = ["api/serialize", "ron", "serde", "smallvec/serde", "etagere/serialization"]
16-
replay = ["api/deserialize", "ron", "serde", "smallvec/serde", "etagere/serialization"]
14+
capture = ["api/serialize", "ron", "serde", "smallvec/serde", "etagere/serialization", "glyph_rasterizer/capture"]
15+
replay = ["api/deserialize", "ron", "serde", "smallvec/serde", "etagere/serialization", "glyph_rasterizer/replay"]
1716
display_list_stats = ["api/display_list_stats"]
1817
serialize_program = ["serde", "webrender_build/serialize_program"]
19-
no_static_freetype = []
18+
dynamic_freetype = ["glyph_rasterizer/dynamic_freetype"]
19+
static_freetype = ["glyph_rasterizer/static_freetype"]
2020
leak_checks = []
21-
gecko = ["fog"]
21+
gecko = ["fog", "glyph_rasterizer/gecko"]
2222
sw_compositor = ["swgl"]
2323

2424
[build-dependencies]
@@ -47,6 +47,7 @@ time = "0.1"
4747
api = { version = "0.62.0", path = "../webrender_api", package = "webrender_api" }
4848
webrender_build = { version = "0.0.2", path = "../webrender_build" }
4949
malloc_size_of = { version = "0.0.2", path = "../wr_malloc_size_of", package = "wr_malloc_size_of" }
50+
glyph_rasterizer = { version = "0.1.0", path = "../wr_glyph_rasterizer", package = "wr_glyph_rasterizer", default-features = false }
5051
svg_fmt = "0.4"
5152
tracy-rs = "0.1.2"
5253
derive_more = { version = "0.99", default-features = false, features = ["add_assign"] }
@@ -59,16 +60,3 @@ topological-sort = "0.1"
5960
[dev-dependencies]
6061
mozangle = "0.3.3"
6162
rand = "0.4"
62-
63-
[target.'cfg(any(target_os = "android", all(unix, not(target_os = "macos"))))'.dependencies]
64-
freetype = { version = "0.7", default-features = false }
65-
libc = "0.2"
66-
67-
[target.'cfg(target_os = "windows")'.dependencies]
68-
dwrote = "0.11"
69-
70-
[target.'cfg(target_os = "macos")'.dependencies]
71-
core-foundation = "0.9.2"
72-
core-graphics = "0.22.3"
73-
core-text = { version = "19.2", default-features = false }
74-
objc = "0.2"

webrender/src/api_resources.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use crate::api::{BlobImageKey, ImageDescriptor, DirtyRect, TileSize};
66
use crate::api::{BlobImageHandler, AsyncBlobImageRasterizer, BlobImageData, BlobImageParams};
77
use crate::api::{BlobImageRequest, BlobImageDescriptor, FontTemplate};
88
use crate::api::units::*;
9-
use crate::glyph_rasterizer::{SharedFontResources, BaseFontInstance};
9+
use glyph_rasterizer::{SharedFontResources, BaseFontInstance};
1010
use crate::render_api::{ResourceUpdate, TransactionMsg, AddFont};
1111
use crate::image_tiling::*;
1212
use crate::profiler;

webrender/src/batch.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use api::units::*;
88
use crate::clip::{ClipNodeFlags, ClipNodeRange, ClipItemKind, ClipStore};
99
use crate::command_buffer::PrimitiveCommand;
1010
use crate::spatial_tree::{SpatialTree, SpatialNodeIndex, CoordinateSystemId};
11-
use crate::glyph_rasterizer::{GlyphFormat, SubpixelDirection};
11+
use glyph_rasterizer::{GlyphFormat, SubpixelDirection};
1212
use crate::gpu_cache::{GpuBlockData, GpuCache, GpuCacheAddress};
1313
use crate::gpu_types::{BrushFlags, BrushInstance, PrimitiveHeaders, ZBufferId, ZBufferIdGenerator};
1414
use crate::gpu_types::{SplitCompositeInstance};

webrender/src/glyph_cache.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

55
use api::{FontKey, FontInstanceKey, IdNamespace};
6-
use crate::glyph_rasterizer::{FontInstance, GlyphFormat, GlyphKey, GlyphRasterizer};
6+
use glyph_rasterizer::{FontInstance, GlyphFormat, GlyphKey, GlyphRasterizer};
77
use crate::internal_types::{FrameId, FrameStamp, FastHashMap};
88
use crate::resource_cache::ResourceClassCache;
99
use std::sync::Arc;

webrender/src/gpu_types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use crate::render_task::RenderTaskAddress;
1414
use crate::renderer::ShaderColorMode;
1515
use std::i32;
1616
use crate::util::{TransformedRectKind, MatrixHelpers};
17-
use crate::glyph_rasterizer::SubpixelDirection;
17+
use glyph_rasterizer::SubpixelDirection;
1818
use crate::util::{ScaleOffset, pack_as_float};
1919

2020
// Contains type that must exactly match the same structures declared in GLSL.

webrender/src/internal_types.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -724,9 +724,6 @@ pub enum ResultMsg {
724724
ForceRedraw,
725725
}
726726

727-
#[derive(Clone, Debug)]
728-
pub struct ResourceCacheError;
729-
730727
/// Primitive metadata we pass around in a bunch of places
731728
#[derive(Copy, Clone, Debug)]
732729
pub struct LayoutPrimitiveInfo {

webrender/src/lib.rs

Lines changed: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,7 @@ mod ellipse;
9595
mod filterdata;
9696
mod frame_builder;
9797
mod freelist;
98-
#[cfg(any(target_os = "macos", target_os = "windows"))]
99-
mod gamma_lut;
10098
mod glyph_cache;
101-
mod glyph_rasterizer;
10299
mod gpu_cache;
103100
mod gpu_types;
104101
mod hit_test;
@@ -143,43 +140,6 @@ pub mod shader_source {
143140
include!(concat!(env!("OUT_DIR"), "/shaders.rs"));
144141
}
145142

146-
mod platform {
147-
#[cfg(target_os = "macos")]
148-
pub use crate::platform::macos::font;
149-
#[cfg(any(target_os = "android", all(unix, not(target_os = "macos"))))]
150-
pub use crate::platform::unix::font;
151-
#[cfg(target_os = "windows")]
152-
pub use crate::platform::windows::font;
153-
154-
#[cfg(target_os = "macos")]
155-
pub mod macos {
156-
pub mod font;
157-
}
158-
#[cfg(any(target_os = "android", all(unix, not(target_os = "macos"))))]
159-
pub mod unix {
160-
pub mod font;
161-
}
162-
#[cfg(target_os = "windows")]
163-
pub mod windows {
164-
pub mod font;
165-
}
166-
}
167-
168-
#[cfg(target_os = "macos")]
169-
extern crate core_foundation;
170-
#[cfg(target_os = "macos")]
171-
extern crate core_graphics;
172-
#[cfg(target_os = "macos")]
173-
extern crate core_text;
174-
175-
#[cfg(all(unix, not(target_os = "macos")))]
176-
extern crate freetype;
177-
#[cfg(all(unix, not(target_os = "macos")))]
178-
extern crate libc;
179-
180-
#[cfg(target_os = "windows")]
181-
extern crate dwrote;
182-
183143
extern crate bincode;
184144
extern crate byteorder;
185145
pub extern crate euclid;
@@ -228,6 +188,7 @@ pub use crate::picture::{TileNode, TileNodeKind, TileOffset};
228188
pub use crate::intern::ItemUid;
229189
pub use crate::render_api::*;
230190
pub use crate::tile_cache::{PictureCacheDebugInfo, DirtyTileDebugInfo, TileDebugInfo, SliceDebugInfo};
191+
pub use glyph_rasterizer;
231192

232193
#[cfg(feature = "sw_compositor")]
233194
pub use crate::compositor::sw_compositor;

webrender/src/prim_store/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use crate::debug_item::{DebugItem, DebugMessage};
1616
use crate::debug_colors;
1717
use crate::scene_building::{CreateShadow, IsVisible};
1818
use crate::frame_builder::FrameBuildingState;
19-
use crate::glyph_rasterizer::GlyphKey;
19+
use glyph_rasterizer::GlyphKey;
2020
use crate::gpu_cache::{GpuCacheAddress, GpuCacheHandle, GpuDataRequest};
2121
use crate::gpu_types::{BrushFlags};
2222
use crate::intern;

webrender/src/prim_store/text_run.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use api::{ColorF, FontInstanceFlags, GlyphInstance, RasterSpace, Shadow};
66
use api::units::{LayoutToWorldTransform, LayoutVector2D, RasterPixelScale, DevicePixelScale};
77
use crate::scene_building::{CreateShadow, IsVisible};
88
use crate::frame_builder::FrameBuildingState;
9-
use crate::glyph_rasterizer::{FontInstance, FontTransform, GlyphKey, FONT_SIZE_LIMIT};
9+
use glyph_rasterizer::{FontInstance, FontTransform, GlyphKey, FONT_SIZE_LIMIT};
1010
use crate::gpu_cache::GpuCache;
1111
use crate::intern;
1212
use crate::internal_types::LayoutPrimitiveInfo;

0 commit comments

Comments
 (0)