tion should initialize the backend for current frame, if the backend is already prepared for a frame, this function should simply do nothing. - `present` - Called when plotters want to finish current frame drawing ```text .ensure_prepared() && +-------------+ +-------------+ .draw_pixels() +--------------+ drop |Start drawing|--->|Ready to draw| ------------------------+---->|Finish 1 frame| ---------> +-------------+ +-------------+ | +--------------+ ^ ^ | | | +------------------------------- + | | continue drawing | +----------------------------------------------------------------+ start render the next frame .present() ``` - For both animated and static drawing, `DrawingBackend::present` indicates current frame should be flushed. - For both animated and static drawing, `DrawingBackend::ensure_prepared` is called every time when plotters need to draw. - For static drawing, the `DrawingBackend::present` is only called once manually, or from the Drop impl for the backend. - For dynamic drawing, frames are defined by invocation of `DrawingBackend::present`, everything prior the invocation should belongs to previous frame # Compatibility Note Since Plotters v0.3, plotters use the "plug-and-play" schema to import backends, this requires both Plotters and the backend crates depends on a same version of `plotters-backend` crate. This crate (`plotters-backend`) will enforce that any revision (means the last number in a version number) won't contains breaking change - both on the Plotters side and backend side. Plotters main crate is always importing the backend crate with version specification `plotters-backend = "^.*"`. It's highly recommended that all the external crates follows the same rule to import `plotters-backend` dependency, to avoid potential breaking caused by `plotters-backend` crates gets a revision update. We also impose a versioning rule with `plotters` and some backends: The compatible main crate (`plotters`) and this crate (`plotters-backend`) are always use the same major and minor version number. All the plotters main crate and second-party backends with version "x.y.*" should be compatible, and they should depens on the latest version of `plotters-backend x.y.*`