mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Cull offscreen child views (flutter/engine#3267)
There's no reason to present offscreen child views to Mozart.
This commit is contained in:
parent
f264cb36c7
commit
ee18bf8eae
@ -207,6 +207,12 @@ void SceneBuilder::addChildScene(double dx,
|
||||
#if defined(OS_FUCHSIA)
|
||||
if (!m_currentLayer)
|
||||
return;
|
||||
|
||||
SkRect sceneRect = SkRect::MakeXYWH(dx, dy, physicalWidth / devicePixelRatio,
|
||||
physicalHeight / devicePixelRatio);
|
||||
if (!SkRect::Intersects(sceneRect, m_cullRects.top()))
|
||||
return;
|
||||
|
||||
std::unique_ptr<flow::ChildSceneLayer> layer(new flow::ChildSceneLayer());
|
||||
layer->set_offset(SkPoint::Make(dx, dy));
|
||||
layer->set_device_pixel_ratio(devicePixelRatio);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user