aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkGpuBlurUtils.cpp
diff options
context:
space:
mode:
authorGravatar Joe Gregorio <jcgregorio@google.com>2017-01-17 19:20:54 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-01-17 19:50:55 +0000
commita7d61a65ee7f7b2a2f6fce59faaca0762cef4c67 (patch)
treed57ac40a8e4df0c9e04ddd575c67e9c30362471f /src/core/SkGpuBlurUtils.cpp
parent94bd50cc5575b90eb60234399d69905b8651c27e (diff)
Revert "Continue making Ganesh use absolute texture coordinates"
This reverts commit 4493a9dc9df8cf306a974bde7e0e9c5470ebcdc9. Reason for revert: Continuing failures https://luci-milo.appspot.com/swarming/task/33c693c3539a1410 Change-Id: Id371d6df6a875a5f6872f4ebd91b08a354d949de Reviewed-on: https://skia-review.googlesource.com/7125 Commit-Queue: Joe Gregorio <jcgregorio@google.com> Reviewed-by: Joe Gregorio <jcgregorio@google.com>
Diffstat (limited to 'src/core/SkGpuBlurUtils.cpp')
-rw-r--r--src/core/SkGpuBlurUtils.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/core/SkGpuBlurUtils.cpp b/src/core/SkGpuBlurUtils.cpp
index 6ac5abe49c..b3b523a498 100644
--- a/src/core/SkGpuBlurUtils.cpp
+++ b/src/core/SkGpuBlurUtils.cpp
@@ -262,6 +262,10 @@ sk_sp<GrRenderTargetContext> GaussianBlur(GrContext* context,
for (int i = 1; i < scaleFactorX || i < scaleFactorY; i *= 2) {
GrPaint paint;
paint.setGammaCorrect(dstRenderTargetContext->isGammaCorrect());
+ // TODO: this matrix relies on the final instantiated size of the texture. This
+ // will have to be deferred for TextureProxys
+ SkMatrix matrix;
+ matrix.setIDiv(srcTexture->width(), srcTexture->height());
SkIRect dstRect(srcRect);
if (srcBounds && i == 1) {
SkRect domain = SkRect::Make(*srcBounds);
@@ -270,7 +274,7 @@ sk_sp<GrRenderTargetContext> GaussianBlur(GrContext* context,
sk_sp<GrFragmentProcessor> fp(GrTextureDomainEffect::Make(
srcTexture.get(),
nullptr,
- SkMatrix::I(),
+ matrix,
domain,
GrTextureDomain::kDecal_Mode,
GrSamplerParams::kBilerp_FilterMode));
@@ -279,7 +283,7 @@ sk_sp<GrRenderTargetContext> GaussianBlur(GrContext* context,
srcOffset.set(0, 0);
} else {
GrSamplerParams params(SkShader::kClamp_TileMode, GrSamplerParams::kBilerp_FilterMode);
- paint.addColorTextureProcessor(srcTexture.get(), nullptr, SkMatrix::I(), params);
+ paint.addColorTextureProcessor(srcTexture.get(), nullptr, matrix, params);
}
paint.setPorterDuffXPFactory(SkBlendMode::kSrc);
shrink_irect_by_2(&dstRect, i < scaleFactorX, i < scaleFactorY);
@@ -365,7 +369,12 @@ sk_sp<GrRenderTargetContext> GaussianBlur(GrContext* context,
return nullptr;
}
- paint.addColorTextureProcessor(tex.get(), nullptr, SkMatrix::I(), params);
+ // TODO: this matrix relies on the final instantiated size of the texture. This
+ // will have to be deferred for TextureProxys
+ SkMatrix matrix;
+ matrix.setIDiv(tex->width(), tex->height());
+
+ paint.addColorTextureProcessor(tex.get(), nullptr, matrix, params);
paint.setPorterDuffXPFactory(SkBlendMode::kSrc);
SkIRect dstRect(srcRect);