aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2018-01-20 22:24:21 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-01-20 22:24:31 +0000
commitbfadcf0224cb22e2aec10592fa197ba7ab19b479 (patch)
treec3a3635a542239a30928855e6b322c36b91c96ba /src/gpu
parent2914555e004676465c5255d8b42ee0d25887ac73 (diff)
Revert "Revert "use GrFPArgs for maskfilters""
This reverts commit 4f7f197c09443232f02cd81f3ac7fb5a216acd05. Reason for revert: not needed for roll Original change's description: > Revert "use GrFPArgs for maskfilters" > > This reverts commit a99b39399522658d7e5ddee97d0e45aa9fceaf89. > > Reason for revert: try to unblock android roller > > Original change's description: > > use GrFPArgs for maskfilters > > > > Bug: skia: > > Change-Id: I8516a3b0f6d8301c51f0861c65b9fe8f692fc5e5 > > Reviewed-on: https://skia-review.googlesource.com/97260 > > Commit-Queue: Mike Reed <reed@google.com> > > Reviewed-by: Brian Salomon <bsalomon@google.com> > > TBR=egdaniel@google.com,bsalomon@google.com,reed@google.com > > Change-Id: Iefe8ed19bba75df86173dec53f5ed4f1ea8724d0 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia: > Reviewed-on: https://skia-review.googlesource.com/97581 > Reviewed-by: Mike Reed <reed@google.com> > Commit-Queue: Mike Reed <reed@google.com> TBR=egdaniel@google.com,bsalomon@google.com,reed@google.com Change-Id: I82c0e3234ff1b23c6d08259aae7dcb03087a415e No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/97583 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'src/gpu')
-rw-r--r--src/gpu/GrBlurUtils.cpp2
-rw-r--r--src/gpu/SkGpuDevice.cpp6
-rw-r--r--src/gpu/SkGr.cpp10
3 files changed, 10 insertions, 8 deletions
diff --git a/src/gpu/GrBlurUtils.cpp b/src/gpu/GrBlurUtils.cpp
index dcd4a99ece..aff3647f6c 100644
--- a/src/gpu/GrBlurUtils.cpp
+++ b/src/gpu/GrBlurUtils.cpp
@@ -298,7 +298,7 @@ void GrBlurUtils::drawPathWithMaskFilter(GrContext* context,
}
GrAA aa = GrAA(paint.isAntiAlias());
SkMaskFilter* mf = paint.getMaskFilter();
- if (mf && !mf->asFragmentProcessor(nullptr)) {
+ if (mf && !mf->hasFragmentProcessor()) {
// The MaskFilter wasn't already handled in SkPaintToGrPaint
draw_path_with_mask_filter(context, renderTargetContext, clip, std::move(grPaint), aa,
viewMatrix, mf, style, path, pathIsMutable);
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 8d6e55c1f6..3f7dcb41e0 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -403,8 +403,10 @@ void SkGpuDevice::drawRRect(const SkRRect& rrect, const SkPaint& paint) {
}
SkMaskFilter* mf = paint.getMaskFilter();
- if (mf && mf->asFragmentProcessor(nullptr)) {
- mf = nullptr; // already handled in SkPaintToGrPaint
+ if (mf) {
+ if (mf->hasFragmentProcessor()) {
+ mf = nullptr; // already handled in SkPaintToGrPaint
+ }
}
GrStyle style(paint);
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp
index 58dbb10df0..9342cd676b 100644
--- a/src/gpu/SkGr.cpp
+++ b/src/gpu/SkGr.cpp
@@ -375,6 +375,8 @@ static inline bool skpaint_to_grpaint_impl(GrContext* context,
// Convert SkPaint color to 4f format, including optional linearizing and gamut conversion.
GrColor4f origColor = SkColorToUnpremulGrColor4f(skPaint.getColor(), colorSpaceInfo);
+ const GrFPArgs fpArgs(context, &viewM, nullptr, skPaint.getFilterQuality(), &colorSpaceInfo);
+
// Setup the initial color considering the shader, the SkPaint color, and the presence or not
// of per-vertex colors.
std::unique_ptr<GrFragmentProcessor> shaderFP;
@@ -382,8 +384,7 @@ static inline bool skpaint_to_grpaint_impl(GrContext* context,
if (shaderProcessor) {
shaderFP = std::move(*shaderProcessor);
} else if (const auto* shader = as_SB(skPaint.getShader())) {
- shaderFP = shader->asFragmentProcessor(GrFPArgs(
- context, &viewM, nullptr, skPaint.getFilterQuality(), &colorSpaceInfo));
+ shaderFP = shader->asFragmentProcessor(fpArgs);
}
}
@@ -478,9 +479,8 @@ static inline bool skpaint_to_grpaint_impl(GrContext* context,
SkMaskFilter* maskFilter = skPaint.getMaskFilter();
if (maskFilter) {
- GrFragmentProcessor* mfFP;
- if (maskFilter->asFragmentProcessor(&mfFP)) {
- grPaint->addCoverageFragmentProcessor(std::unique_ptr<GrFragmentProcessor>(mfFP));
+ if (auto mfFP = maskFilter->asFragmentProcessor(fpArgs)) {
+ grPaint->addCoverageFragmentProcessor(std::move(mfFP));
}
}