1#![cfg_attr(feature = "cargo-clippy", allow(clippy::unreadable_literal, clippy::new_without_default, clippy::too_many_arguments))]
45
46
47macro_rules! matches {
49 ($expression:expr, $($pattern:tt)+) => {
50 match $expression {
51 $($pattern)+ => true,
52 _ => false
53 }
54 }
55}
56
57#[macro_use]
58extern crate bitflags;
59#[macro_use]
60extern crate cstr;
61#[macro_use]
62extern crate lazy_static;
63#[macro_use]
64extern crate log;
65#[macro_use]
66extern crate malloc_size_of_derive;
67#[cfg(any(feature = "serde"))]
68#[macro_use]
69extern crate serde;
70#[macro_use]
71extern crate tracy_rs;
72#[macro_use]
73extern crate derive_more;
74extern crate malloc_size_of;
75extern crate svg_fmt;
76
77#[macro_use]
78mod profiler;
79
80mod batch;
81mod border;
82mod box_shadow;
83#[cfg(any(feature = "capture", feature = "replay"))]
84mod capture;
85mod clip;
86mod space;
87mod spatial_tree;
88mod composite;
89mod compositor;
90mod debug_colors;
91mod debug_font_data;
92mod debug_item;
93mod device;
94mod ellipse;
95mod filterdata;
96mod frame_builder;
97mod freelist;
98#[cfg(any(target_os = "macos", target_os = "windows"))]
99mod gamma_lut;
100mod glyph_cache;
101mod glyph_rasterizer;
102mod gpu_cache;
103mod gpu_types;
104mod hit_test;
105mod internal_types;
106mod lru_cache;
107mod picture;
108mod prepare;
109mod prim_store;
110mod print_tree;
111mod render_backend;
112mod render_target;
113mod render_task_graph;
114mod render_task_cache;
115mod render_task;
116mod renderer;
117mod resource_cache;
118mod scene;
119mod scene_builder_thread;
120mod scene_building;
121mod screen_capture;
122mod segment;
123mod spatial_node;
124mod texture_pack;
125mod texture_cache;
126mod tile_cache;
127mod util;
128mod visibility;
129mod api_resources;
130mod image_tiling;
131mod image_source;
132mod rectangle_occlusion;
133
134pub mod intern;
136pub mod render_api;
138
139mod shader_source {
140 include!(concat!(env!("OUT_DIR"), "/shaders.rs"));
141}
142
143mod platform {
144 #[cfg(target_os = "macos")]
145 pub use crate::platform::macos::font;
146 #[cfg(any(target_os = "android", all(unix, not(target_os = "macos"))))]
147 pub use crate::platform::unix::font;
148 #[cfg(target_os = "windows")]
149 pub use crate::platform::windows::font;
150
151 #[cfg(target_os = "macos")]
152 pub mod macos {
153 pub mod font;
154 }
155 #[cfg(any(target_os = "android", all(unix, not(target_os = "macos"))))]
156 pub mod unix {
157 pub mod font;
158 }
159 #[cfg(target_os = "windows")]
160 pub mod windows {
161 pub mod font;
162 }
163}
164
165#[cfg(target_os = "macos")]
166extern crate core_foundation;
167#[cfg(target_os = "macos")]
168extern crate core_graphics;
169#[cfg(target_os = "macos")]
170extern crate core_text;
171
172#[cfg(all(unix, not(target_os = "macos")))]
173extern crate freetype;
174#[cfg(all(unix, not(target_os = "macos")))]
175extern crate libc;
176
177#[cfg(target_os = "windows")]
178extern crate dwrote;
179
180extern crate bincode;
181extern crate byteorder;
182pub extern crate euclid;
183extern crate fxhash;
184extern crate num_traits;
185extern crate plane_split;
186extern crate rayon;
187#[cfg(feature = "ron")]
188extern crate ron;
189#[macro_use]
190extern crate smallvec;
191extern crate time;
192#[cfg(all(feature = "capture", feature = "png"))]
193extern crate png;
194#[cfg(test)]
195extern crate rand;
196
197pub extern crate api;
198extern crate webrender_build;
199
200#[doc(hidden)]
201pub use crate::composite::{CompositorConfig, Compositor, CompositorCapabilities, CompositorSurfaceTransform};
202pub use crate::composite::{NativeSurfaceId, NativeTileId, NativeSurfaceInfo, PartialPresentCompositor};
203pub use crate::composite::{MappableCompositor, MappedTileInfo, SWGLCompositeSurfaceInfo};
204pub use crate::device::{UploadMethod, VertexUsageHint, get_gl_target, get_unoptimized_shader_source};
205pub use crate::device::{ProgramBinary, ProgramCache, ProgramCacheObserver, FormatDesc};
206pub use crate::device::Device;
207pub use crate::frame_builder::ChasePrimitive;
208pub use crate::prim_store::PrimitiveDebugId;
209pub use crate::profiler::{ProfilerHooks, set_profiler_hooks};
210pub use crate::renderer::{
211 AsyncPropertySampler, CpuProfile, DebugFlags, GpuProfile, GraphicsApi,
212 GraphicsApiInfo, PipelineInfo, Renderer, RendererError, RendererOptions, RenderResults,
213 RendererStats, SceneBuilderHooks, Shaders, SharedShaders, ShaderPrecacheFlags,
214 MAX_VERTEX_TEXTURE_WIDTH, ONE_TIME_USAGE_HINT,
215};
216pub use crate::hit_test::SharedHitTester;
217pub use crate::internal_types::FastHashMap;
218pub use crate::screen_capture::{AsyncScreenshotHandle, RecordedFrameHandle};
219pub use crate::texture_cache::TextureCacheConfig;
220pub use api as webrender_api;
221pub use webrender_build::shader::ProgramSourceDigest;
222pub use crate::picture::{TileDescriptor, TileId, InvalidationReason};
223pub use crate::picture::{PrimitiveCompareResult, PrimitiveCompareResultDetail, CompareHelperResult};
224pub use crate::picture::{TileNode, TileNodeKind, TileSerializer, TileCacheInstanceSerializer, TileOffset, TileCacheLoggerUpdateLists};
225pub use crate::intern::ItemUid;
226pub use crate::render_api::*;
227pub use crate::tile_cache::{PictureCacheDebugInfo, DirtyTileDebugInfo, TileDebugInfo, SliceDebugInfo};
228
229#[cfg(feature = "sw_compositor")]
230pub use crate::compositor::sw_compositor;