diff options
| author | 2021-03-05 03:14:55 +0000 | |
|---|---|---|
| committer | 2021-03-05 03:14:55 +0000 | |
| commit | 6f2ee4b4a0dede44c2764988483df36d76896f8a (patch) | |
| tree | 154fc8eefe93debec715a9630cd522f0550e413a /graphics/java/android | |
| parent | cc72c25af59898f5631d800e8bb77633f1c31e77 (diff) | |
| parent | 6701a6014f6fea668abc25b804491b50b0c35afc (diff) | |
Merge "Wire SKSL based stretch shader to HWUI" into sc-dev
Diffstat (limited to 'graphics/java/android')
| -rw-r--r-- | graphics/java/android/graphics/RenderNode.java | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/graphics/java/android/graphics/RenderNode.java b/graphics/java/android/graphics/RenderNode.java index f6f770be3de8..da5162b9e15e 100644 --- a/graphics/java/android/graphics/RenderNode.java +++ b/graphics/java/android/graphics/RenderNode.java @@ -719,11 +719,11 @@ public final class RenderNode { /** @hide */ public boolean stretch(float left, float top, float right, float bottom, float vecX, float vecY, float maxStretchAmount) { - if (1.0 < vecX || vecX < -1.0) { - throw new IllegalArgumentException("vecX must be in the range [-1, 1], was " + vecX); + if (Float.isInfinite(vecX) || Float.isNaN(vecX)) { + throw new IllegalArgumentException("vecX must be a finite, non-NaN value " + vecX); } - if (1.0 < vecY || vecY < -1.0) { - throw new IllegalArgumentException("vecY must be in the range [-1, 1], was " + vecY); + if (Float.isInfinite(vecY) || Float.isNaN(vecY)) { + throw new IllegalArgumentException("vecY must be a finite, non-NaN value " + vecY); } if (top >= bottom || left >= right) { throw new IllegalArgumentException( @@ -734,7 +734,16 @@ public final class RenderNode { throw new IllegalArgumentException( "The max stretch amount must be >0, got " + maxStretchAmount); } - return nStretch(mNativeRenderNode, left, top, right, bottom, vecX, vecY, maxStretchAmount); + return nStretch( + mNativeRenderNode, + left, + top, + right, + bottom, + vecX, + vecY, + maxStretchAmount + ); } /** |