Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(61)

Side by Side Diff: src/effects/SkGpuBlurUtils.cpp

Issue 787873002: Use threshold of 1 texture coord value per pixel w/ nearest neighbor. (Closed) Base URL: https://skia.googlesource.com/skia.git@matrix_prec
Patch Set: update comments Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/effects/SkDisplacementMapEffect.cpp ('k') | src/effects/gradients/SkGradientShader.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkGpuBlurUtils.h" 8 #include "SkGpuBlurUtils.h"
9 9
10 #include "SkRect.h" 10 #include "SkRect.h"
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 SkMatrix matrix; 200 SkMatrix matrix;
201 matrix.setIDiv(srcTexture->width(), srcTexture->height()); 201 matrix.setIDiv(srcTexture->width(), srcTexture->height());
202 context->setRenderTarget(dstTexture->asRenderTarget()); 202 context->setRenderTarget(dstTexture->asRenderTarget());
203 SkRect dstRect(srcRect); 203 SkRect dstRect(srcRect);
204 if (cropToRect && i == 1) { 204 if (cropToRect && i == 1) {
205 dstRect.offset(-dstRect.fLeft, -dstRect.fTop); 205 dstRect.offset(-dstRect.fLeft, -dstRect.fTop);
206 SkRect domain; 206 SkRect domain;
207 matrix.mapRect(&domain, rect); 207 matrix.mapRect(&domain, rect);
208 domain.inset(i < scaleFactorX ? SK_ScalarHalf / srcTexture->width() : 0.0f, 208 domain.inset(i < scaleFactorX ? SK_ScalarHalf / srcTexture->width() : 0.0f,
209 i < scaleFactorY ? SK_ScalarHalf / srcTexture->height() : 0.0f); 209 i < scaleFactorY ? SK_ScalarHalf / srcTexture->height() : 0.0f);
210 SkAutoTUnref<GrFragmentProcessor> fp(GrTextureDomainEffect::Create( 210 SkAutoTUnref<GrFragmentProcessor> fp( GrTextureDomainEffect::Creat e(
211 srcTexture, 211 srcTexture,
212 matrix, 212 matrix,
213 domain, 213 domain,
214 GrTextureDomain::kDecal_Mode, 214 GrTextureDomain::kDecal_Mode,
215 GrTextureParams::kBilerp_FilterMode)); 215 GrTextureParams::kBilerp_FilterMode));
216 paint.addColorProcessor(fp); 216 paint.addColorProcessor(fp);
217 } else { 217 } else {
218 GrTextureParams params(SkShader::kClamp_TileMode, GrTextureParams::k Bilerp_FilterMode); 218 GrTextureParams params(SkShader::kClamp_TileMode, GrTextureParams::k Bilerp_FilterMode);
219 paint.addColorTextureProcessor(srcTexture, matrix, params); 219 paint.addColorTextureProcessor(srcTexture, matrix, params);
220 } 220 }
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 context->drawRectToRect(paint, dstRect, srcRect); 302 context->drawRectToRect(paint, dstRect, srcRect);
303 srcRect = dstRect; 303 srcRect = dstRect;
304 srcTexture = dstTexture; 304 srcTexture = dstTexture;
305 SkTSwap(dstTexture, tempTexture); 305 SkTSwap(dstTexture, tempTexture);
306 } 306 }
307 return SkRef(srcTexture); 307 return SkRef(srcTexture);
308 } 308 }
309 #endif 309 #endif
310 310
311 } 311 }
OLDNEW
« no previous file with comments | « src/effects/SkDisplacementMapEffect.cpp ('k') | src/effects/gradients/SkGradientShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698