Cull offscreen child views (flutter/engine#3267)

There's no reason to present offscreen child views to Mozart.
This commit is contained in:
Adam Barth 2016-11-23 13:36:12 -08:00 committed by GitHub
parent f264cb36c7
commit ee18bf8eae

View File

@ -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);