mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
compositor: Add more doc for size of different RenderingContext
implementation (#38399)
For more details, see https://github.com/servo/servo/issues/38369#issuecomment-3138378527. Fixes: https://github.com/servo/servo/issues/38369#issuecomment-3138458772 Testing: Just adding docs. Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
This commit is contained in:
parent
5e8754bb1d
commit
625d636b04
3 changed files with 4 additions and 2 deletions
|
@ -150,7 +150,7 @@ pub struct IOCompositor {
|
||||||
/// The webrender renderer.
|
/// The webrender renderer.
|
||||||
webrender: Option<webrender::Renderer>,
|
webrender: Option<webrender::Renderer>,
|
||||||
|
|
||||||
/// The surfman instance that webrender targets, which is the viewport.
|
/// The [`RenderingContext`] instance that webrender targets, which is the viewport.
|
||||||
rendering_context: Rc<dyn RenderingContext>,
|
rendering_context: Rc<dyn RenderingContext>,
|
||||||
|
|
||||||
/// The number of frames pending to receive from WebRender.
|
/// The number of frames pending to receive from WebRender.
|
||||||
|
|
|
@ -381,6 +381,7 @@ impl RenderingContext for SoftwareRenderingContext {
|
||||||
/// If you would like to paint to only a portion of the window, consider using
|
/// If you would like to paint to only a portion of the window, consider using
|
||||||
/// [`OffscreenRenderingContext`] by calling [`WindowRenderingContext::offscreen_context`].
|
/// [`OffscreenRenderingContext`] by calling [`WindowRenderingContext::offscreen_context`].
|
||||||
pub struct WindowRenderingContext {
|
pub struct WindowRenderingContext {
|
||||||
|
/// The inner size of the window in physical pixels which excludes OS decorations.
|
||||||
size: Cell<PhysicalSize<u32>>,
|
size: Cell<PhysicalSize<u32>>,
|
||||||
surfman_context: SurfmanRenderingContext,
|
surfman_context: SurfmanRenderingContext,
|
||||||
}
|
}
|
||||||
|
|
|
@ -687,7 +687,8 @@ impl WindowPortsMethods for Window {
|
||||||
},
|
},
|
||||||
WindowEvent::Resized(new_inner_size) => {
|
WindowEvent::Resized(new_inner_size) => {
|
||||||
if self.inner_size.get() != new_inner_size {
|
if self.inner_size.get() != new_inner_size {
|
||||||
// This should always be set to inner size.
|
// This should always be set to inner size
|
||||||
|
// because we are resizing `SurfmanRenderingContext`.
|
||||||
// See https://github.com/servo/servo/issues/38369#issuecomment-3138378527
|
// See https://github.com/servo/servo/issues/38369#issuecomment-3138378527
|
||||||
self.window_rendering_context.resize(new_inner_size);
|
self.window_rendering_context.resize(new_inner_size);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue