Remove epaint::mutex::Arc type alias
This commit is contained in:
parent
5a78213421
commit
2355828d41
18 changed files with 35 additions and 42 deletions
|
@ -1,4 +1,5 @@
|
||||||
// #![warn(missing_docs)]
|
// #![warn(missing_docs)]
|
||||||
|
use std::sync::Arc;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
animation_manager::AnimationManager, data::output::PlatformOutput, frame_state::FrameState,
|
animation_manager::AnimationManager, data::output::PlatformOutput, frame_state::FrameState,
|
||||||
|
|
|
@ -146,7 +146,7 @@ pub struct DroppedFile {
|
||||||
/// Set by the `egui_web` backend.
|
/// Set by the `egui_web` backend.
|
||||||
pub last_modified: Option<std::time::SystemTime>,
|
pub last_modified: Option<std::time::SystemTime>,
|
||||||
/// Set by the `egui_web` backend.
|
/// Set by the `egui_web` backend.
|
||||||
pub bytes: Option<epaint::mutex::Arc<[u8]>>,
|
pub bytes: Option<std::sync::Arc<[u8]>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// An input event generated by the integration.
|
/// An input event generated by the integration.
|
||||||
|
|
|
@ -46,7 +46,7 @@ impl State {
|
||||||
|
|
||||||
pub(crate) struct GridLayout {
|
pub(crate) struct GridLayout {
|
||||||
ctx: Context,
|
ctx: Context,
|
||||||
style: epaint::mutex::Arc<Style>,
|
style: std::sync::Arc<Style>,
|
||||||
id: Id,
|
id: Id,
|
||||||
|
|
||||||
/// State previous frame (if any).
|
/// State previous frame (if any).
|
||||||
|
|
|
@ -99,7 +99,7 @@ pub struct Memory {
|
||||||
pub struct Options {
|
pub struct Options {
|
||||||
/// The default style for new [`Ui`](crate::Ui):s.
|
/// The default style for new [`Ui`](crate::Ui):s.
|
||||||
#[cfg_attr(feature = "serde", serde(skip))]
|
#[cfg_attr(feature = "serde", serde(skip))]
|
||||||
pub(crate) style: epaint::mutex::Arc<Style>,
|
pub(crate) style: std::sync::Arc<Style>,
|
||||||
|
|
||||||
/// Controls the tessellator.
|
/// Controls the tessellator.
|
||||||
pub tessellation_options: epaint::TessellationOptions,
|
pub tessellation_options: epaint::TessellationOptions,
|
||||||
|
|
|
@ -20,7 +20,8 @@ use super::{
|
||||||
Sense, TextStyle, Ui, Vec2,
|
Sense, TextStyle, Ui, Vec2,
|
||||||
};
|
};
|
||||||
use crate::{widgets::*, *};
|
use crate::{widgets::*, *};
|
||||||
use epaint::{mutex::Arc, mutex::RwLock, Stroke};
|
use epaint::{mutex::RwLock, Stroke};
|
||||||
|
use std::sync::Arc;
|
||||||
|
|
||||||
/// What is saved between frames.
|
/// What is saved between frames.
|
||||||
#[derive(Clone, Default)]
|
#[derive(Clone, Default)]
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
use std::ops::RangeInclusive;
|
use std::ops::RangeInclusive;
|
||||||
|
use std::sync::Arc;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
emath::{pos2, Align2, Pos2, Rect, Vec2},
|
emath::{pos2, Align2, Pos2, Rect, Vec2},
|
||||||
|
@ -6,7 +7,7 @@ use crate::{
|
||||||
Color32, Context, FontId,
|
Color32, Context, FontId,
|
||||||
};
|
};
|
||||||
use epaint::{
|
use epaint::{
|
||||||
mutex::{Arc, RwLockReadGuard, RwLockWriteGuard},
|
mutex::{RwLockReadGuard, RwLockWriteGuard},
|
||||||
text::{Fonts, Galley},
|
text::{Fonts, Galley},
|
||||||
CircleShape, RectShape, Rounding, Shape, Stroke,
|
CircleShape, RectShape, Rounding, Shape, Stroke,
|
||||||
};
|
};
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
#![allow(clippy::if_same_then_else)]
|
#![allow(clippy::if_same_then_else)]
|
||||||
|
|
||||||
use crate::{color::*, emath::*, FontFamily, FontId, Response, RichText, WidgetText};
|
use crate::{color::*, emath::*, FontFamily, FontId, Response, RichText, WidgetText};
|
||||||
use epaint::{mutex::Arc, Rounding, Shadow, Stroke};
|
use epaint::{Rounding, Shadow, Stroke};
|
||||||
use std::collections::BTreeMap;
|
use std::collections::BTreeMap;
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
@ -35,7 +35,7 @@ pub enum TextStyle {
|
||||||
/// ```
|
/// ```
|
||||||
/// egui::TextStyle::Name("footing".into());
|
/// egui::TextStyle::Name("footing".into());
|
||||||
/// ````
|
/// ````
|
||||||
Name(Arc<str>),
|
Name(std::sync::Arc<str>),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl std::fmt::Display for TextStyle {
|
impl std::fmt::Display for TextStyle {
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
// #![warn(missing_docs)]
|
// #![warn(missing_docs)]
|
||||||
|
|
||||||
use epaint::mutex::{Arc, RwLock, RwLockReadGuard, RwLockWriteGuard};
|
|
||||||
use std::hash::Hash;
|
use std::hash::Hash;
|
||||||
|
use std::sync::Arc;
|
||||||
|
|
||||||
|
use epaint::mutex::{RwLock, RwLockReadGuard, RwLockWriteGuard};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
color::*, containers::*, epaint::text::Fonts, layout::*, menu::MenuState, placer::Placer,
|
color::*, containers::*, epaint::text::Fonts, layout::*, menu::MenuState, placer::Placer,
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
// For non-serializable types, these simply return `None`.
|
// For non-serializable types, these simply return `None`.
|
||||||
// This will also allow users to pick their own serialization format per type.
|
// This will also allow users to pick their own serialization format per type.
|
||||||
|
|
||||||
use epaint::mutex::Arc;
|
|
||||||
use std::any::Any;
|
use std::any::Any;
|
||||||
|
use std::sync::Arc;
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
use epaint::mutex::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
style::WidgetVisuals, text::LayoutJob, Align, Color32, FontFamily, FontSelection, Galley, Pos2,
|
style::WidgetVisuals, text::LayoutJob, Align, Color32, FontFamily, FontSelection, Galley, Pos2,
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
use epaint::mutex::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use epaint::text::{cursor::*, Galley, LayoutJob};
|
use epaint::text::{cursor::*, Galley, LayoutJob};
|
||||||
|
|
||||||
|
|
|
@ -142,11 +142,6 @@ mod rw_lock_impl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(target_arch = "wasm32"))]
|
|
||||||
mod arc_impl {
|
|
||||||
pub use std::sync::Arc;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
#[cfg(target_arch = "wasm32")]
|
#[cfg(target_arch = "wasm32")]
|
||||||
|
@ -211,15 +206,8 @@ mod rw_lock_impl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(target_arch = "wasm32")]
|
|
||||||
mod arc_impl {
|
|
||||||
// pub use std::rc::Rc as Arc; // TODO(emilk): optimize single threaded code by using `Rc` instead of `Arc`.
|
|
||||||
pub use std::sync::Arc;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
pub use arc_impl::Arc;
|
|
||||||
pub use mutex_impl::{Mutex, MutexGuard};
|
pub use mutex_impl::{Mutex, MutexGuard};
|
||||||
pub use rw_lock_impl::{RwLock, RwLockReadGuard, RwLockWriteGuard};
|
pub use rw_lock_impl::{RwLock, RwLockReadGuard, RwLockWriteGuard};
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
//! The different shapes that can be painted.
|
//! The different shapes that can be painted.
|
||||||
|
|
||||||
|
use std::sync::Arc;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
text::{FontId, Fonts, Galley},
|
text::{FontId, Fonts, Galley},
|
||||||
Color32, Mesh, Stroke, TextureId,
|
Color32, Mesh, Stroke, TextureId,
|
||||||
|
@ -175,17 +177,13 @@ impl Shape {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn galley(pos: Pos2, galley: crate::mutex::Arc<Galley>) -> Self {
|
pub fn galley(pos: Pos2, galley: Arc<Galley>) -> Self {
|
||||||
TextShape::new(pos, galley).into()
|
TextShape::new(pos, galley).into()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
/// The text color in the [`Galley`] will be replaced with the given color.
|
/// The text color in the [`Galley`] will be replaced with the given color.
|
||||||
pub fn galley_with_color(
|
pub fn galley_with_color(pos: Pos2, galley: Arc<Galley>, text_color: Color32) -> Self {
|
||||||
pos: Pos2,
|
|
||||||
galley: crate::mutex::Arc<Galley>,
|
|
||||||
text_color: Color32,
|
|
||||||
) -> Self {
|
|
||||||
TextShape {
|
TextShape {
|
||||||
override_text_color: Some(text_color),
|
override_text_color: Some(text_color),
|
||||||
..TextShape::new(pos, galley)
|
..TextShape::new(pos, galley)
|
||||||
|
@ -549,7 +547,7 @@ pub struct TextShape {
|
||||||
pub pos: Pos2,
|
pub pos: Pos2,
|
||||||
|
|
||||||
/// The layed out text, from [`Fonts::layout_job`].
|
/// The layed out text, from [`Fonts::layout_job`].
|
||||||
pub galley: crate::mutex::Arc<Galley>,
|
pub galley: Arc<Galley>,
|
||||||
|
|
||||||
/// Add this underline to the whole text.
|
/// Add this underline to the whole text.
|
||||||
/// You can also set an underline when creating the galley.
|
/// You can also set an underline when creating the galley.
|
||||||
|
@ -567,7 +565,7 @@ pub struct TextShape {
|
||||||
|
|
||||||
impl TextShape {
|
impl TextShape {
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn new(pos: Pos2, galley: crate::mutex::Arc<Galley>) -> Self {
|
pub fn new(pos: Pos2, galley: Arc<Galley>) -> Self {
|
||||||
Self {
|
Self {
|
||||||
pos,
|
pos,
|
||||||
galley,
|
galley,
|
||||||
|
@ -734,7 +732,7 @@ pub struct PaintCallback {
|
||||||
///
|
///
|
||||||
/// The rendering backend is also responsible for restoring any state,
|
/// The rendering backend is also responsible for restoring any state,
|
||||||
/// such as the bound shader program and vertex array.
|
/// such as the bound shader program and vertex array.
|
||||||
pub callback: std::sync::Arc<dyn Fn(&PaintCallbackInfo, &dyn std::any::Any) + Send + Sync>,
|
pub callback: Arc<dyn Fn(&PaintCallbackInfo, &dyn std::any::Any) + Send + Sync>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl PaintCallback {
|
impl PaintCallback {
|
||||||
|
@ -758,7 +756,7 @@ impl std::cmp::PartialEq for PaintCallback {
|
||||||
// can only happen if we do dynamic casts back and forth on the pointers, and we don't do that.
|
// can only happen if we do dynamic casts back and forth on the pointers, and we don't do that.
|
||||||
#[allow(clippy::vtable_address_comparisons)]
|
#[allow(clippy::vtable_address_comparisons)]
|
||||||
{
|
{
|
||||||
self.rect.eq(&other.rect) && std::sync::Arc::ptr_eq(&self.callback, &other.callback)
|
self.rect.eq(&other.rect) && Arc::ptr_eq(&self.callback, &other.callback)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
mutex::{Arc, Mutex, RwLock},
|
mutex::{Mutex, RwLock},
|
||||||
TextureAtlas,
|
TextureAtlas,
|
||||||
};
|
};
|
||||||
use ahash::AHashMap;
|
use ahash::AHashMap;
|
||||||
use emath::{vec2, Vec2};
|
use emath::{vec2, Vec2};
|
||||||
use std::collections::BTreeSet;
|
use std::collections::BTreeSet;
|
||||||
|
use std::sync::Arc;
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
use std::collections::BTreeMap;
|
use std::collections::BTreeMap;
|
||||||
|
use std::sync::Arc;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
mutex::{Arc, Mutex, MutexGuard},
|
mutex::{Mutex, MutexGuard},
|
||||||
text::{
|
text::{
|
||||||
font::{Font, FontImpl},
|
font::{Font, FontImpl},
|
||||||
Galley, LayoutJob,
|
Galley, LayoutJob,
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
use std::ops::RangeInclusive;
|
use std::ops::RangeInclusive;
|
||||||
|
use std::sync::Arc;
|
||||||
|
|
||||||
use super::{FontsImpl, Galley, Glyph, LayoutJob, LayoutSection, Row, RowVisuals};
|
use super::{FontsImpl, Galley, Glyph, LayoutJob, LayoutSection, Row, RowVisuals};
|
||||||
use crate::{mutex::Arc, Color32, Mesh, Stroke, Vertex};
|
use crate::{Color32, Mesh, Stroke, Vertex};
|
||||||
use emath::*;
|
use emath::*;
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
#![allow(clippy::derive_hash_xor_eq)] // We need to impl Hash for f32, but we don't implement Eq, which is fine
|
#![allow(clippy::derive_hash_xor_eq)] // We need to impl Hash for f32, but we don't implement Eq, which is fine
|
||||||
|
|
||||||
use std::ops::Range;
|
use std::ops::Range;
|
||||||
|
use std::sync::Arc;
|
||||||
|
|
||||||
use super::{cursor::*, font::UvRect};
|
use super::{cursor::*, font::UvRect};
|
||||||
use crate::{mutex::Arc, Color32, FontId, Mesh, Stroke};
|
use crate::{Color32, FontId, Mesh, Stroke};
|
||||||
use emath::*;
|
use emath::*;
|
||||||
|
|
||||||
/// Describes the task of laying out text.
|
/// Describes the task of laying out text.
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
use crate::{
|
use std::sync::Arc;
|
||||||
emath::NumExt,
|
|
||||||
mutex::{Arc, RwLock},
|
use crate::{emath::NumExt, mutex::RwLock, ImageData, ImageDelta, TextureId, TextureManager};
|
||||||
ImageData, ImageDelta, TextureId, TextureManager,
|
|
||||||
};
|
|
||||||
|
|
||||||
/// Used to paint images.
|
/// Used to paint images.
|
||||||
///
|
///
|
||||||
|
|
Loading…
Reference in a new issue