Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(210)

Unified Diff: src/gpu/GrDrawContext.cpp

Issue 2135883002: Fix misplaced guard (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDrawContext.cpp
diff --git a/src/gpu/GrDrawContext.cpp b/src/gpu/GrDrawContext.cpp
index aa7057510ce9d88508ac45ab3a15abca06e588a7..a86e01e72b385328b069f84f412f43bfcc58e604 100644
--- a/src/gpu/GrDrawContext.cpp
+++ b/src/gpu/GrDrawContext.cpp
@@ -337,31 +337,33 @@ void GrDrawContext::drawRect(const GrClip& clip,
AutoCheckFlush acf(fDrawingManager);
const SkStrokeRec& stroke = style->strokeRec();
- if (stroke.getStyle() == SkStrokeRec::kFill_Style &&
- !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;
- fRenderTarget->getBoundsRect(&rtRect);
- // Does the clip contain the entire RT?
- if (clip.quickContains(rtRect)) {
- SkMatrix invM;
- if (!viewMatrix.invert(&invM)) {
- return;
- }
- // Does the rect bound the RT?
- SkPoint srcSpaceRTQuad[4];
- invM.mapRectToQuad(srcSpaceRTQuad, rtRect);
- if (rect_contains_inclusive(rect, srcSpaceRTQuad[0]) &&
- rect_contains_inclusive(rect, srcSpaceRTQuad[1]) &&
- rect_contains_inclusive(rect, srcSpaceRTQuad[2]) &&
- rect_contains_inclusive(rect, srcSpaceRTQuad[3])) {
- // Will it blend?
- GrColor clearColor;
- if (paint.isConstantBlendedColor(&clearColor)) {
- this->getDrawTarget()->clear(nullptr, clearColor, true, this);
+ 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;
+ fRenderTarget->getBoundsRect(&rtRect);
+ // Does the clip contain the entire RT?
+ if (clip.quickContains(rtRect)) {
+ SkMatrix invM;
+ if (!viewMatrix.invert(&invM)) {
return;
}
+ // Does the rect bound the RT?
+ SkPoint srcSpaceRTQuad[4];
+ invM.mapRectToQuad(srcSpaceRTQuad, rtRect);
+ if (rect_contains_inclusive(rect, srcSpaceRTQuad[0]) &&
+ rect_contains_inclusive(rect, srcSpaceRTQuad[1]) &&
+ rect_contains_inclusive(rect, srcSpaceRTQuad[2]) &&
+ rect_contains_inclusive(rect, srcSpaceRTQuad[3])) {
+ // Will it blend?
+ GrColor clearColor;
+ if (paint.isConstantBlendedColor(&clearColor)) {
+ this->getDrawTarget()->clear(nullptr, clearColor, true, this);
+ return;
+ }
+ }
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698