| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "SkGpuDevice.h" | 8 #include "SkGpuDevice.h" |
| 9 | 9 |
| 10 #include "GrBlurUtils.h" | 10 #include "GrBlurUtils.h" |
| (...skipping 1495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1506 SkRect srcR, dstR; | 1506 SkRect srcR, dstR; |
| 1507 while (iter.next(&srcR, &dstR)) { | 1507 while (iter.next(&srcR, &dstR)) { |
| 1508 this->drawBitmapRect(draw, bitmap, &srcR, dstR, paint, | 1508 this->drawBitmapRect(draw, bitmap, &srcR, dstR, paint, |
| 1509 SkCanvas::kStrict_SrcRectConstraint); | 1509 SkCanvas::kStrict_SrcRectConstraint); |
| 1510 } | 1510 } |
| 1511 return; | 1511 return; |
| 1512 } | 1512 } |
| 1513 | 1513 |
| 1514 GrTextureParams params = GrTextureParams::ClampNoFilter(); | 1514 GrTextureParams params = GrTextureParams::ClampNoFilter(); |
| 1515 | 1515 |
| 1516 GrTexture* texture(GrRefCachedBitmapTexture(this->context(), bitmap, params)
); | 1516 SkAutoTUnref<GrTexture> texture(GrRefCachedBitmapTexture(this->context(), bi
tmap, params)); |
| 1517 if (nullptr == texture) { | 1517 if (nullptr == texture) { |
| 1518 return; | 1518 return; |
| 1519 } | 1519 } |
| 1520 | 1520 |
| 1521 SkMatrix texMatrix; | 1521 SkMatrix texMatrix; |
| 1522 texMatrix.setIDiv(texture->width(), texture->height()); | 1522 texMatrix.setIDiv(texture->width(), texture->height()); |
| 1523 | 1523 |
| 1524 SkAutoTUnref<const GrFragmentProcessor> fp(GrSimpleTextureEffect::Create(tex
ture, texMatrix, | 1524 SkAutoTUnref<const GrFragmentProcessor> fp(GrSimpleTextureEffect::Create(tex
ture, texMatrix, |
| 1525 par
ams)); | 1525 par
ams)); |
| 1526 | 1526 |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1877 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); | 1877 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); |
| 1878 } | 1878 } |
| 1879 | 1879 |
| 1880 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { | 1880 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { |
| 1881 // We always return a transient cache, so it is freed after each | 1881 // We always return a transient cache, so it is freed after each |
| 1882 // filter traversal. | 1882 // filter traversal. |
| 1883 return SkGpuDevice::NewImageFilterCache(); | 1883 return SkGpuDevice::NewImageFilterCache(); |
| 1884 } | 1884 } |
| 1885 | 1885 |
| 1886 #endif | 1886 #endif |
| OLD | NEW |