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

Unified Diff: src/gpu/GrDrawContext.cpp

Issue 2187583002: Fix GrDrawContextPriv::stencilRect (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix GrDrawContextPriv::stencilRect 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 | « include/gpu/GrDrawContext.h ('k') | 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 266c50d70c60360fcae7435b2230444cba218d24..fedb397200ff20d30f9a5cdefc4720724a60a61a 100644
--- a/src/gpu/GrDrawContext.cpp
+++ b/src/gpu/GrDrawContext.cpp
@@ -277,7 +277,8 @@ void GrDrawContext::drawPaint(const GrClip& clip,
AutoCheckFlush acf(fDrawingManager);
- this->drawNonAAFilledRect(clip, *paint, SkMatrix::I(), r, nullptr, &localMatrix, nullptr);
+ this->drawNonAAFilledRect(clip, *paint, SkMatrix::I(), r, nullptr, &localMatrix, nullptr,
+ false /* useHWAA */);
}
}
@@ -399,7 +400,8 @@ bool GrDrawContext::drawFilledRect(const GrClip& clip,
}
}
} else {
- this->drawNonAAFilledRect(clip, paint, viewMatrix, croppedRect, nullptr, nullptr, ss);
+ this->drawNonAAFilledRect(clip, paint, viewMatrix, croppedRect, nullptr, nullptr, ss,
+ useHWAA);
return true;
}
@@ -566,9 +568,7 @@ void GrDrawContextPriv::stencilRect(const GrFixedClip& clip,
paint.setAntiAlias(useHWAA);
paint.setXPFactory(GrDisableColorXPFactory::Make());
- SkASSERT(!useHWAA || fDrawContext->isStencilBufferMultisampled());
-
- fDrawContext->drawFilledRect(clip, paint, viewMatrix, rect, ss);
+ fDrawContext->drawNonAAFilledRect(clip, paint, viewMatrix, rect, nullptr, nullptr, ss, useHWAA);
}
bool GrDrawContextPriv::drawAndStencilRect(const GrFixedClip& clip,
@@ -631,7 +631,7 @@ void GrDrawContext::fillRectToRect(const GrClip& clip,
if (!should_apply_coverage_aa(paint, fRenderTarget.get(), &useHWAA)) {
this->drawNonAAFilledRect(clip, paint, viewMatrix, croppedRect, &croppedLocalRect,
- nullptr, nullptr);
+ nullptr, nullptr, useHWAA);
return;
}
@@ -689,7 +689,7 @@ void GrDrawContext::fillRectWithLocalMatrix(const GrClip& clip,
if (!should_apply_coverage_aa(paint, fRenderTarget.get(), &useHWAA)) {
this->drawNonAAFilledRect(clip, paint, viewMatrix, croppedRect, nullptr,
- &localMatrix, nullptr);
+ &localMatrix, nullptr, useHWAA);
return;
}
@@ -1025,11 +1025,13 @@ void GrDrawContext::drawNonAAFilledRect(const GrClip& clip,
const SkRect& rect,
const SkRect* localRect,
const SkMatrix* localMatrix,
- const GrUserStencilSettings* ss) {
+ const GrUserStencilSettings* ss,
+ bool useHWAA) {
+ SkASSERT(!useHWAA || this->isStencilBufferMultisampled());
SkAutoTUnref<GrDrawBatch> batch(
GrRectBatchFactory::CreateNonAAFill(paint.getColor(), viewMatrix, rect, localRect,
localMatrix));
- GrPipelineBuilder pipelineBuilder(paint, this->mustUseHWAA(paint));
+ GrPipelineBuilder pipelineBuilder(paint, useHWAA);
if (ss) {
pipelineBuilder.setUserStencil(ss);
}
« no previous file with comments | « include/gpu/GrDrawContext.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698