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

Side by Side Diff: src/gpu/SkGpuDevice.cpp

Issue 1462893002: Fix leak in drawBitmapNine (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 1 month 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 | « no previous file | no next file » | 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 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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698