Enum webrender::device::gl::DrawTarget
source · pub enum DrawTarget {
Default {
rect: FramebufferIntRect,
total_size: FramebufferIntSize,
surface_origin_is_top_left: bool,
},
Texture {
dimensions: DeviceIntSize,
with_depth: bool,
fbo_id: FBOId,
id: GLuint,
target: GLuint,
},
External {
fbo: FBOId,
size: FramebufferIntSize,
},
NativeSurface {
offset: DeviceIntPoint,
external_fbo_id: u32,
dimensions: DeviceIntSize,
},
}
Expand description
Contains the parameters necessary to bind a draw target.
Variants§
Default
Use the device’s default draw target, with the provided dimensions, which are used to set the viewport.
Fields
§
rect: FramebufferIntRect
Target rectangle to draw.
§
total_size: FramebufferIntSize
Total size of the target.
Texture
Use the provided texture.
Fields
§
dimensions: DeviceIntSize
Size of the texture in pixels
External
Use an FBO attached to an external texture.
NativeSurface
An OS compositor surface
Implementations§
source§impl DrawTarget
impl DrawTarget
pub fn new_default( size: DeviceIntSize, surface_origin_is_top_left: bool, ) -> Self
sourcepub fn is_default(&self) -> bool
pub fn is_default(&self) -> bool
Returns true if this draw target corresponds to the default framebuffer.
pub fn from_texture(texture: &Texture, with_depth: bool) -> Self
sourcepub fn dimensions(&self) -> DeviceIntSize
pub fn dimensions(&self) -> DeviceIntSize
Returns the dimensions of this draw-target.
pub fn offset(&self) -> DeviceIntPoint
pub fn to_framebuffer_rect( &self, device_rect: DeviceIntRect, ) -> FramebufferIntRect
pub fn surface_origin_is_top_left(&self) -> bool
sourcepub fn build_scissor_rect(
&self,
scissor_rect: Option<DeviceIntRect>,
) -> FramebufferIntRect
pub fn build_scissor_rect( &self, scissor_rect: Option<DeviceIntRect>, ) -> FramebufferIntRect
Given a scissor rect, convert it to the right coordinate space depending on the draw target kind. If no scissor rect was supplied, returns a scissor rect that encloses the entire render target.
Trait Implementations§
source§impl Clone for DrawTarget
impl Clone for DrawTarget
source§fn clone(&self) -> DrawTarget
fn clone(&self) -> DrawTarget
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for DrawTarget
impl Debug for DrawTarget
source§impl From<DrawTarget> for ReadTarget
impl From<DrawTarget> for ReadTarget
source§fn from(t: DrawTarget) -> Self
fn from(t: DrawTarget) -> Self
Converts to this type from the input type.
impl Copy for DrawTarget
Auto Trait Implementations§
impl Freeze for DrawTarget
impl RefUnwindSafe for DrawTarget
impl Send for DrawTarget
impl Sync for DrawTarget
impl Unpin for DrawTarget
impl UnwindSafe for DrawTarget
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more