1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-01 14:20:04 -04:00

Put everything in Context behind the same Mutex (#1050)

* Move all interior mutability from Context to CtxRef and make it a handle
* Rename `CtxRef` to `Context`
* The old `Context` is now `ContextImpl` and is non-pub
* Add benchmark Painter::rect

Co-authored-by: Daniel Keller <dklr433@gmail.com>
This commit is contained in:
Emil Ernerfeldt
2022-01-10 23:13:10 +01:00
committed by GitHub
parent 225d2b506d
commit d5673412dd
75 changed files with 550 additions and 495 deletions

View File

@@ -78,7 +78,7 @@ impl Default for BackendPanel {
}
impl BackendPanel {
pub fn update(&mut self, ctx: &egui::CtxRef, frame: &epi::Frame) {
pub fn update(&mut self, ctx: &egui::Context, frame: &epi::Frame) {
self.frame_history
.on_new_frame(ctx.input().time, frame.info().cpu_usage);
@@ -88,7 +88,7 @@ impl BackendPanel {
}
}
pub fn end_of_frame(&mut self, ctx: &egui::CtxRef) {
pub fn end_of_frame(&mut self, ctx: &egui::Context) {
self.egui_windows.windows(ctx);
}
@@ -325,7 +325,7 @@ impl EguiWindows {
ui.checkbox(output_events, "📤 Output Events");
}
fn windows(&mut self, ctx: &egui::CtxRef) {
fn windows(&mut self, ctx: &egui::Context) {
let Self {
settings,
inspection,