Turn off anti-aliasing in debug builds by default

This commit is contained in:
Emil Ernerfeldt 2020-11-07 14:06:14 +01:00
parent af11d766fc
commit 4b8a65268c
4 changed files with 14 additions and 12 deletions

View file

@ -14,6 +14,7 @@
* `Context::begin_frame()` no longer returns anything.
* Put your widgets into a `SidePanel`, `TopPanel`, `CentralPanel`, `Window` or `Area`.
* `Context::end_frame()` now returns "paint jobs" that need to be converted to triangles with `Context::tesselate()`.
* Turn off anti-aliasing in debug builds by default.
## 0.2.0 - 2020-10-10

View file

@ -42,18 +42,8 @@ pub trait Demo {
// ----------------------------------------------------------------------------
#[cfg(debug_assertions)]
pub fn has_debug_assertions() -> bool {
true
}
#[cfg(not(debug_assertions))]
pub fn has_debug_assertions() -> bool {
false
}
pub fn warn_if_debug_build(ui: &mut crate::Ui) {
if has_debug_assertions() {
if crate::has_debug_assertions() {
ui.label(
crate::Label::new("[Debug build]")
.small()

View file

@ -122,3 +122,13 @@ pub fn text_egui_e2e() {
assert!(!paint_jobs.is_empty());
}
}
#[cfg(debug_assertions)]
pub(crate) fn has_debug_assertions() -> bool {
true
}
#[cfg(not(debug_assertions))]
pub(crate) fn has_debug_assertions() -> bool {
false
}

View file

@ -450,6 +450,7 @@ pub struct TesselationOptions {
/// Size of a pixel in points, e.g. 0.5
pub aa_size: f32,
/// Anti-aliasing makes shapes appear smoother, but requires more triangles and is therefore slower.
/// By default this is enabled in release builds and disabled in debug builds.
pub anti_alias: bool,
/// If `true` (default) cull certain primitives before tessellating them
pub coarse_tessellation_culling: bool,
@ -463,7 +464,7 @@ impl Default for TesselationOptions {
fn default() -> Self {
Self {
aa_size: 1.0,
anti_alias: true,
anti_alias: !crate::has_debug_assertions(),
coarse_tessellation_culling: true,
debug_paint_clip_rects: false,
debug_ignore_clip_rects: false,