fix oom bug on android/ios opengles

This commit is contained in:
Xingwei Zhu 2022-08-17 17:23:03 +08:00
Родитель c2e882da88
Коммит 896d3e2247
2 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -805,7 +805,7 @@ class Build
//
//Disable the persistent cache (via force its IsValid() method to always return false) in UIWidget engine for Mac
//note that there might be some performance issue (mainly first frame delay) after this fix on Mac
np.Defines.Add(c => IsMac(c), "UIWIDGETS_FORCE_DISABLE_PERSISTENTCACHE=\\\"1\\\"");
np.Defines.Add(c => IsMac(c) || IsIosOrTvos(c), "UIWIDGETS_FORCE_DISABLE_PERSISTENTCACHE=\\\"1\\\"");
np.Defines.Add(c => c.CodeGen == CodeGen.Debug,
new[] { "_ITERATOR_DEBUG_LEVEL=2", "_HAS_ITERATOR_DEBUGGING=1", "_SECURE_SCL=1" });

Просмотреть файл

@ -88,6 +88,7 @@ void Rasterizer::DrawLastLayerTree() {
return;
}
DrawToSurface(*last_layer_tree_);
surface_->ClearContext();
}
void Rasterizer::Draw(fml::RefPtr<Pipeline<LayerTree>> pipeline) {
@ -232,6 +233,8 @@ RasterStatus Rasterizer::DoDraw(std::unique_ptr<LayerTree> layer_tree) {
persistent_cache->ResetStoredNewShaders();
RasterStatus raster_status = DrawToSurface(*layer_tree);
surface_->ClearContext();
if (raster_status == RasterStatus::kSuccess) {
last_layer_tree_ = std::move(layer_tree);
} else if (raster_status == RasterStatus::kResubmit) {
@ -325,7 +328,6 @@ RasterStatus Rasterizer::DrawToSurface(LayerTree& layer_tree) {
if (compositor_frame) {
RasterStatus raster_status = compositor_frame->Raster(layer_tree, false);
if (raster_status == RasterStatus::kFailed) {
surface_->ClearContext();
return raster_status;
}
if (external_view_embedder != nullptr) {
@ -347,11 +349,9 @@ RasterStatus Rasterizer::DrawToSurface(LayerTree& layer_tree) {
TRACE_EVENT0("uiwidgets", "PerformDeferredSkiaCleanup");
surface_->GetContext()->performDeferredCleanup(kSkiaCleanupExpiration);
}
surface_->ClearContext();
return raster_status;
}
surface_->ClearContext();
return RasterStatus::kFailed;
}