Turn off anti-aliasing in debug builds by default
This commit is contained in:
parent
af11d766fc
commit
4b8a65268c
4 changed files with 14 additions and 12 deletions
|
@ -14,6 +14,7 @@
|
||||||
* `Context::begin_frame()` no longer returns anything.
|
* `Context::begin_frame()` no longer returns anything.
|
||||||
* Put your widgets into a `SidePanel`, `TopPanel`, `CentralPanel`, `Window` or `Area`.
|
* 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()`.
|
* `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
|
## 0.2.0 - 2020-10-10
|
||||||
|
|
||||||
|
|
|
@ -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) {
|
pub fn warn_if_debug_build(ui: &mut crate::Ui) {
|
||||||
if has_debug_assertions() {
|
if crate::has_debug_assertions() {
|
||||||
ui.label(
|
ui.label(
|
||||||
crate::Label::new("[Debug build]")
|
crate::Label::new("[Debug build]")
|
||||||
.small()
|
.small()
|
||||||
|
|
|
@ -122,3 +122,13 @@ pub fn text_egui_e2e() {
|
||||||
assert!(!paint_jobs.is_empty());
|
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
|
||||||
|
}
|
||||||
|
|
|
@ -450,6 +450,7 @@ pub struct TesselationOptions {
|
||||||
/// Size of a pixel in points, e.g. 0.5
|
/// Size of a pixel in points, e.g. 0.5
|
||||||
pub aa_size: f32,
|
pub aa_size: f32,
|
||||||
/// Anti-aliasing makes shapes appear smoother, but requires more triangles and is therefore slower.
|
/// 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,
|
pub anti_alias: bool,
|
||||||
/// If `true` (default) cull certain primitives before tessellating them
|
/// If `true` (default) cull certain primitives before tessellating them
|
||||||
pub coarse_tessellation_culling: bool,
|
pub coarse_tessellation_culling: bool,
|
||||||
|
@ -463,7 +464,7 @@ impl Default for TesselationOptions {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
Self {
|
Self {
|
||||||
aa_size: 1.0,
|
aa_size: 1.0,
|
||||||
anti_alias: true,
|
anti_alias: !crate::has_debug_assertions(),
|
||||||
coarse_tessellation_culling: true,
|
coarse_tessellation_culling: true,
|
||||||
debug_paint_clip_rects: false,
|
debug_paint_clip_rects: false,
|
||||||
debug_ignore_clip_rects: false,
|
debug_ignore_clip_rects: false,
|
||||||
|
|
Loading…
Reference in a new issue