diff options
author | Brian Salomon <bsalomon@google.com> | 2016-12-09 14:06:38 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2016-12-09 19:56:24 +0000 |
commit | 3944484020d98ff8f386378296106c321279482b (patch) | |
tree | a77a4a189b715cc544656929d3d3d71be3aca622 /src/gpu/GrSWMaskHelper.cpp | |
parent | d263413a2a92cafe3fd3b051c67d00206c9a0e4d (diff) |
Reland "Remove antialiasing control from GrPaint."
This contains fixes for GLPrograms test and mixed samples rendering.
This reverts commit 419d81eed4a010e6080db199795117cbedf9e6e4.
BUG=skia:
Change-Id: If8f002fbfaaaab6d1607403f2b15ccc7f1e17e87
Reviewed-on: https://skia-review.googlesource.com/5763
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrSWMaskHelper.cpp')
-rw-r--r-- | src/gpu/GrSWMaskHelper.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/gpu/GrSWMaskHelper.cpp b/src/gpu/GrSWMaskHelper.cpp index ec76c48bf9..7351ecd547 100644 --- a/src/gpu/GrSWMaskHelper.cpp +++ b/src/gpu/GrSWMaskHelper.cpp @@ -38,12 +38,11 @@ static SkBlendMode op_to_mode(SkRegion::Op op) { /** * Draw a single rect element of the clip stack into the accumulation bitmap */ -void GrSWMaskHelper::drawRect(const SkRect& rect, SkRegion::Op op, - bool antiAlias, uint8_t alpha) { +void GrSWMaskHelper::drawRect(const SkRect& rect, SkRegion::Op op, GrAA aa, uint8_t alpha) { SkPaint paint; paint.setBlendMode(op_to_mode(op)); - paint.setAntiAlias(antiAlias); + paint.setAntiAlias(GrAA::kYes == aa); paint.setColor(SkColorSetARGB(alpha, alpha, alpha, alpha)); fDraw.drawRect(rect, paint); @@ -52,12 +51,11 @@ void GrSWMaskHelper::drawRect(const SkRect& rect, SkRegion::Op op, /** * Draw a single path element of the clip stack into the accumulation bitmap */ -void GrSWMaskHelper::drawShape(const GrShape& shape, SkRegion::Op op, bool antiAlias, - uint8_t alpha) { +void GrSWMaskHelper::drawShape(const GrShape& shape, SkRegion::Op op, GrAA aa, uint8_t alpha) { SkPaint paint; paint.setPathEffect(sk_ref_sp(shape.style().pathEffect())); shape.style().strokeRec().applyToPaint(&paint); - paint.setAntiAlias(antiAlias); + paint.setAntiAlias(GrAA::kYes == aa); SkPath path; shape.asPath(&path); @@ -141,7 +139,7 @@ void GrSWMaskHelper::toSDF(unsigned char* sdf) { GrTexture* GrSWMaskHelper::DrawShapeMaskToTexture(GrTextureProvider* texProvider, const GrShape& shape, const SkIRect& resultBounds, - bool antiAlias, + GrAA aa, TextureType textureType, const SkMatrix* matrix) { GrSWMaskHelper helper(texProvider); @@ -150,7 +148,7 @@ GrTexture* GrSWMaskHelper::DrawShapeMaskToTexture(GrTextureProvider* texProvider return nullptr; } - helper.drawShape(shape, SkRegion::kReplace_Op, antiAlias, 0xFF); + helper.drawShape(shape, SkRegion::kReplace_Op, aa, 0xFF); GrTexture* texture(helper.createTexture(textureType)); if (!texture) { @@ -185,7 +183,7 @@ void GrSWMaskHelper::DrawToTargetWithShapeMask(GrTexture* texture, maskMatrix.preTranslate(SkIntToScalar(-textureOriginInDeviceSpace.fX), SkIntToScalar(-textureOriginInDeviceSpace.fY)); maskMatrix.preConcat(viewMatrix); - GrPipelineBuilder pipelineBuilder(paint, renderTargetContext->mustUseHWAA(paint)); + GrPipelineBuilder pipelineBuilder(paint, GrAAType::kNone); pipelineBuilder.setUserStencil(&userStencilSettings); pipelineBuilder.addCoverageFragmentProcessor( |