pub struct BrowserRenderer {
pub render_state: RenderState,
pub chrome: Box<dyn Chrome>,
pub menu: Box<dyn ContextMenu>,
}Expand description
BrowserRenderer は実際の描画を担当する。
責務:
- アクティブタブのページとブラウザ chrome から DrawCommand を生成する
- DevTools ペインが開いている場合は分割ビューとして両ペインを生成する
- 開いているコンテキストメニューを最前面オーバーレイとして生成する
- DrawCommand をプラットフォームの GPU レンダラへ渡し、描画を実行する
- ウィンドウのサイズ・スケール・タイトルなどの描画状態を保持する
BrowserApp / BrowserUi は直接の描画実装を持たず、このレンダラへ処理を委譲する。
Fields§
§render_state: RenderStateウィンドウの描画状態(DrawCommand、サイズ、スケール、タイトル)。
chrome: Box<dyn Chrome>ブラウザ chrome(ツールバーなどの UI 描画)。既定は BasicChrome。
WebView 右クリックで開くコンテキストメニュー。既定は BasicContextMenu。
Implementations§
Source§impl BrowserRenderer
impl BrowserRenderer
Sourcepub fn new() -> Self
pub fn new() -> Self
既定の BasicChrome と BasicContextMenu でレンダラを生成する。
Sourcepub fn with_chrome(chrome: Box<dyn Chrome>) -> Self
pub fn with_chrome(chrome: Box<dyn Chrome>) -> Self
任意の chrome 実装と既定の BasicContextMenu でレンダラを生成する。
Sourcepub fn with_window(
window_size: (u32, u32),
scale_factor: f64,
window_title: String,
) -> Self
pub fn with_window( window_size: (u32, u32), scale_factor: f64, window_title: String, ) -> Self
ウィンドウの初期サイズ・スケール・タイトルでレンダラを生成する。
任意の chrome 実装と任意のコンテキストメニュー実装でレンダラを生成する。
Sourcepub fn set_window(
&mut self,
window_size: (u32, u32),
scale_factor: f64,
window_title: String,
)
pub fn set_window( &mut self, window_size: (u32, u32), scale_factor: f64, window_title: String, )
ウィンドウのサイズ・スケール・タイトルを設定する。
Sourcepub fn rebuild(
&mut self,
tabs: &mut HashMap<TabId, Tab>,
active_id: Option<TabId>,
)
pub fn rebuild( &mut self, tabs: &mut HashMap<TabId, Tab>, active_id: Option<TabId>, )
指定されたアクティブタブのレイアウトを更新し、ページと chrome の DrawCommand を再生成する。
Sourcepub fn apply_draw_commands(&self, gpu: &mut GpuRenderer)
pub fn apply_draw_commands(&self, gpu: &mut GpuRenderer)
現在の DrawCommand を GPU レンダラへ送る。
Trait Implementations§
Source§impl Debug for BrowserRenderer
impl Debug for BrowserRenderer
Auto Trait Implementations§
impl !RefUnwindSafe for BrowserRenderer
impl !Send for BrowserRenderer
impl !Sync for BrowserRenderer
impl !UnwindSafe for BrowserRenderer
impl Freeze for BrowserRenderer
impl Unpin for BrowserRenderer
impl UnsafeUnpin for BrowserRenderer
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().