quick check to not use AutoDrawLooper
BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2248373004 Review-Url: https://codereview.chromium.org/2248373004
This commit is contained in:
parent
6b7a6c74dc
commit
4a16717bc7
@ -2204,6 +2204,14 @@ void SkCanvas::onDrawPoints(PointMode mode, size_t count, const SkPoint pts[],
|
||||
LOOPER_END
|
||||
}
|
||||
|
||||
static bool needs_autodrawlooper(SkCanvas* canvas, const SkPaint& paint) {
|
||||
return ((intptr_t)paint.getImageFilter() |
|
||||
#ifdef SK_SUPPORT_LEGACY_DRAWFILTER
|
||||
(intptr_t)canvas->getDrawFilter() |
|
||||
#endif
|
||||
(intptr_t)paint.getLooper() ) != 0;
|
||||
}
|
||||
|
||||
void SkCanvas::onDrawRect(const SkRect& r, const SkPaint& paint) {
|
||||
TRACE_EVENT0("disabled-by-default-skia", "SkCanvas::drawRect()");
|
||||
SkRect storage;
|
||||
@ -2220,6 +2228,7 @@ void SkCanvas::onDrawRect(const SkRect& r, const SkPaint& paint) {
|
||||
bounds = &r;
|
||||
}
|
||||
|
||||
if (needs_autodrawlooper(this, paint)) {
|
||||
LOOPER_BEGIN_CHECK_COMPLETE_OVERWRITE(paint, SkDrawFilter::kRect_Type, bounds, false)
|
||||
|
||||
while (iter.next()) {
|
||||
@ -2227,6 +2236,13 @@ void SkCanvas::onDrawRect(const SkRect& r, const SkPaint& paint) {
|
||||
}
|
||||
|
||||
LOOPER_END
|
||||
} else {
|
||||
this->predrawNotify(bounds, &paint, false);
|
||||
SkDrawIter iter(this);
|
||||
while (iter.next()) {
|
||||
iter.fDevice->drawRect(iter, r, paint);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SkCanvas::onDrawOval(const SkRect& oval, const SkPaint& paint) {
|
||||
|
Loading…
Reference in New Issue
Block a user