Fix misplaced guard

This fixes an error in https://codereview.chromium.org/2125333002 (Add choke point for modifying non-AA rect draws (e.g., applying clipping)).

In GrDrawContext::drawRect, when we need to draw a filled rect, we always want to call drawFilledRect when useDrawInsteadOfClear is false. With the buggy code I believe we were falling back to drawing a path.

TBR=bsalomon@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2135883002

Review-Url: https://codereview.chromium.org/2135883002
This commit is contained in:
robertphillips 2016-07-10 11:49:39 -07:00 committed by Commit bot
parent 6092b6e0e5
commit 3ab14ca950

View File

@ -337,8 +337,9 @@ void GrDrawContext::drawRect(const GrClip& clip,
AutoCheckFlush acf(fDrawingManager);
const SkStrokeRec& stroke = style->strokeRec();
if (stroke.getStyle() == SkStrokeRec::kFill_Style &&
!fContext->caps()->useDrawInsteadOfClear()) {
if (stroke.getStyle() == SkStrokeRec::kFill_Style) {
if (!fContext->caps()->useDrawInsteadOfClear()) {
// Check if this is a full RT draw and can be replaced with a clear. We don't bother
// checking cases where the RT is fully inside a stroke.
SkRect rtRect;
@ -364,6 +365,7 @@ void GrDrawContext::drawRect(const GrClip& clip,
}
}
}
}
if (this->drawFilledRect(clip, paint, viewMatrix, rect, nullptr)) {
return;