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

Make glow Send + Sync again. (#3646)

* Reverts #3598
* Closes #3645
This commit is contained in:
Sebastian Urban
2023-12-04 15:58:05 +01:00
committed by GitHub
parent 84a6d6f2ab
commit 36c6b6304d
7 changed files with 14 additions and 13 deletions

View File

@@ -1,7 +1,7 @@
#![allow(clippy::collapsible_else_if)]
#![allow(unsafe_code)]
use std::{collections::HashMap, rc::Rc};
use std::{collections::HashMap, sync::Arc};
use egui::{
emath::Rect,
@@ -62,7 +62,7 @@ impl From<String> for PainterError {
///
/// NOTE: all egui viewports share the same painter.
pub struct Painter {
gl: Rc<glow::Context>,
gl: Arc<glow::Context>,
max_texture_side: usize,
@@ -120,7 +120,7 @@ impl Painter {
/// * failed to create postprocess on webgl with `sRGB` support
/// * failed to create buffer
pub fn new(
gl: Rc<glow::Context>,
gl: Arc<glow::Context>,
shader_prefix: &str,
shader_version: Option<ShaderVersion>,
) -> Result<Painter, PainterError> {
@@ -250,7 +250,7 @@ impl Painter {
}
/// Access the shared glow context.
pub fn gl(&self) -> &Rc<glow::Context> {
pub fn gl(&self) -> &Arc<glow::Context> {
&self.gl
}

View File

@@ -24,7 +24,7 @@ impl EguiGlow {
/// For automatic shader version detection set `shader_version` to `None`.
pub fn new<E>(
event_loop: &winit::event_loop::EventLoopWindowTarget<E>,
gl: std::rc::Rc<glow::Context>,
gl: std::sync::Arc<glow::Context>,
shader_version: Option<ShaderVersion>,
native_pixels_per_point: Option<f32>,
) -> Self {