pub struct ConfigBuilder { /* private fields */ }Expand description
Builder for the Config struct.
Implementations§
Source§impl ConfigBuilder
impl ConfigBuilder
Sourcepub fn cache_path(self, path: &str) -> Self
pub fn cache_path(self, path: &str) -> Self
A writable OS file path to store persistent Session data in.
This data may include cookies, cached network resources, indexed DB, etc.
Files are only written to disk when using a persistent Session (see
Renderer::create_session).
Sourcepub fn resource_path_prefix(self, path: &str) -> Self
pub fn resource_path_prefix(self, path: &str) -> Self
The relative path to the resources folder (loaded via the FileSystem API).
The library loads certain resources (SSL certs, ICU data, etc.)
from the FileSystem API during runtime (eg, file:///resources/cacert.pem).
You can customize the relative file path to the resources folder by modifying this setting.
(Default = “resources/”)
Sourcepub fn face_winding(self, winding: FaceWinding) -> Self
pub fn face_winding(self, winding: FaceWinding) -> Self
The winding order for front-facing triangles. (See FaceWinding)
Note: This is only used when the GPU renderer is enabled.
Sourcepub fn font_hinting(self, hinting: FontHinting) -> Self
pub fn font_hinting(self, hinting: FontHinting) -> Self
The hinting algorithm to use when rendering fonts. (See FontHinting)
Sourcepub fn font_gamma(self, gamma: f64) -> Self
pub fn font_gamma(self, gamma: f64) -> Self
The gamma to use when compositing font glyphs, change this value to adjust contrast (Adobe and Apple prefer 1.8, others may prefer 2.2).
Sourcepub fn user_stylesheet(self, path: &str) -> Self
pub fn user_stylesheet(self, path: &str) -> Self
Default user stylesheet. You should set this to your own custom CSS string to define default styles for various DOM elements, scrollbars, and platform input widgets.
Sourcepub fn force_repaint(self, force: bool) -> Self
pub fn force_repaint(self, force: bool) -> Self
Whether or not we should continuously repaint any Views or compositor layers, regardless if they are dirty or not. This is mainly used to diagnose painting/shader issues.
(Default = false)
Sourcepub fn animation_timer_delay(self, delay: f64) -> Self
pub fn animation_timer_delay(self, delay: f64) -> Self
When a CSS animation is active, the amount of time (in seconds) to wait before triggering another repaint.
(Default = 1.0 / 60.0)
Sourcepub fn scroll_timer_delay(self, delay: f64) -> Self
pub fn scroll_timer_delay(self, delay: f64) -> Self
When a smooth scroll animation is active, the amount of time (in seconds) to wait before triggering another repaint.
(Default = 1.0 / 60.0)
Sourcepub fn recycle_delay(self, delay: f64) -> Self
pub fn recycle_delay(self, delay: f64) -> Self
The amount of time (in seconds) to wait before running the recycler (will attempt to return excess memory back to the system).
Sourcepub fn memory_cache_size(self, size: u32) -> Self
pub fn memory_cache_size(self, size: u32) -> Self
The size of WebCore’s memory cache in bytes.
You should increase this if you anticipate handling pages with large resources, Safari typically uses 128+ MiB for its cache.
size is in bytes.
(Default = 64 * 1024 * 1024)
Sourcepub fn page_cache_size(self, size: u32) -> Self
pub fn page_cache_size(self, size: u32) -> Self
Number of pages to keep in the cache. Defaults to 0 (none).
Safari typically caches about 5 pages and maintains an on-disk cache to support typical web-browsing activities. If you increase this, you should probably increase the memory cache size as well.
Sourcepub fn override_ram_size(self, size: u32) -> Self
pub fn override_ram_size(self, size: u32) -> Self
The system’s physical RAM size in bytes.
JavaScriptCore tries to detect the system’s physical RAM size to set
reasonable allocation limits. Set this to anything other than 0 to
override the detected value. size is in bytes.
This can be used to force JavaScriptCore to be more conservative with its allocation strategy (at the cost of some performance).
Sourcepub fn min_large_heap_size(self, size: u32) -> Self
pub fn min_large_heap_size(self, size: u32) -> Self
The minimum size of large VM heaps in JavaScriptCore. Set this to a lower value to make these heaps start with a smaller initial value.
size is in bytes.
(Default = 32 * 1024 * 1024)
Sourcepub fn min_small_heap_size(self, size: u32) -> Self
pub fn min_small_heap_size(self, size: u32) -> Self
The minimum size of small VM heaps in JavaScriptCore. Set this to a lower value to make these heaps start with a smaller initial value.
size is in bytes.
(Default = 1 * 1024 * 1024)
Sourcepub fn num_renderer_threads(self, threads: u32) -> Self
pub fn num_renderer_threads(self, threads: u32) -> Self
The number of threads to use in the Renderer (for parallel painting on the CPU, etc.).
You can set this to a certain number to limit the number of threads to spawn.
If this value is 0 (the default), the number of threads will be determined at runtime using the following formula:
max(PhysicalProcessorCount() - 1, 1)
Sourcepub fn max_update_time(self, time: f64) -> Self
pub fn max_update_time(self, time: f64) -> Self
The max amount of time (in seconds) to allow repeating timers to run during each call to
Renderer::update.
The library will attempt to throttle timers and/or reschedule work if this
time budget is exceeded.
(Default = 1.0 / 200.0)
Sourcepub fn bitmap_alignment(self, alignment: u32) -> Self
pub fn bitmap_alignment(self, alignment: u32) -> Self
Note that this is currently is useless in this library
as we can’t get the bitmap from Surface
when using CPU rendering.
The alignment (in bytes) of the BitmapSurface when using the CPU renderer.
The underlying bitmap associated with each BitmapSurface will have
row_bytes padded to reach this alignment.
Aligning the bitmap helps improve performance when using the CPU renderer/ Determining the proper value to use depends on the CPU architecture and max SIMD instruction set used.
We generally target the 128-bit SSE2 instruction set across most PC platforms so ‘16’ is a default and safe value to use.
You can set this to ‘0’ to perform no padding
(row_bytes will always be width * 4) at a slight cost to performance.