Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 8104913

Browse files
authored
Remove strict equality check for SkMatrix comparison (#38665)
Cherrypick: * Remove strict equality check for SkMatrix comparison (#38665)
1 parent 0efb0ef commit 8104913

File tree

2 files changed

+24
-3
lines changed

2 files changed

+24
-3
lines changed

.ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
enabled_branches:
99
- main
1010
- flutter-\d+\.\d+-candidate\.\d+
11-
- fuchsia_r\d+
11+
- fuchsia_r\d+[a-z]*
1212

1313
platform_properties:
1414
linux:

shell/platform/fuchsia/flutter/gfx_external_view_embedder.cc

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,8 +327,29 @@ void GfxExternalViewEmbedder::SubmitFrame(
327327
const float view_elevation =
328328
kScenicZElevationBetweenLayers * scenic_layer_index +
329329
embedded_views_height;
330-
FML_CHECK(view_mutators.total_transform ==
331-
view_params.transformMatrix());
330+
331+
// Verify that we're unpacking the mutators' transform matrix correctly
332+
// on debug builds Use built-in get method for SkMatrix to get values
333+
// See:
334+
// https://source.corp.google.com/piper///depot/google3/third_party/skia/HEAD/include/core/SkMatrix.h;l=391
335+
#ifdef NDEBUG
336+
for (int index = 0; index < 9; index++) {
337+
const SkScalar mutators_transform_value =
338+
view_mutators.total_transform.get(index);
339+
const SkScalar params_transform_value =
340+
view_params.transformMatrix().get(index);
341+
if (!SkScalarNearlyEqual(mutators_transform_value,
342+
params_transform_value, 0.0005f)) {
343+
FML_LOG(FATAL)
344+
<< "Assertion failed: view_mutators.total_transform[" << index
345+
<< "] (" << mutators_transform_value
346+
<< ") != view_params.transformMatrix()[" << index << "] ("
347+
<< params_transform_value
348+
<< "). This likely means there is a bug with the "
349+
<< "logic for parsing embedded views' transform matrices.";
350+
}
351+
}
352+
#endif
332353

333354
// Set clips for the platform view.
334355
if (view_mutators.clips != view_holder.mutators.clips) {

0 commit comments

Comments
 (0)