[Impeller] Present Impeller contents in a transaction when there is a platform view (flutter/engine#37809)

This commit is contained in:
Zachary Anderson 2022-11-21 09:45:26 -08:00 committed by GitHub
parent 659b53cfc5
commit 2a9bcb43d1

View File

@ -48,6 +48,12 @@ GPUCAMetalLayerHandle IOSSurfaceMetalImpeller::GetCAMetalLayer(const SkISize& fr
if (!CGSizeEqualToSize(drawable_size, layer.drawableSize)) {
layer.drawableSize = drawable_size;
}
// When there are platform views in the scene, the drawable needs to be presented in the same
// transaction as the one created for platform views. When the drawable are being presented from
// the raster thread, there is no such transaction.
layer.presentsWithTransaction = [[NSThread currentThread] isMainThread];
return layer;
}