Skip to content

Commit 0d6462c

Browse files
relrelbHerschel
authored andcommitted
render: Remove gc-arena dependency
It was only used to make structs `#[derive(gc_arena::Collect)]`, and generally it doesn't make much sense that `render` needs to be GC-aware. So instead annotate `render` fields in `core` with `#[collect(require_static)]`.
1 parent 6965148 commit 0d6462c

File tree

10 files changed

+10
-14
lines changed

10 files changed

+10
-14
lines changed

Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/src/bitmap/bitmap_data.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ pub struct BitmapData<'gc> {
148148
///
149149
/// This is lazily initialized; a value of `None` indicates that
150150
/// initialization has not yet happened.
151+
#[collect(require_static)]
151152
bitmap_handle: Option<BitmapHandle>,
152153

153154
/// The AVM2 side of this `BitmapData`.

core/src/display_object.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ pub struct DisplayObjectBase<'gc> {
5858
parent: Option<DisplayObject<'gc>>,
5959
place_frame: u16,
6060
depth: Depth,
61+
#[collect(require_static)]
6162
transform: Transform,
6263
name: AvmString<'gc>,
6364
clip_depth: Depth,

core/src/display_object/bitmap.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ pub struct BitmapData<'gc> {
3939
/// that it can be accessed without a mutation context.
4040
///
4141
/// If this is `None`, then the bitmap does not render anything.
42+
#[collect(require_static)]
4243
bitmap_handle: Option<BitmapHandle>,
4344

4445
/// Whether or not bitmap smoothing is enabled.

core/src/display_object/edit_text.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ pub struct EditTextData<'gc> {
120120
intrinsic_bounds: BoxBounds<Twips>,
121121

122122
/// The current intrinsic bounds of the text field.
123+
#[collect(require_static)]
123124
bounds: BoundingBox,
124125

125126
/// The AVM1 object handle

core/src/display_object/stage.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ pub struct StageData<'gc> {
8686
use_bitmap_downsampling: bool,
8787

8888
/// The bounds of the current viewport in twips, used for culling.
89+
#[collect(require_static)]
8990
view_bounds: BoundingBox,
9091

9192
/// The window mode of the viewport.

render/Cargo.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ edition = "2021"
66
license = "MIT OR Apache-2.0"
77

88
[dependencies]
9-
swf = {path = "../swf"}
10-
gc-arena = { git = "https://github.com/ruffle-rs/gc-arena" }
9+
swf = { path = "../swf"}
1110
log = "0.4"
1211
gif = "0.11.4"
1312
png = { version = "0.17.5" }
@@ -28,4 +27,4 @@ approx = "0.5.1"
2827
[features]
2928
default = []
3029
tessellator = ["lyon"]
31-
web = ["wasm-bindgen"]
30+
web = ["wasm-bindgen"]

render/src/bitmap.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
use gc_arena::Collect;
2-
3-
#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash, Collect)]
4-
#[collect(no_drop)]
1+
#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash)]
52
pub struct BitmapHandle(pub usize);
63

74
/// Info returned by the `register_bitmap` methods.

render/src/bounding_box.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
use crate::matrix::Matrix;
2-
use gc_arena::Collect;
32
use swf::Twips;
43

5-
#[derive(Clone, Collect, Debug, Default, Eq, PartialEq)]
6-
#[collect(require_static)]
4+
#[derive(Clone, Debug, Default, Eq, PartialEq)]
75
pub struct BoundingBox {
86
pub x_min: Twips,
97
pub y_min: Twips,

render/src/transform.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
use crate::color_transform::ColorTransform;
22
use crate::matrix::Matrix;
3-
use gc_arena::Collect;
43

54
/// Represents the transform for a DisplayObject.
65
/// This includes both the transformation matrix and the color transform.
7-
#[derive(Clone, Collect, Debug, Default)]
8-
#[collect(require_static)]
6+
#[derive(Clone, Debug, Default)]
97
pub struct Transform {
108
pub matrix: Matrix,
119
pub color_transform: ColorTransform,

0 commit comments

Comments
 (0)