pub struct RenderingContext(Rc<RenderingContextData>);
Expand description
A Servo rendering context, which holds all of the information needed to render Servo’s layout, and bridges WebRender and surfman.
Tuple Fields§
§0: Rc<RenderingContextData>
Implementations§
source§impl RenderingContext
impl RenderingContext
pub fn create( connection: &Connection, adapter: &Adapter, surface_type: SurfaceType<NativeWidget>, ) -> Result<Self, Error>
pub fn create_surface( &self, surface_type: SurfaceType<NativeWidget>, ) -> Result<Surface, Error>
pub fn destroy_surface(&self, surface: Surface) -> Result<(), Error>
pub fn create_surface_texture( &self, surface: Surface, ) -> Result<SurfaceTexture, Error>
pub fn destroy_surface_texture( &self, surface_texture: SurfaceTexture, ) -> Result<Surface, Error>
pub fn make_gl_context_current(&self) -> Result<(), Error>
pub fn swap_chain(&self) -> Result<&SwapChain<Device>, Error>
pub fn resize(&self, size: Size2D<i32>) -> Result<(), Error>
pub fn present(&self) -> Result<(), Error>
sourcepub fn with_front_buffer<F: FnOnce(&Device, Surface) -> Surface>(&self, f: F)
pub fn with_front_buffer<F: FnOnce(&Device, Surface) -> Surface>(&self, f: F)
Invoke a closure with the surface associated with the current front buffer. This can be used to create a surfman::SurfaceTexture to blit elsewhere.
pub fn device(&self) -> Ref<'_, Device>
pub fn connection(&self) -> Connection
pub fn adapter(&self) -> Adapter
pub fn native_context(&self) -> NativeContext
pub fn native_device(&self) -> NativeDevice
pub fn context_attributes(&self) -> ContextAttributes
pub fn context_surface_info(&self) -> Result<Option<SurfaceInfo>, Error>
pub fn surface_info(&self, surface: &Surface) -> SurfaceInfo
pub fn surface_texture_object(&self, surface: &SurfaceTexture) -> u32
pub fn get_proc_address(&self, name: &str) -> *const c_void
pub fn unbind_native_surface_from_context(&self) -> Result<(), Error>
pub fn bind_native_surface_to_context( &self, native_widget: NativeWidget, ) -> Result<(), Error>
Trait Implementations§
source§impl Clone for RenderingContext
impl Clone for RenderingContext
source§fn clone(&self) -> RenderingContext
fn clone(&self) -> RenderingContext
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 moreAuto Trait Implementations§
impl Freeze for RenderingContext
impl !RefUnwindSafe for RenderingContext
impl !Send for RenderingContext
impl !Sync for RenderingContext
impl Unpin for RenderingContext
impl !UnwindSafe for RenderingContext
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 moresource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert