Loading graphics/java/android/graphics/drawable/GradientDrawable.java +9 −1 Original line number Diff line number Diff line Loading @@ -513,7 +513,10 @@ public class GradientDrawable extends Drawable { canvas.drawRoundRect(mRect, rad, rad, mStrokePaint); } } else { if (mFillPaint.getColor() != 0 || mColorFilter != null || mFillPaint.getShader() != null) { canvas.drawRect(mRect, mFillPaint); } if (haveStroke) { canvas.drawRect(mRect, mStrokePaint); } Loading Loading @@ -1251,6 +1254,11 @@ public class GradientDrawable extends Drawable { private void initializeWithState(GradientState state) { if (state.mHasSolidColor) { mFillPaint.setColor(state.mSolidColor); } else if (state.mColors == null) { // If we don't have a solid color and we don't have a gradient, // the app is stroking the shape, set the color to the default // value of state.mSolidColor mFillPaint.setColor(0); } mPadding = state.mPadding; if (state.mStrokeWidth >= 0) { Loading libs/hwui/OpenGLRenderer.cpp +21 −4 Original line number Diff line number Diff line Loading @@ -2440,18 +2440,35 @@ status_t OpenGLRenderer::drawArc(float left, float top, float right, float botto return drawShape(left, top, texture, paint); } // See SkPaintDefaults.h #define SkPaintDefaults_MiterLimit SkIntToScalar(4) status_t OpenGLRenderer::drawRect(float left, float top, float right, float bottom, SkPaint* p) { if (mSnapshot->isIgnored() || quickRejectPreStroke(left, top, right, bottom, p)) { return DrawGlInfo::kStatusDone; } // only fill style is supported by drawConvexPath, since others have to handle joins if (p->getStyle() != SkPaint::kFill_Style) { // only fill style is supported by drawConvexPath, since others have to handle joins if (p->getPathEffect() != 0 || p->getStrokeJoin() != SkPaint::kMiter_Join || p->getStrokeMiter() != SkPaintDefaults_MiterLimit) { mCaches.activeTexture(0); const PathTexture* texture = mCaches.rectShapeCache.getRect(right - left, bottom - top, p); const PathTexture* texture = mCaches.rectShapeCache.getRect(right - left, bottom - top, p); return drawShape(left, top, texture, p); } SkPath path; SkRect rect = SkRect::MakeLTRB(left, top, right, bottom); if (p->getStyle() == SkPaint::kStrokeAndFill_Style) { rect.outset(p->getStrokeWidth() / 2, p->getStrokeWidth() / 2); } path.addRect(rect); drawConvexPath(path, p); return DrawGlInfo::kStatusDrew; } if (p->isAntiAlias() && !mSnapshot->transform->isSimple()) { SkPath path; path.addRect(left, top, right, bottom); Loading Loading
graphics/java/android/graphics/drawable/GradientDrawable.java +9 −1 Original line number Diff line number Diff line Loading @@ -513,7 +513,10 @@ public class GradientDrawable extends Drawable { canvas.drawRoundRect(mRect, rad, rad, mStrokePaint); } } else { if (mFillPaint.getColor() != 0 || mColorFilter != null || mFillPaint.getShader() != null) { canvas.drawRect(mRect, mFillPaint); } if (haveStroke) { canvas.drawRect(mRect, mStrokePaint); } Loading Loading @@ -1251,6 +1254,11 @@ public class GradientDrawable extends Drawable { private void initializeWithState(GradientState state) { if (state.mHasSolidColor) { mFillPaint.setColor(state.mSolidColor); } else if (state.mColors == null) { // If we don't have a solid color and we don't have a gradient, // the app is stroking the shape, set the color to the default // value of state.mSolidColor mFillPaint.setColor(0); } mPadding = state.mPadding; if (state.mStrokeWidth >= 0) { Loading
libs/hwui/OpenGLRenderer.cpp +21 −4 Original line number Diff line number Diff line Loading @@ -2440,18 +2440,35 @@ status_t OpenGLRenderer::drawArc(float left, float top, float right, float botto return drawShape(left, top, texture, paint); } // See SkPaintDefaults.h #define SkPaintDefaults_MiterLimit SkIntToScalar(4) status_t OpenGLRenderer::drawRect(float left, float top, float right, float bottom, SkPaint* p) { if (mSnapshot->isIgnored() || quickRejectPreStroke(left, top, right, bottom, p)) { return DrawGlInfo::kStatusDone; } // only fill style is supported by drawConvexPath, since others have to handle joins if (p->getStyle() != SkPaint::kFill_Style) { // only fill style is supported by drawConvexPath, since others have to handle joins if (p->getPathEffect() != 0 || p->getStrokeJoin() != SkPaint::kMiter_Join || p->getStrokeMiter() != SkPaintDefaults_MiterLimit) { mCaches.activeTexture(0); const PathTexture* texture = mCaches.rectShapeCache.getRect(right - left, bottom - top, p); const PathTexture* texture = mCaches.rectShapeCache.getRect(right - left, bottom - top, p); return drawShape(left, top, texture, p); } SkPath path; SkRect rect = SkRect::MakeLTRB(left, top, right, bottom); if (p->getStyle() == SkPaint::kStrokeAndFill_Style) { rect.outset(p->getStrokeWidth() / 2, p->getStrokeWidth() / 2); } path.addRect(rect); drawConvexPath(path, p); return DrawGlInfo::kStatusDrew; } if (p->isAntiAlias() && !mSnapshot->transform->isSimple()) { SkPath path; path.addRect(left, top, right, bottom); Loading