aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrBlurUtils.cpp
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2016-12-09 15:10:07 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-12-09 20:43:41 +0000
commit0e8fc8b9e6a138cf4a66b421fb824679df717329 (patch)
tree9db412fc2ea22314336f3680249e905c4984902c /src/gpu/GrBlurUtils.cpp
parent385836d3d764303cc37c4d1bcc0ab890d209374e (diff)
Relandx2 "Remove antialiasing control from GrPaint."
Fixes a bad merge. This reverts commit 073285c0595d46205d1482cc19af2d7d891bfeae. Change-Id: I5e92339d9b33d3a6dc58b9fcd2a1b3a5684e8f8a Reviewed-on: https://skia-review.googlesource.com/5774 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/GrBlurUtils.cpp')
-rw-r--r--src/gpu/GrBlurUtils.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/gpu/GrBlurUtils.cpp b/src/gpu/GrBlurUtils.cpp
index 4d89bef63c..768860525f 100644
--- a/src/gpu/GrBlurUtils.cpp
+++ b/src/gpu/GrBlurUtils.cpp
@@ -45,8 +45,8 @@ static bool draw_mask(GrRenderTargetContext* renderTargetContext,
if (!viewMatrix.invert(&inverse)) {
return false;
}
- renderTargetContext->fillRectWithLocalMatrix(clip, *grp, SkMatrix::I(), SkRect::Make(maskRect),
- inverse);
+ renderTargetContext->fillRectWithLocalMatrix(clip, *grp, GrAA::kNo, SkMatrix::I(),
+ SkRect::Make(maskRect), inverse);
return true;
}
@@ -98,9 +98,9 @@ static sk_sp<GrTextureProxy> create_mask_GPU(GrContext* context,
const SkIRect& maskRect,
const SkPath& devPath,
SkStrokeRec::InitStyle fillOrHairline,
- bool doAA,
+ GrAA aa,
int sampleCnt) {
- if (!doAA) {
+ if (GrAA::kNo == aa) {
// Don't need MSAA if mask isn't AA
sampleCnt = 0;
}
@@ -115,7 +115,6 @@ static sk_sp<GrTextureProxy> create_mask_GPU(GrContext* context,
rtContext->priv().absClear(nullptr, 0x0);
GrPaint tempPaint;
- tempPaint.setAntiAlias(doAA);
tempPaint.setCoverageSetOpXPFactory(SkRegion::kReplace_Op);
// setup new clip
@@ -126,7 +125,7 @@ static sk_sp<GrTextureProxy> create_mask_GPU(GrContext* context,
// the origin using tempPaint.
SkMatrix translate;
translate.setTranslate(-SkIntToScalar(maskRect.fLeft), -SkIntToScalar(maskRect.fTop));
- rtContext->drawPath(clip, tempPaint, translate, devPath, GrStyle(fillOrHairline));
+ rtContext->drawPath(clip, tempPaint, aa, translate, devPath, GrStyle(fillOrHairline));
return sk_ref_sp(rtContext->asDeferredTexture());
}
@@ -134,6 +133,7 @@ static void draw_path_with_mask_filter(GrContext* context,
GrRenderTargetContext* renderTargetContext,
const GrClip& clip,
GrPaint* paint,
+ GrAA aa,
const SkMatrix& viewMatrix,
const SkMaskFilter* maskFilter,
const GrStyle& style,
@@ -211,7 +211,7 @@ static void draw_path_with_mask_filter(GrContext* context,
finalIRect,
*path,
fillOrHairline,
- paint->isAntiAlias(),
+ aa,
renderTargetContext->numColorSamples()));
if (maskProxy) {
GrTexture* filtered;
@@ -242,11 +242,12 @@ void GrBlurUtils::drawPathWithMaskFilter(GrContext* context,
const GrClip& clip,
const SkPath& path,
GrPaint* paint,
+ GrAA aa,
const SkMatrix& viewMatrix,
const SkMaskFilter* mf,
const GrStyle& style,
bool pathIsMutable) {
- draw_path_with_mask_filter(context, renderTargetContext, clip, paint, viewMatrix, mf,
+ draw_path_with_mask_filter(context, renderTargetContext, clip, paint, aa, viewMatrix, mf,
style, &path, pathIsMutable);
}
@@ -290,14 +291,14 @@ void GrBlurUtils::drawPathWithMaskFilter(GrContext* context,
if (!SkPaintToGrPaint(context, renderTargetContext, paint, viewMatrix, &grPaint)) {
return;
}
-
+ GrAA aa = GrBoolToAA(paint.isAntiAlias());
SkMaskFilter* mf = paint.getMaskFilter();
if (mf && !mf->asFragmentProcessor(nullptr, nullptr, viewMatrix)) {
// The MaskFilter wasn't already handled in SkPaintToGrPaint
- draw_path_with_mask_filter(context, renderTargetContext, clip, &grPaint, viewMatrix,
+ draw_path_with_mask_filter(context, renderTargetContext, clip, &grPaint, aa, viewMatrix,
mf, style,
path, pathIsMutable);
} else {
- renderTargetContext->drawPath(clip, grPaint, viewMatrix, *path, style);
+ renderTargetContext->drawPath(clip, grPaint, aa, viewMatrix, *path, style);
}
}