Loading graphics/java/android/graphics/drawable/GradientDrawable.java +11 −4 Original line number Diff line number Diff line Loading @@ -126,7 +126,7 @@ public class GradientDrawable extends Drawable { private boolean mRectIsDirty; // internal state private boolean mMutated; private Path mRingPath; private boolean mPathIsDirty; private boolean mPathIsDirty = true; /** * Controls how the gradient is oriented relative to the drawable's bounds Loading Loading @@ -179,6 +179,7 @@ public class GradientDrawable extends Drawable { */ public void setCornerRadii(float[] radii) { mGradientState.setCornerRadii(radii); mPathIsDirty = true; } /** Loading @@ -187,6 +188,7 @@ public class GradientDrawable extends Drawable { */ public void setCornerRadius(float radius) { mGradientState.setCornerRadius(radius); mPathIsDirty = true; } /** Loading Loading @@ -216,10 +218,12 @@ public class GradientDrawable extends Drawable { public void setSize(int width, int height) { mGradientState.setSize(width, height); mPathIsDirty = true; } public void setShape(int shape) { mRingPath = null; mPathIsDirty = true; mGradientState.setShape(shape); } Loading Loading @@ -312,8 +316,11 @@ public class GradientDrawable extends Drawable { switch (st.mShape) { case RECTANGLE: if (st.mRadiusArray != null) { if (mPathIsDirty || mRectIsDirty) { mPath.reset(); mPath.addRoundRect(mRect, st.mRadiusArray, Path.Direction.CW); mPathIsDirty = mRectIsDirty = false; } canvas.drawPath(mPath, mFillPaint); if (haveStroke) { canvas.drawPath(mPath, mStrokePaint); Loading libs/hwui/PathCache.cpp +7 −1 Original line number Diff line number Diff line Loading @@ -173,9 +173,15 @@ PathTexture* PathCache::addTexture(const PathCacheEntry& entry, bitmap.allocPixels(); bitmap.eraseColor(0); SkPaint pathPaint(*paint); if (!pathPaint.getXfermode()) { SkXfermode* mode = SkXfermode::Create(SkXfermode::kSrc_Mode); pathPaint.setXfermode(mode)->safeUnref(); } SkCanvas canvas(bitmap); canvas.translate(-bounds.fLeft + offset, -bounds.fTop + offset); canvas.drawPath(*path, *paint); canvas.drawPath(*path, pathPaint); generateTexture(bitmap, texture); Loading Loading
graphics/java/android/graphics/drawable/GradientDrawable.java +11 −4 Original line number Diff line number Diff line Loading @@ -126,7 +126,7 @@ public class GradientDrawable extends Drawable { private boolean mRectIsDirty; // internal state private boolean mMutated; private Path mRingPath; private boolean mPathIsDirty; private boolean mPathIsDirty = true; /** * Controls how the gradient is oriented relative to the drawable's bounds Loading Loading @@ -179,6 +179,7 @@ public class GradientDrawable extends Drawable { */ public void setCornerRadii(float[] radii) { mGradientState.setCornerRadii(radii); mPathIsDirty = true; } /** Loading @@ -187,6 +188,7 @@ public class GradientDrawable extends Drawable { */ public void setCornerRadius(float radius) { mGradientState.setCornerRadius(radius); mPathIsDirty = true; } /** Loading Loading @@ -216,10 +218,12 @@ public class GradientDrawable extends Drawable { public void setSize(int width, int height) { mGradientState.setSize(width, height); mPathIsDirty = true; } public void setShape(int shape) { mRingPath = null; mPathIsDirty = true; mGradientState.setShape(shape); } Loading Loading @@ -312,8 +316,11 @@ public class GradientDrawable extends Drawable { switch (st.mShape) { case RECTANGLE: if (st.mRadiusArray != null) { if (mPathIsDirty || mRectIsDirty) { mPath.reset(); mPath.addRoundRect(mRect, st.mRadiusArray, Path.Direction.CW); mPathIsDirty = mRectIsDirty = false; } canvas.drawPath(mPath, mFillPaint); if (haveStroke) { canvas.drawPath(mPath, mStrokePaint); Loading
libs/hwui/PathCache.cpp +7 −1 Original line number Diff line number Diff line Loading @@ -173,9 +173,15 @@ PathTexture* PathCache::addTexture(const PathCacheEntry& entry, bitmap.allocPixels(); bitmap.eraseColor(0); SkPaint pathPaint(*paint); if (!pathPaint.getXfermode()) { SkXfermode* mode = SkXfermode::Create(SkXfermode::kSrc_Mode); pathPaint.setXfermode(mode)->safeUnref(); } SkCanvas canvas(bitmap); canvas.translate(-bounds.fLeft + offset, -bounds.fTop + offset); canvas.drawPath(*path, *paint); canvas.drawPath(*path, pathPaint); generateTexture(bitmap, texture); Loading