summaryrefslogtreecommitdiffstats
path: root/graphics
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2013-09-03 16:38:55 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-09-03 16:38:55 -0700
commitb6c4324fba7b71e6f8aa46ab8ad6bdb0f02d29ee (patch)
tree06ad9e0a4348411f3f922086e3a40c637fff5620 /graphics
parent3e63d7783794695e3d871dbcc84fc858815ae371 (diff)
parent9a160a52b9edfc32e2fe444b3925534ae21ed5bc (diff)
downloadframeworks_base-b6c4324fba7b71e6f8aa46ab8ad6bdb0f02d29ee.zip
frameworks_base-b6c4324fba7b71e6f8aa46ab8ad6bdb0f02d29ee.tar.gz
frameworks_base-b6c4324fba7b71e6f8aa46ab8ad6bdb0f02d29ee.tar.bz2
am 9a160a52: am e182bfd4: Merge "Prevent NPE when cloning gradients Bug #10436856" into klp-dev
* commit '9a160a52b9edfc32e2fe444b3925534ae21ed5bc': Prevent NPE when cloning gradients Bug #10436856
Diffstat (limited to 'graphics')
-rw-r--r--graphics/java/android/graphics/LinearGradient.java4
-rw-r--r--graphics/java/android/graphics/RadialGradient.java4
-rw-r--r--graphics/java/android/graphics/SweepGradient.java3
3 files changed, 6 insertions, 5 deletions
diff --git a/graphics/java/android/graphics/LinearGradient.java b/graphics/java/android/graphics/LinearGradient.java
index 54cdcab..4c88de3 100644
--- a/graphics/java/android/graphics/LinearGradient.java
+++ b/graphics/java/android/graphics/LinearGradient.java
@@ -102,8 +102,8 @@ public class LinearGradient extends Shader {
final LinearGradient copy;
switch (mType) {
case TYPE_COLORS_AND_POSITIONS:
- copy = new LinearGradient(mX0, mY0, mX1, mY1, mColors.clone(), mPositions.clone(),
- mTileMode);
+ copy = new LinearGradient(mX0, mY0, mX1, mY1, mColors.clone(),
+ mPositions != null ? mPositions.clone() : null, mTileMode);
break;
case TYPE_COLOR_START_AND_COLOR_END:
copy = new LinearGradient(mX0, mY0, mX1, mY1, mColor0, mColor1, mTileMode);
diff --git a/graphics/java/android/graphics/RadialGradient.java b/graphics/java/android/graphics/RadialGradient.java
index 23244d8..f011e5c 100644
--- a/graphics/java/android/graphics/RadialGradient.java
+++ b/graphics/java/android/graphics/RadialGradient.java
@@ -103,8 +103,8 @@ public class RadialGradient extends Shader {
final RadialGradient copy;
switch (mType) {
case TYPE_COLORS_AND_POSITIONS:
- copy = new RadialGradient(mX, mY, mRadius, mColors.clone(), mPositions.clone(),
- mTileMode);
+ copy = new RadialGradient(mX, mY, mRadius, mColors.clone(),
+ mPositions != null ? mPositions.clone() : null, mTileMode);
break;
case TYPE_COLOR_CENTER_AND_COLOR_EDGE:
copy = new RadialGradient(mX, mY, mRadius, mColor0, mColor1, mTileMode);
diff --git a/graphics/java/android/graphics/SweepGradient.java b/graphics/java/android/graphics/SweepGradient.java
index 3010927..e9cda39 100644
--- a/graphics/java/android/graphics/SweepGradient.java
+++ b/graphics/java/android/graphics/SweepGradient.java
@@ -92,7 +92,8 @@ public class SweepGradient extends Shader {
final SweepGradient copy;
switch (mType) {
case TYPE_COLORS_AND_POSITIONS:
- copy = new SweepGradient(mCx, mCy, mColors.clone(), mPositions.clone());
+ copy = new SweepGradient(mCx, mCy, mColors.clone(),
+ mPositions != null ? mPositions.clone() : null);
break;
case TYPE_COLOR_START_AND_COLOR_END:
copy = new SweepGradient(mCx, mCy, mColor0, mColor1);