Skip to content

Commit 17d4246

Browse files
committed
debug_ui: Add DirtyState to Bitmap
1 parent 247578c commit 17d4246

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

core/src/bitmap/bitmap_data.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ pub struct BitmapData<'gc> {
235235
}
236236

237237
#[derive(Clone, Debug)]
238-
enum DirtyState {
238+
pub enum DirtyState {
239239
// Both the CPU and GPU pixels are up to date. We do not need to wait for any syncs to complete
240240
Clean,
241241

@@ -639,6 +639,10 @@ impl<'gc> BitmapData<'gc> {
639639
self.transparency
640640
}
641641

642+
pub fn dirty_state(&self) -> &DirtyState {
643+
&self.dirty_state
644+
}
645+
642646
pub fn set_gpu_dirty(
643647
&mut self,
644648
gc_context: &Mutation<'gc>,

core/src/debug_ui/display_object.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use ruffle_render::blend::ExtendedBlendMode;
44
pub use search::DisplayObjectSearchWindow;
55

66
use crate::avm2::object::TObject as _;
7+
use crate::bitmap::bitmap_data::DirtyState;
78
use crate::context::UpdateContext;
89
use crate::debug_ui::handle::{AVM1ObjectHandle, AVM2ObjectHandle, DisplayObjectHandle};
910
use crate::debug_ui::movie::open_movie_button;
@@ -755,6 +756,20 @@ impl DisplayObjectWindow {
755756
ui.label("No");
756757
}
757758
ui.end_row();
759+
760+
ui.label("Dirty State");
761+
match bitmap_data.dirty_state() {
762+
DirtyState::Clean => ui.label("Clean"),
763+
DirtyState::CpuModified(region) => ui.label(format!(
764+
"CPU Modified ({},{} to {},{})",
765+
region.x_min, region.y_min, region.x_max, region.y_max
766+
)),
767+
DirtyState::GpuModified(_, region) => ui.label(format!(
768+
"GPU Modified ({},{} to {},{})",
769+
region.x_min, region.y_min, region.x_max, region.y_max
770+
)),
771+
};
772+
ui.end_row();
758773
});
759774

760775
CollapsingHeader::new("Preview")

0 commit comments

Comments
 (0)