aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2018-05-09 20:22:52 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-05-09 20:23:01 +0000
commit729715298c8af1d2ecc4cbe887eeeb9a1c17c595 (patch)
tree6ebb8bd2917d41fa74ab0ed173f22c359c07e97a
parentf112ea2cb2dd7e6a45d0c35c7f514879eb92deb8 (diff)
Revert "Don't use GrRRectBlurEffect for large rects when highp is not full float"
This reverts commit e0dc9432d8836ec34a3ef90eabc39eadc3d1db90. Reason for revert: compile breakage Original change's description: > Don't use GrRRectBlurEffect for large rects when highp is not full float > > Change-Id: Idf12e0a1fba2d9bd2fab8100bd9319c6ec6115b9 > Reviewed-on: https://skia-review.googlesource.com/127049 > Commit-Queue: Brian Salomon <bsalomon@google.com> > Reviewed-by: Robert Phillips <robertphillips@google.com> TBR=bsalomon@google.com,robertphillips@google.com Change-Id: Ibbf8abfd4089d963d2457db4710207d1c91faf35 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/127180 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
-rw-r--r--src/core/SkBlurMF.cpp6
-rw-r--r--src/gpu/effects/GrRectBlurEffect.cpp3
-rw-r--r--src/gpu/effects/GrRectBlurEffect.fp13
-rw-r--r--src/gpu/effects/GrRectBlurEffect.h12
4 files changed, 5 insertions, 29 deletions
diff --git a/src/core/SkBlurMF.cpp b/src/core/SkBlurMF.cpp
index b75fd16f6c..8bae1f05f1 100644
--- a/src/core/SkBlurMF.cpp
+++ b/src/core/SkBlurMF.cpp
@@ -758,8 +758,7 @@ bool SkBlurMaskFilterImpl::directFilterMaskGPU(GrContext* context,
SkScalar pad = 3.0f * xformedSigma;
rect.outset(pad, pad);
- fp = GrRectBlurEffect::Make(proxyProvider, *context->caps()->shaderCaps(), rect,
- xformedSigma);
+ fp = GrRectBlurEffect::Make(proxyProvider, rect, xformedSigma);
} else if (path.isOval(&rect) && SkScalarNearlyEqual(rect.width(), rect.height())) {
fp = GrCircleBlurFragmentProcessor::Make(proxyProvider, rect, xformedSigma);
@@ -812,8 +811,7 @@ bool SkBlurMaskFilterImpl::directFilterRRectMaskGPU(GrContext* context,
SkScalar pad = 3.0f * xformedSigma;
const SkRect dstCoverageRect = devRRect.rect().makeOutset(pad, pad);
- fp = GrRectBlurEffect::Make(proxyProvider, *context->caps()->shaderCaps(),
- dstCoverageRect, xformedSigma);
+ fp = GrRectBlurEffect::Make(proxyProvider, dstCoverageRect, xformedSigma);
} else {
fp = GrCircleBlurFragmentProcessor::Make(proxyProvider,
devRRect.rect(), xformedSigma);
diff --git a/src/gpu/effects/GrRectBlurEffect.cpp b/src/gpu/effects/GrRectBlurEffect.cpp
index 219fefa713..f537361cad 100644
--- a/src/gpu/effects/GrRectBlurEffect.cpp
+++ b/src/gpu/effects/GrRectBlurEffect.cpp
@@ -160,7 +160,6 @@ std::unique_ptr<GrFragmentProcessor> GrRectBlurEffect::TestCreate(GrProcessorTes
float sigma = data->fRandom->nextRangeF(3, 8);
float width = data->fRandom->nextRangeF(200, 300);
float height = data->fRandom->nextRangeF(200, 300);
- return GrRectBlurEffect::Make(data->proxyProvider(), *data->caps()->shaderCaps(),
- SkRect::MakeWH(width, height), sigma);
+ return GrRectBlurEffect::Make(data->proxyProvider(), SkRect::MakeWH(width, height), sigma);
}
#endif
diff --git a/src/gpu/effects/GrRectBlurEffect.fp b/src/gpu/effects/GrRectBlurEffect.fp
index e5a5aad75c..ed9a1e715f 100644
--- a/src/gpu/effects/GrRectBlurEffect.fp
+++ b/src/gpu/effects/GrRectBlurEffect.fp
@@ -84,17 +84,7 @@ uniform half profileSize;
@make {
static std::unique_ptr<GrFragmentProcessor> Make(GrProxyProvider* proxyProvider,
- const GrShaderCaps& caps,
const SkRect& rect, float sigma) {
- if (!caps.floatIs32Bits()) {
- // We promote the rect uniform from half to float when it has large values for
- // precision. If we don't have full float then fail.
- if (abs(rect.fLeft) > 16000 || abs(rect.fTop) > 16000 ||
- abs(rect.fRight) > 16000 || abs(rect.fBottom) > 16000 ||
- abs(rect.width()) > 16000 || abs(rect.height()) > 16000) {
- return nullptr;
- }
- }
int doubleProfileSize = SkScalarCeilToInt(12*sigma);
if (doubleProfileSize >= rect.width() || doubleProfileSize >= rect.height()) {
@@ -152,6 +142,5 @@ void main() {
float sigma = data->fRandom->nextRangeF(3,8);
float width = data->fRandom->nextRangeF(200,300);
float height = data->fRandom->nextRangeF(200,300);
- return GrRectBlurEffect::Make(data->proxyProvider(), *data->caps()->shaderCaps(),
- SkRect::MakeWH(width, height), sigma);
+ return GrRectBlurEffect::Make(data->proxyProvider(), SkRect::MakeWH(width, height), sigma);
}
diff --git a/src/gpu/effects/GrRectBlurEffect.h b/src/gpu/effects/GrRectBlurEffect.h
index 42c2829d6d..47e9dc3851 100644
--- a/src/gpu/effects/GrRectBlurEffect.h
+++ b/src/gpu/effects/GrRectBlurEffect.h
@@ -63,17 +63,7 @@ public:
float sigma() const { return fSigma; }
static std::unique_ptr<GrFragmentProcessor> Make(GrProxyProvider* proxyProvider,
- const GrShaderCaps& caps, const SkRect& rect,
- float sigma) {
- if (!caps.floatIs32Bits()) {
- // We promote the rect uniform from half to float when it has large values for
- // precision. If we don't have full float then fail.
- if (abs(rect.fLeft) > 16000 || abs(rect.fTop) > 16000 || abs(rect.fRight) > 16000 ||
- abs(rect.fBottom) > 16000 || abs(rect.width()) > 16000 ||
- abs(rect.height()) > 16000) {
- return nullptr;
- }
- }
+ const SkRect& rect, float sigma) {
int doubleProfileSize = SkScalarCeilToInt(12 * sigma);
if (doubleProfileSize >= rect.width() || doubleProfileSize >= rect.height()) {