Index: src/core/SkDevice.cpp |
diff --git a/src/core/SkDevice.cpp b/src/core/SkDevice.cpp |
index a90076d44216d98cac3f41056b5e8fd0f35ac328..3e1064018c7bef9768988d489aa92f116c783361 100644 |
--- a/src/core/SkDevice.cpp |
+++ b/src/core/SkDevice.cpp |
@@ -72,6 +72,22 @@ SkPixelGeometry SkBaseDevice::CreateInfo::AdjustGeometry(const SkImageInfo& info |
return geo; |
} |
+void SkBaseDevice::drawRegion(const SkDraw& draw, const SkRegion& region, const SkPaint& paint) { |
+ bool complexMatrix = !draw.fMatrix->isScaleTranslate(); |
+ bool complexPaint = paint.isAntiAlias() || paint.getImageFilter() || paint.getMaskFilter(); |
+ if (complexMatrix && complexPaint) { |
msarett
2016/08/25 13:02:32
Hwui also checks that the paint must be kFill_Styl
bsalomon
2016/08/25 13:58:20
To me a clear definition of drawRegion(region, pai
msarett
2016/08/25 15:07:35
Agreed.
New checks should catch everything I thin
|
+ SkPath path; |
+ region.getBoundaryPath(&path); |
+ return this->drawPath(draw, path, paint, nullptr, false); |
+ } |
+ |
+ SkRegion::Iterator it(region); |
+ while (!it.done()) { |
+ this->drawRect(draw, SkRect::Make(it.rect()), paint); |
+ it.next(); |
+ } |
+} |
+ |
void SkBaseDevice::drawArc(const SkDraw& draw, const SkRect& oval, SkScalar startAngle, |
SkScalar sweepAngle, bool useCenter, const SkPaint& paint) { |
SkASSERT(SkScalarAbs(sweepAngle) >= 0.f && SkScalarAbs(sweepAngle) < 360.f); |