aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/effects
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/effects
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/effects')
-rw-r--r--src/effects/SkAlphaThresholdFilter.cpp2
-rw-r--r--src/effects/SkBlurMaskFilter.cpp24
-rw-r--r--src/effects/SkDisplacementMapEffect.cpp3
-rw-r--r--src/effects/SkLightingImageFilter.cpp2
-rw-r--r--src/effects/SkMorphologyImageFilter.cpp7
-rwxr-xr-xsrc/effects/SkShadowMaskFilter.cpp2
-rw-r--r--src/effects/SkXfermodeImageFilter.cpp2
7 files changed, 20 insertions, 22 deletions
diff --git a/src/effects/SkAlphaThresholdFilter.cpp b/src/effects/SkAlphaThresholdFilter.cpp
index 43751e1199..6cf1ce61e4 100644
--- a/src/effects/SkAlphaThresholdFilter.cpp
+++ b/src/effects/SkAlphaThresholdFilter.cpp
@@ -114,7 +114,7 @@ sk_sp<GrTextureProxy> SkAlphaThresholdFilterImpl::createMaskTexture(GrContext* c
GrFixedClip clip(SkIRect::MakeWH(bounds.width(), bounds.height()));
while (!iter.done()) {
SkRect rect = SkRect::Make(iter.rect());
- rtContext->drawRect(clip, grPaint, inMatrix, rect);
+ rtContext->drawRect(clip, grPaint, GrAA::kNo, inMatrix, rect);
iter.next();
}
diff --git a/src/effects/SkBlurMaskFilter.cpp b/src/effects/SkBlurMaskFilter.cpp
index e8867ead76..0b1d1db6fb 100644
--- a/src/effects/SkBlurMaskFilter.cpp
+++ b/src/effects/SkBlurMaskFilter.cpp
@@ -1060,7 +1060,8 @@ bool SkBlurMaskFilterImpl::directFilterMaskGPU(GrTextureProvider* texProvider,
return false;
}
- renderTargetContext->fillRectWithLocalMatrix(clip, *grp, SkMatrix::I(), rect, inverse);
+ renderTargetContext->fillRectWithLocalMatrix(clip, *grp, GrAA::kNo, SkMatrix::I(), rect,
+ inverse);
return true;
}
@@ -1103,8 +1104,7 @@ private:
static sk_sp<GrTexture> find_or_create_rrect_blur_mask(GrContext* context,
const SkRRect& rrectToDraw,
const SkISize& size,
- float xformedSigma,
- bool doAA) {
+ float xformedSigma) {
static const GrUniqueKey::Domain kDomain = GrUniqueKey::GenerateDomain();
GrUniqueKey key;
GrUniqueKey::Builder builder(&key, kDomain, 9);
@@ -1129,10 +1129,10 @@ static sk_sp<GrTexture> find_or_create_rrect_blur_mask(GrContext* context,
}
GrPaint grPaint;
- grPaint.setAntiAlias(doAA);
rtc->clear(nullptr, 0x0, true);
- rtc->drawRRect(GrNoClip(), grPaint, SkMatrix::I(), rrectToDraw, GrStyle::SimpleFill());
+ rtc->drawRRect(GrNoClip(), grPaint, GrAA::kYes, SkMatrix::I(), rrectToDraw,
+ GrStyle::SimpleFill());
sk_sp<GrTexture> srcTexture(rtc->asTexture());
if (!srcTexture) {
@@ -1192,8 +1192,7 @@ sk_sp<GrFragmentProcessor> GrRRectBlurEffect::Make(GrContext* context,
return nullptr;
}
- sk_sp<GrTexture> mask(find_or_create_rrect_blur_mask(context, rrectToDraw, size,
- xformedSigma, true));
+ sk_sp<GrTexture> mask(find_or_create_rrect_blur_mask(context, rrectToDraw, size, xformedSigma));
if (!mask) {
return nullptr;
}
@@ -1380,12 +1379,11 @@ bool SkBlurMaskFilterImpl::directFilterRRectMaskGPU(GrContext* context,
GrPaint newPaint(*grp);
newPaint.addCoverageFragmentProcessor(std::move(fp));
- newPaint.setAntiAlias(false);
SkRect srcProxyRect = srcRRect.rect();
srcProxyRect.outset(3.0f*fSigma, 3.0f*fSigma);
- renderTargetContext->drawRect(clip, newPaint, viewMatrix, srcProxyRect);
+ renderTargetContext->drawRect(clip, newPaint, GrAA::kNo, viewMatrix, srcProxyRect);
return true;
}
@@ -1397,7 +1395,6 @@ bool SkBlurMaskFilterImpl::directFilterRRectMaskGPU(GrContext* context,
GrPaint newPaint(*grp);
newPaint.addCoverageFragmentProcessor(std::move(fp));
- newPaint.setAntiAlias(false);
if (!this->ignoreXform()) {
SkRect srcProxyRect = srcRRect.rect();
@@ -1444,8 +1441,8 @@ bool SkBlurMaskFilterImpl::directFilterRRectMaskGPU(GrContext* context,
proxyRect.outset(extra, extra);
- renderTargetContext->fillRectWithLocalMatrix(clip, newPaint, SkMatrix::I(), proxyRect,
- inverse);
+ renderTargetContext->fillRectWithLocalMatrix(clip, newPaint, GrAA::kNo, SkMatrix::I(),
+ proxyRect, inverse);
}
return true;
@@ -1538,7 +1535,8 @@ bool SkBlurMaskFilterImpl::filterMaskGPU(GrTexture* src,
paint.setCoverageSetOpXPFactory(SkRegion::kReplace_Op);
}
- renderTargetContext->drawRect(GrNoClip(), paint, SkMatrix::I(), SkRect::Make(clipRect));
+ renderTargetContext->drawRect(GrNoClip(), paint, GrAA::kNo, SkMatrix::I(),
+ SkRect::Make(clipRect));
}
*result = renderTargetContext->asTexture().release();
diff --git a/src/effects/SkDisplacementMapEffect.cpp b/src/effects/SkDisplacementMapEffect.cpp
index 2d79f9ac87..661dacd53b 100644
--- a/src/effects/SkDisplacementMapEffect.cpp
+++ b/src/effects/SkDisplacementMapEffect.cpp
@@ -360,7 +360,8 @@ sk_sp<SkSpecialImage> SkDisplacementMapEffect::onFilterImage(SkSpecialImage* sou
}
paint.setGammaCorrect(renderTargetContext->isGammaCorrect());
- renderTargetContext->drawRect(GrNoClip(), paint, matrix, SkRect::Make(colorBounds));
+ renderTargetContext->drawRect(GrNoClip(), paint, GrAA::kNo, matrix,
+ SkRect::Make(colorBounds));
offset->fX = bounds.left();
offset->fY = bounds.top();
diff --git a/src/effects/SkLightingImageFilter.cpp b/src/effects/SkLightingImageFilter.cpp
index 75947e8711..52c8947cc4 100644
--- a/src/effects/SkLightingImageFilter.cpp
+++ b/src/effects/SkLightingImageFilter.cpp
@@ -400,7 +400,7 @@ void SkLightingImageFilterInternal::drawRect(GrRenderTargetContext* renderTarget
boundaryMode));
paint.addColorFragmentProcessor(std::move(fp));
paint.setPorterDuffXPFactory(SkBlendMode::kSrc);
- renderTargetContext->fillRectToRect(clip, paint, SkMatrix::I(), dstRect, srcRect);
+ renderTargetContext->fillRectToRect(clip, paint, GrAA::kNo, SkMatrix::I(), dstRect, srcRect);
}
sk_sp<SkSpecialImage> SkLightingImageFilterInternal::filterImageGPU(
diff --git a/src/effects/SkMorphologyImageFilter.cpp b/src/effects/SkMorphologyImageFilter.cpp
index 2fa67a4aeb..130f099d85 100644
--- a/src/effects/SkMorphologyImageFilter.cpp
+++ b/src/effects/SkMorphologyImageFilter.cpp
@@ -407,7 +407,8 @@ static void apply_morphology_rect(GrTextureProvider* provider,
paint.addColorFragmentProcessor(GrMorphologyEffect::Make(tex, direction, radius, morphType,
bounds));
paint.setPorterDuffXPFactory(SkBlendMode::kSrc);
- renderTargetContext->fillRectToRect(clip, paint, SkMatrix::I(), SkRect::Make(dstRect),
+ renderTargetContext->fillRectToRect(clip, paint, GrAA::kNo,
+ SkMatrix::I(), SkRect::Make(dstRect),
SkRect::Make(srcRect));
}
@@ -428,8 +429,8 @@ static void apply_morphology_rect_no_bounds(GrTextureProvider* provider,
}
paint.addColorFragmentProcessor(GrMorphologyEffect::Make(tex, direction, radius, morphType));
paint.setPorterDuffXPFactory(SkBlendMode::kSrc);
- renderTargetContext->fillRectToRect(clip, paint, SkMatrix::I(), SkRect::Make(dstRect),
- SkRect::Make(srcRect));
+ renderTargetContext->fillRectToRect(clip, paint, GrAA::kNo, SkMatrix::I(),
+ SkRect::Make(dstRect), SkRect::Make(srcRect));
}
static void apply_morphology_pass(GrTextureProvider* provider,
diff --git a/src/effects/SkShadowMaskFilter.cpp b/src/effects/SkShadowMaskFilter.cpp
index 958ab170a7..5c54072f4e 100755
--- a/src/effects/SkShadowMaskFilter.cpp
+++ b/src/effects/SkShadowMaskFilter.cpp
@@ -252,7 +252,6 @@ bool SkShadowMaskFilterImpl::directFilterRRectMaskGPU(GrContext*,
const SkScalar devSpaceAmbientRadius = srcSpaceAmbientRadius * scaleFactor;
GrPaint newPaint(*grp);
- newPaint.setAntiAlias(true);
GrColor4f color = newPaint.getColor4f();
color.fRGBA[3] *= fAmbientAlpha;
newPaint.setColor4f(color);
@@ -311,7 +310,6 @@ bool SkShadowMaskFilterImpl::directFilterRRectMaskGPU(GrContext*,
(spotShadowRRect.width() + srcSpaceSpotRadius);
GrPaint newPaint(*grp);
- newPaint.setAntiAlias(true);
GrColor4f color = newPaint.getColor4f();
color.fRGBA[3] *= fSpotAlpha;
newPaint.setColor4f(color);
diff --git a/src/effects/SkXfermodeImageFilter.cpp b/src/effects/SkXfermodeImageFilter.cpp
index 82d5156a28..3a1e6e28e3 100644
--- a/src/effects/SkXfermodeImageFilter.cpp
+++ b/src/effects/SkXfermodeImageFilter.cpp
@@ -303,7 +303,7 @@ sk_sp<SkSpecialImage> SkXfermodeImageFilter_Base::filterImageGPU(
SkMatrix matrix;
matrix.setTranslate(SkIntToScalar(-bounds.left()), SkIntToScalar(-bounds.top()));
- renderTargetContext->drawRect(GrNoClip(), paint, matrix, SkRect::Make(bounds));
+ renderTargetContext->drawRect(GrNoClip(), paint, GrAA::kNo, matrix, SkRect::Make(bounds));
return SkSpecialImage::MakeDeferredFromGpu(context,
SkIRect::MakeWH(bounds.width(), bounds.height()),