diff options
author | Robert Phillips <robertphillips@google.com> | 2018-08-23 13:50:16 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-08-23 18:43:57 +0000 |
commit | a522d66eff20c5f0b920063ced69d07d36b1b36b (patch) | |
tree | 7ac465da5533c7f267334f22f74c2e09d0f10974 /src/gpu/SkGpuDevice.cpp | |
parent | 4f169ec7378f52c6c8b0c5a4b824670b22f58bfc (diff) | |
download | platform_external_skqp-a522d66eff20c5f0b920063ced69d07d36b1b36b.tar.gz platform_external_skqp-a522d66eff20c5f0b920063ced69d07d36b1b36b.tar.bz2 platform_external_skqp-a522d66eff20c5f0b920063ced69d07d36b1b36b.zip |
Fold directFilterRRectMaskGPU into directFilterMaskGPU
Change-Id: Id4b636ea305c7cb28dd5efe139d3410f17177f42
Reviewed-on: https://skia-review.googlesource.com/148982
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/SkGpuDevice.cpp')
-rw-r--r-- | src/gpu/SkGpuDevice.cpp | 29 |
1 files changed, 6 insertions, 23 deletions
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp index 58c1de85f8..4b71068cf4 100644 --- a/src/gpu/SkGpuDevice.cpp +++ b/src/gpu/SkGpuDevice.cpp @@ -406,12 +406,6 @@ void SkGpuDevice::drawRRect(const SkRRect& rrect, const SkPaint& paint) { ASSERT_SINGLE_OWNER GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawRRect", fContext.get()); - GrPaint grPaint; - if (!SkPaintToGrPaint(this->context(), fRenderTargetContext->colorSpaceInfo(), paint, - this->ctm(), &grPaint)) { - return; - } - SkMaskFilterBase* mf = as_MFB(paint.getMaskFilter()); if (mf) { if (mf->hasFragmentProcessor()) { @@ -420,28 +414,11 @@ void SkGpuDevice::drawRRect(const SkRRect& rrect, const SkPaint& paint) { } GrStyle style(paint); - if (mf) { - // try to hit the fast path for drawing filtered round rects - - SkRRect devRRect; - if (rrect.transform(this->ctm(), &devRRect)) { - if (SkRRectPriv::AllCornersCircular(devRRect)) { - if (mf->directFilterRRectMaskGPU(this->context(), fRenderTargetContext.get(), - std::move(grPaint), this->clip(), this->ctm(), - style.strokeRec(), rrect, devRRect)) { - return; - } - } - } - } if (mf || style.pathEffect()) { - // The only mask filter the native rrect drawing code could've handle was taken - // care of above. // A path effect will presumably transform this rrect into something else. GrShape shape(rrect, style); - // TODO: this is throwing away to work we did to create the GrPaint GrBlurUtils::drawShapeWithMaskFilter(fContext.get(), fRenderTargetContext.get(), this->clip(), paint, this->ctm(), shape); return; @@ -449,6 +426,12 @@ void SkGpuDevice::drawRRect(const SkRRect& rrect, const SkPaint& paint) { SkASSERT(!style.pathEffect()); + GrPaint grPaint; + if (!SkPaintToGrPaint(this->context(), fRenderTargetContext->colorSpaceInfo(), paint, + this->ctm(), &grPaint)) { + return; + } + fRenderTargetContext->drawRRect(this->clip(), std::move(grPaint), GrAA(paint.isAntiAlias()), this->ctm(), rrect, style); } |