Remove strict equality check for SkMatrix comparison (flutter/engine#38665)
* Remove strict equality check for SkMatrix comparison * Address PR comments
This commit is contained in:
@@ -328,16 +328,28 @@ void GfxExternalViewEmbedder::SubmitFrame(
|
||||
kScenicZElevationBetweenLayers * scenic_layer_index +
|
||||
embedded_views_height;
|
||||
|
||||
if (view_mutators.total_transform != view_params.transformMatrix()) {
|
||||
FML_LOG(ERROR) << "Failed assertion: view_mutators.total_transform "
|
||||
"!= view_params.transformMatrix()";
|
||||
FML_LOG(ERROR) << "view_mutators.total_transform:";
|
||||
view_mutators.total_transform.dump();
|
||||
FML_LOG(ERROR) << "view_params.transformMatrix():";
|
||||
view_params.transformMatrix().dump();
|
||||
FML_LOG(FATAL) << "view_mutators.total_transform "
|
||||
"!= view_params.transformMatrix()";
|
||||
// Verify that we're unpacking the mutators' transform matrix correctly
|
||||
// on debug builds Use built-in get method for SkMatrix to get values
|
||||
// See:
|
||||
// https://source.corp.google.com/piper///depot/google3/third_party/skia/HEAD/include/core/SkMatrix.h;l=391
|
||||
#ifdef NDEBUG
|
||||
for (int index = 0; index < 9; index++) {
|
||||
const SkScalar mutators_transform_value =
|
||||
view_mutators.total_transform.get(index);
|
||||
const SkScalar params_transform_value =
|
||||
view_params.transformMatrix().get(index);
|
||||
if (!SkScalarNearlyEqual(mutators_transform_value,
|
||||
params_transform_value, 0.0005f)) {
|
||||
FML_LOG(FATAL)
|
||||
<< "Assertion failed: view_mutators.total_transform[" << index
|
||||
<< "] (" << mutators_transform_value
|
||||
<< ") != view_params.transformMatrix()[" << index << "] ("
|
||||
<< params_transform_value
|
||||
<< "). This likely means there is a bug with the "
|
||||
<< "logic for parsing embedded views' transform matrices.";
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// Set clips for the platform view.
|
||||
if (view_mutators.clips != view_holder.mutators.clips) {
|
||||
|
||||
Reference in New Issue
Block a user