| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |