mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
fix "TREE INCONSISTENT" noise in compositing_test.dart (#16995)
This commit is contained in:
parent
cb3237e255
commit
4f4fdbf21f
@ -356,6 +356,11 @@ abstract class PersistedPicture extends PersistedLeafSurface {
|
||||
|
||||
EngineCanvas _canvas;
|
||||
|
||||
/// Returns the canvas used by this picture layer.
|
||||
///
|
||||
/// Useful for tests.
|
||||
EngineCanvas get debugCanvas => _canvas;
|
||||
|
||||
final double dx;
|
||||
final double dy;
|
||||
final EnginePicture picture;
|
||||
@ -624,7 +629,7 @@ abstract class PersistedPicture extends PersistedLeafSurface {
|
||||
super.debugValidate(validationErrors);
|
||||
|
||||
if (picture.recordingCanvas.didDraw) {
|
||||
if (_canvas == null) {
|
||||
if (debugCanvas == null) {
|
||||
validationErrors
|
||||
.add('$runtimeType has non-trivial picture but it has null canvas');
|
||||
}
|
||||
|
||||
@ -151,7 +151,7 @@ void main() {
|
||||
|
||||
scene2.preroll();
|
||||
scene2.update(scene1);
|
||||
commitScene(scene1);
|
||||
commitScene(scene2);
|
||||
expect(picture.retainCount, 1);
|
||||
expect(picture.buildCount, 1);
|
||||
expect(picture.updateCount, 0);
|
||||
@ -169,7 +169,7 @@ void main() {
|
||||
|
||||
scene3.preroll();
|
||||
scene3.update(scene2);
|
||||
commitScene(scene1);
|
||||
commitScene(scene3);
|
||||
expect(picture.retainCount, 2);
|
||||
expect(picture.buildCount, 1);
|
||||
expect(picture.updateCount, 0);
|
||||
@ -271,6 +271,13 @@ class MockPersistedPicture extends PersistedPicture {
|
||||
int updateCount = 0;
|
||||
int applyPaintCount = 0;
|
||||
|
||||
final BitmapCanvas _fakeCanvas = BitmapCanvas(const Rect.fromLTRB(0, 0, 10, 10));
|
||||
|
||||
@override
|
||||
EngineCanvas get debugCanvas {
|
||||
return _fakeCanvas;
|
||||
}
|
||||
|
||||
@override
|
||||
double matchForUpdate(PersistedPicture existingSurface) {
|
||||
return identical(existingSurface.picture, picture) ? 0.0 : 1.0;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user