Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This part is unnecessary in wgpu_integration.rs #5043

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 2 additions & 41 deletions crates/eframe/src/native/glow_integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -552,44 +552,6 @@ impl GlowWinitRunning {
(raw_input, viewport_ui_cb)
};

let clear_color = self
.app
.clear_color(&self.integration.egui_ctx.style().visuals);

let has_many_viewports = self.glutin.borrow().viewports.len() > 1;
let clear_before_update = !has_many_viewports; // HACK: for some reason, an early clear doesn't "take" on Mac with multiple viewports.

if clear_before_update {
// clear before we call update, so users can paint between clear-color and egui windows:

let mut glutin = self.glutin.borrow_mut();
let GlutinWindowContext {
viewports,
current_gl_context,
not_current_gl_context,
..
} = &mut *glutin;
let viewport = &viewports[&viewport_id];
let Some(window) = viewport.window.as_ref() else {
return Ok(EventResult::Wait);
};
let Some(gl_surface) = viewport.gl_surface.as_ref() else {
return Ok(EventResult::Wait);
};

let screen_size_in_pixels: [u32; 2] = window.inner_size().into();

{
frame_timer.pause();
change_gl_context(current_gl_context, not_current_gl_context, gl_surface);
frame_timer.resume();
}

self.painter
.borrow()
.clear(screen_size_in_pixels, clear_color);
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this break test_inline_glow_paint?

Copy link
Contributor Author

@rustbasic rustbasic Sep 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this break test_inline_glow_paint?

(The plan was to PR wgpu and glow separately.)

Copy link
Contributor Author

@rustbasic rustbasic Sep 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this break test_inline_glow_paint?

As planned, I will test glow separately and if there are no issues, I will PR again.
It was a mistake that I didn't check to make sure that glow was included in this PR. Sorry about that.


// ------------------------------------------------------------
// The update function, which could call immediate viewports,
// so make sure we don't hold any locks here required by the immediate viewports rendeer.
Expand Down Expand Up @@ -649,10 +611,9 @@ impl GlowWinitRunning {
}

let screen_size_in_pixels: [u32; 2] = window.inner_size().into();
let clear_color = app.clear_color(&integration.egui_ctx.style().visuals);

if !clear_before_update {
painter.clear(screen_size_in_pixels, clear_color);
}
painter.clear(screen_size_in_pixels, clear_color);

painter.paint_and_update_textures(
screen_size_in_pixels,
Expand Down
7 changes: 0 additions & 7 deletions crates/eframe/src/native/wgpu_integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -694,8 +694,6 @@ impl WgpuWinitRunning {

integration.post_rendering(window);

let active_viewports_ids: ViewportIdSet = viewport_output.keys().copied().collect();

handle_viewport_output(
&integration.egui_ctx,
&viewport_output,
Expand All @@ -704,11 +702,6 @@ impl WgpuWinitRunning {
viewport_from_window,
);

// Prune dead viewports:
viewports.retain(|id, _| active_viewports_ids.contains(id));
viewport_from_window.retain(|_, id| active_viewports_ids.contains(id));
painter.gc_viewports(&active_viewports_ids);

let window = viewport_from_window
.get(&window_id)
.and_then(|id| viewports.get(id))
Expand Down
2 changes: 1 addition & 1 deletion crates/epaint/src/shadow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub struct Shadow {
/// Move the shadow by this much.
///
/// For instance, a value of `[1.0, 2.0]` will move the shadow 1 point to the right and 2 points down,
/// causing a drop-shadow effet.
/// causing a drop-shadow effect.
pub offset: Vec2,

/// The width of the blur, i.e. the width of the fuzzy penumbra.
Expand Down
Loading