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

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

Issue 1393553002: Insert clip fragment processor outside GrCMM (Closed) Base URL: https://skia.googlesource.com/skia.git@byebye
Patch Set: add class to friends Created 5 years, 2 months 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 | « gm/texturedomaineffect.cpp ('k') | src/effects/SkXfermodeImageFilter.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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 GrPaint paint; 201 GrPaint paint;
202 SkMatrix matrix; 202 SkMatrix matrix;
203 matrix.setIDiv(srcTexture->width(), srcTexture->height()); 203 matrix.setIDiv(srcTexture->width(), srcTexture->height());
204 SkRect dstRect(srcRect); 204 SkRect dstRect(srcRect);
205 if (cropToRect && i == 1) { 205 if (cropToRect && i == 1) {
206 dstRect.offset(-dstRect.fLeft, -dstRect.fTop); 206 dstRect.offset(-dstRect.fLeft, -dstRect.fTop);
207 SkRect domain; 207 SkRect domain;
208 matrix.mapRect(&domain, rect); 208 matrix.mapRect(&domain, rect);
209 domain.inset(i < scaleFactorX ? SK_ScalarHalf / srcTexture->width() : 0.0f, 209 domain.inset(i < scaleFactorX ? SK_ScalarHalf / srcTexture->width() : 0.0f,
210 i < scaleFactorY ? SK_ScalarHalf / srcTexture->height() : 0.0f); 210 i < scaleFactorY ? SK_ScalarHalf / srcTexture->height() : 0.0f);
211 SkAutoTUnref<GrFragmentProcessor> fp(GrTextureDomainEffect::Create( 211 SkAutoTUnref<const GrFragmentProcessor> fp(GrTextureDomainEffect::Cr eate(
212 srcTexture, 212 srcTexture,
213 matrix, 213 matrix,
214 domain, 214 domain,
215 GrTextureDomain::kDecal_Mode, 215 GrTextureDomain::kDecal_Mode,
216 GrTextureParams::kBilerp_FilterMode)); 216 GrTextureParams::kBilerp_FilterMode));
217 paint.addColorFragmentProcessor(fp); 217 paint.addColorFragmentProcessor(fp);
218 } else { 218 } else {
219 GrTextureParams params(SkShader::kClamp_TileMode, GrTextureParams::k Bilerp_FilterMode); 219 GrTextureParams params(SkShader::kClamp_TileMode, GrTextureParams::k Bilerp_FilterMode);
220 paint.addColorTextureProcessor(srcTexture, matrix, params); 220 paint.addColorTextureProcessor(srcTexture, matrix, params);
221 } 221 }
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 srcRect = dstRect; 357 srcRect = dstRect;
358 srcTexture = dstTexture; 358 srcTexture = dstTexture;
359 SkTSwap(dstTexture, tempTexture); 359 SkTSwap(dstTexture, tempTexture);
360 } 360 }
361 361
362 return SkRef(srcTexture); 362 return SkRef(srcTexture);
363 } 363 }
364 #endif 364 #endif
365 365
366 } 366 }
OLDNEW
« no previous file with comments | « gm/texturedomaineffect.cpp ('k') | src/effects/SkXfermodeImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698