Skip to content

Commit cc8ac4f

Browse files
DinnerboneHerschel
authored andcommitted
render: Remove RenderBackend::replace_shape
1 parent 4161050 commit cc8ac4f

File tree

6 files changed

+3
-53
lines changed

6 files changed

+3
-53
lines changed

core/src/drawing.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -304,12 +304,8 @@ impl Drawing {
304304
edge_bounds: self.edge_bounds.clone(),
305305
id: 0,
306306
};
307-
if let Some(handle) = self.render_handle.get() {
308-
context.renderer.replace_shape(shape, self, handle);
309-
} else {
310-
self.render_handle
311-
.set(Some(context.renderer.register_shape(shape, self)));
312-
}
307+
self.render_handle
308+
.set(Some(context.renderer.register_shape(shape, self)));
313309
}
314310

315311
if let Some(handle) = self.render_handle.get() {

render/canvas/src/lib.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -445,16 +445,6 @@ impl RenderBackend for WebCanvasRenderBackend {
445445
handle
446446
}
447447

448-
fn replace_shape(
449-
&mut self,
450-
shape: DistilledShape,
451-
bitmap_source: &dyn BitmapSource,
452-
handle: ShapeHandle,
453-
) {
454-
let data = swf_shape_to_canvas_commands(&shape, bitmap_source, self);
455-
self.shapes[handle.0] = data;
456-
}
457-
458448
fn register_glyph_shape(&mut self, glyph: &swf::Glyph) -> ShapeHandle {
459449
let shape = ruffle_render::shape_utils::swf_glyph_to_shape(glyph);
460450
self.register_shape((&shape).into(), &NullBitmapSource)

render/src/backend.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,6 @@ pub trait RenderBackend: Downcast {
2424
shape: DistilledShape,
2525
bitmap_source: &dyn BitmapSource,
2626
) -> ShapeHandle;
27-
fn replace_shape(
28-
&mut self,
29-
shape: DistilledShape,
30-
bitmap_source: &dyn BitmapSource,
31-
handle: ShapeHandle,
32-
);
3327
fn register_glyph_shape(&mut self, shape: &swf::Glyph) -> ShapeHandle;
3428

3529
/// Creates a new `RenderBackend` which renders directly

render/src/backend/null.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,6 @@ impl RenderBackend for NullRenderer {
5050
) -> ShapeHandle {
5151
ShapeHandle(0)
5252
}
53-
fn replace_shape(
54-
&mut self,
55-
_shape: DistilledShape,
56-
_bitmap_source: &dyn BitmapSource,
57-
_handle: ShapeHandle,
58-
) {
59-
}
6053
fn register_glyph_shape(&mut self, _shape: &swf::Glyph) -> ShapeHandle {
6154
ShapeHandle(0)
6255
}

render/webgl/src/lib.rs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,7 @@ impl WebGlRenderBackend {
734734
};
735735
}
736736

737+
#[allow(dead_code)]
737738
fn delete_mesh(&self, mesh: &Mesh) {
738739
if let Some(gl2) = &self.gl2 {
739740
for draw in &mesh.draws {
@@ -996,19 +997,6 @@ impl RenderBackend for WebGlRenderBackend {
996997
handle
997998
}
998999

999-
fn replace_shape(
1000-
&mut self,
1001-
shape: DistilledShape,
1002-
bitmap_source: &dyn BitmapSource,
1003-
handle: ShapeHandle,
1004-
) {
1005-
self.delete_mesh(&self.meshes[handle.0]);
1006-
match self.register_shape_internal(shape, bitmap_source) {
1007-
Ok(mesh) => self.meshes[handle.0] = mesh,
1008-
Err(e) => log::error!("Couldn't replace shape: {:?}", e),
1009-
}
1010-
}
1011-
10121000
fn register_glyph_shape(&mut self, glyph: &swf::Glyph) -> ShapeHandle {
10131001
let shape = ruffle_render::shape_utils::swf_glyph_to_shape(glyph);
10141002
let handle = ShapeHandle(self.meshes.len());

render/wgpu/src/backend.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -430,17 +430,6 @@ impl<T: RenderTarget + 'static> RenderBackend for WgpuRenderBackend<T> {
430430
handle
431431
}
432432

433-
#[instrument(level = "debug", skip_all)]
434-
fn replace_shape(
435-
&mut self,
436-
shape: DistilledShape,
437-
bitmap_source: &dyn BitmapSource,
438-
handle: ShapeHandle,
439-
) {
440-
let mesh = self.register_shape_internal(shape, bitmap_source);
441-
self.meshes[handle.0] = mesh;
442-
}
443-
444433
#[instrument(level = "debug", skip_all)]
445434
fn register_glyph_shape(&mut self, glyph: &swf::Glyph) -> ShapeHandle {
446435
let shape = ruffle_render::shape_utils::swf_glyph_to_shape(glyph);

0 commit comments

Comments
 (0)