[code-health] Standardize TransformOperation::CanBlendWith()
This replaces the existing virtual implementations of TransformOperation::CanBlendWith() with a single one that compares PrimitiveType() values, as defined in the spec. Years ago, CanBlendWith was only used by BlendedBoundsForBox, and returned false on operation types not supported by that method. As these checks are currently in BlendedBoundsForBox itself, and CanBlendWith is used in some Blend() implementations, eliminate the return false cases in favor of the as-specced primitive type comparison. As CanBlendWith is now to-spec for all operation types, replace the many ad-hoc primitive type comparisons with calls to CanBlendWith(). Change if/return type checks in TransformOperation::Blend() to DCHECKs as the there is already a type check at the call site in TransformOperations, so these should always succeed. In the case of SkewTransformOperation, replace the loose type check (which would allow blending between skewX and skewY which have different primitive types) with CanBlendWith. This causes no behavioral change since a primitive type comparison already existed in the caller. Change-Id: Ife892b72798fe81d61ff6528deff064f41bdbfbb Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2432672Reviewed-by:Kevin Ellis <kevers@chromium.org> Reviewed-by:
Ian Vollick <vollick@chromium.org> Commit-Queue: George Steel <gtsteel@chromium.org> Cr-Commit-Position: refs/heads/master@{#813815}
Showing
Please register or sign in to comment