pub struct G2D {
pub lib: Rc<g2d>,
pub handle: *mut c_void,
pub version: Version,
}Fields§
§lib: Rc<g2d>§handle: *mut c_void§version: VersionImplementations§
Source§impl G2D
impl G2D
pub fn new<P>(path: P) -> Result<Self>
pub fn version(&self) -> Version
Sourcepub fn clear(&self, dst: &mut G2DSurface, color: [u8; 4]) -> Result<()>
pub fn clear(&self, dst: &mut G2DSurface, color: [u8; 4]) -> Result<()>
Clear a surface to a solid color using the hardware g2d_clear operation.
This queues the clear operation. Call finish() to wait
for completion, or batch multiple operations before finishing.
Sourcepub fn blit(&self, src: &G2DSurface, dst: &G2DSurface) -> Result<()>
pub fn blit(&self, src: &G2DSurface, dst: &G2DSurface) -> Result<()>
Blit (copy/scale/convert) from source to destination surface.
This queues the blit operation. Call finish() to wait
for completion, or batch multiple operations before finishing.
Sourcepub fn flush(&self) -> Result<()>
pub fn flush(&self) -> Result<()>
Flush all queued G2D operations for asynchronous execution.
Unlike finish(), this does not wait for
completion — the GPU begins processing immediately but the CPU
continues. A subsequent finish() is still required before the
CPU reads the destination buffer.
Useful in pipelines where the consumer of the result is not immediately ready, allowing GPU work to overlap with other CPU work.