2019-04-27 17:54:37 +00:00
|
|
|
pub mod common;
|
2019-04-27 22:33:47 +00:00
|
|
|
#[cfg(not(target_arch = "wasm32"))]
|
2019-04-27 01:55:06 +00:00
|
|
|
pub mod glium;
|
2019-04-28 06:08:59 +00:00
|
|
|
pub mod null;
|
2019-04-27 17:54:37 +00:00
|
|
|
pub mod shape_utils;
|
2019-05-01 16:55:54 +00:00
|
|
|
#[cfg(target_arch = "wasm32")]
|
2019-04-27 17:54:37 +00:00
|
|
|
pub mod web_canvas;
|
|
|
|
|
2019-04-28 06:08:59 +00:00
|
|
|
pub use null::NullRenderer;
|
|
|
|
|
2019-04-27 17:54:37 +00:00
|
|
|
use self::common::ShapeHandle;
|
2019-05-01 16:55:54 +00:00
|
|
|
use crate::{transform::Transform, Color};
|
2019-04-27 01:55:06 +00:00
|
|
|
|
|
|
|
pub trait RenderBackend {
|
2019-05-01 00:46:32 +00:00
|
|
|
fn set_dimensions(&mut self, width: u32, height: u32);
|
|
|
|
|
2019-04-27 17:54:37 +00:00
|
|
|
fn register_shape(&mut self, shape: &swf::Shape) -> common::ShapeHandle;
|
2019-05-03 00:17:02 +00:00
|
|
|
fn register_bitmap_jpeg(&mut self, id: swf::CharacterId, data: &[u8], jpeg_tables: &[u8]) -> common::BitmapHandle;
|
|
|
|
fn register_bitmap_jpeg_2(&mut self, id: swf::CharacterId, data: &[u8])
|
|
|
|
-> common::BitmapHandle;
|
|
|
|
fn register_bitmap_png(&mut self, swf_tag: &swf::DefineBitsLossless) -> common::BitmapHandle;
|
2019-04-27 17:54:37 +00:00
|
|
|
|
|
|
|
fn begin_frame(&mut self);
|
2019-04-28 06:08:59 +00:00
|
|
|
fn clear(&mut self, color: Color);
|
2019-05-01 16:55:54 +00:00
|
|
|
fn render_shape(&mut self, shape: ShapeHandle, transform: &Transform);
|
2019-04-27 17:54:37 +00:00
|
|
|
fn end_frame(&mut self);
|
2019-04-27 01:55:06 +00:00
|
|
|
}
|