diff options
author | 2017-01-20 12:44:06 -0500 | |
---|---|---|
committer | 2017-01-20 18:18:18 +0000 | |
commit | 67c18d6b5188a0497f6912a73d964c763d2f8f84 (patch) | |
tree | d32888c6b13589c2718fc6673f29acf2bb546c38 /src/core/SkGpuBlurUtils.cpp | |
parent | 41398f430dc501d450e04540a83b6aa5baf87cd7 (diff) |
Continue making Ganesh use absolute texture coordinates - take 2
The idea here is that the GrCoordTransform will actually hold a GrTextureProxy (rather than a GrTexture) and then, in GrGLSLPrimitiveProcessor::GetTransformMatrix, use the instantiated width & height (when uploading the transform matrix)
Relanding of: https://skia-review.googlesource.com/c/6977/
Change-Id: Ibc9b9e354f7fc23b1a6e6e4fe7c9fe3cef771c02
Reviewed-on: https://skia-review.googlesource.com/7265
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/core/SkGpuBlurUtils.cpp')
-rw-r--r-- | src/core/SkGpuBlurUtils.cpp | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/src/core/SkGpuBlurUtils.cpp b/src/core/SkGpuBlurUtils.cpp index b3b523a498..6ac5abe49c 100644 --- a/src/core/SkGpuBlurUtils.cpp +++ b/src/core/SkGpuBlurUtils.cpp @@ -262,10 +262,6 @@ 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); @@ -274,7 +270,7 @@ sk_sp<GrRenderTargetContext> GaussianBlur(GrContext* context, sk_sp<GrFragmentProcessor> fp(GrTextureDomainEffect::Make( srcTexture.get(), nullptr, - matrix, + SkMatrix::I(), domain, GrTextureDomain::kDecal_Mode, GrSamplerParams::kBilerp_FilterMode)); @@ -283,7 +279,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, matrix, params); + paint.addColorTextureProcessor(srcTexture.get(), nullptr, SkMatrix::I(), params); } paint.setPorterDuffXPFactory(SkBlendMode::kSrc); shrink_irect_by_2(&dstRect, i < scaleFactorX, i < scaleFactorY); @@ -369,12 +365,7 @@ sk_sp<GrRenderTargetContext> GaussianBlur(GrContext* context, return nullptr; } - // 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.addColorTextureProcessor(tex.get(), nullptr, SkMatrix::I(), params); paint.setPorterDuffXPFactory(SkBlendMode::kSrc); SkIRect dstRect(srcRect); |