From 0bd7332179ca3aa537011233377301d46dc1c584 Mon Sep 17 00:00:00 2001 From: fzyzcjy <5236035+fzyzcjy@users.noreply.github.com> Date: Fri, 28 Oct 2022 23:51:18 +0800 Subject: [PATCH] Let `_debugCheckNotUsedAsOldLayer` provide hashcode in addition to runtime type (flutter/engine#36985) * Update compositing.dart * Update compositing.dart * Update compositing.dart --- engine/src/flutter/lib/ui/compositing.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/engine/src/flutter/lib/ui/compositing.dart b/engine/src/flutter/lib/ui/compositing.dart index 843be9631a..30104639e7 100644 --- a/engine/src/flutter/lib/ui/compositing.dart +++ b/engine/src/flutter/lib/ui/compositing.dart @@ -106,9 +106,10 @@ abstract class _EngineLayerWrapper implements EngineLayer { bool _debugWasUsedAsOldLayer = false; bool _debugCheckNotUsedAsOldLayer() { + // The hashCode formatting should match shortHash in the framework assert( !_debugWasUsedAsOldLayer, - 'Layer $runtimeType was previously used as oldLayer.\n' + 'Layer $runtimeType#${hashCode.toUnsigned(20).toRadixString(16).padLeft(5, '0')} was previously used as oldLayer.\n' 'Once a layer is used as oldLayer, it may not be used again. Instead, ' 'after calling one of the SceneBuilder.push* methods and passing an oldLayer ' 'to it, use the layer returned by the method as oldLayer in subsequent '