mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Remove Webdriver Server's access to Constellation (#38212)
`WebDriverCommandMsg::TakeScreenshot` was the last thing blocking us from removing constellation access in webdriver server. Now we can happily remove it. Surprisingly, this reduces binary size by 185KB for release profile in Windows. #37737 removes a net total of 300 lines, but only reduced 98KB. Testing: No regression after testing. Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
This commit is contained in:
parent
61df7ab127
commit
57fc569818
8 changed files with 31 additions and 58 deletions
|
@ -60,12 +60,12 @@ use crate::webview_manager::WebViewManager;
|
|||
use crate::webview_renderer::{PinchZoomResult, UnknownWebView, WebViewRenderer};
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
enum UnableToComposite {
|
||||
pub enum UnableToComposite {
|
||||
NotReadyToPaintImage(NotReadyToPaint),
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
enum NotReadyToPaint {
|
||||
pub enum NotReadyToPaint {
|
||||
JustNotifiedConstellation,
|
||||
WaitingOnConstellation,
|
||||
}
|
||||
|
@ -591,18 +591,6 @@ impl IOCompositor {
|
|||
};
|
||||
webview_renderer.on_touch_event_processed(result);
|
||||
},
|
||||
|
||||
CompositorMsg::CreatePng(webview_id, page_rect, reply) => {
|
||||
let res = self.render_to_shared_memory(webview_id, page_rect);
|
||||
if let Err(ref e) = res {
|
||||
info!("Error retrieving PNG: {:?}", e);
|
||||
}
|
||||
let img = res.unwrap_or(None);
|
||||
if let Err(e) = reply.send(img) {
|
||||
warn!("Sending reply to create png failed ({:?}).", e);
|
||||
}
|
||||
},
|
||||
|
||||
CompositorMsg::IsReadyToSaveImageReply(is_ready) => {
|
||||
assert_eq!(
|
||||
self.ready_to_save_state,
|
||||
|
@ -1351,7 +1339,7 @@ impl IOCompositor {
|
|||
|
||||
/// Render the WebRender scene to the shared memory, without updating other state of this
|
||||
/// [`IOCompositor`]. If succesful return the output image in shared memory.
|
||||
fn render_to_shared_memory(
|
||||
pub fn render_to_shared_memory(
|
||||
&mut self,
|
||||
webview_id: WebViewId,
|
||||
page_rect: Option<Rect<f32, CSSPixel>>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue