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

Side by Side Diff: src/core/SkSpecialImage.cpp

Issue 1825073003: Fix second memory leak in SkSpecialImage (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 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 | « 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 2016 Google Inc. 2 * Copyright 2016 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 #include "SkSpecialImage.h" 7 #include "SkSpecialImage.h"
8 8
9 #if SK_SUPPORT_GPU 9 #if SK_SUPPORT_GPU
10 #include "GrTexture.h" 10 #include "GrTexture.h"
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 return sk_make_sp<SkImage_Gpu>(fTexture->width(), fTexture->height() , 495 return sk_make_sp<SkImage_Gpu>(fTexture->width(), fTexture->height() ,
496 kNeedNewImageUniqueID, 496 kNeedNewImageUniqueID,
497 fAlphaType, fTexture, SkBudgeted::kYe s); 497 fAlphaType, fTexture, SkBudgeted::kYe s);
498 } 498 }
499 499
500 GrContext* ctx = fTexture->getContext(); 500 GrContext* ctx = fTexture->getContext();
501 GrSurfaceDesc desc = fTexture->desc(); 501 GrSurfaceDesc desc = fTexture->desc();
502 desc.fWidth = subset.width(); 502 desc.fWidth = subset.width();
503 desc.fHeight = subset.height(); 503 desc.fHeight = subset.height();
504 504
505 GrTexture* subTx = ctx->textureProvider()->createTexture(desc, SkBudgete d::kYes); 505 SkAutoTUnref<GrTexture> subTx(ctx->textureProvider()->createTexture(desc ,
506 SkBu dgeted::kYes));
506 if (!subTx) { 507 if (!subTx) {
507 return nullptr; 508 return nullptr;
508 } 509 }
509 ctx->copySurface(subTx, fTexture, subset, SkIPoint::Make(0, 0)); 510 ctx->copySurface(subTx, fTexture, subset, SkIPoint::Make(0, 0));
510 return sk_make_sp<SkImage_Gpu>(desc.fWidth, desc.fHeight, kNeedNewImageU niqueID, 511 return sk_make_sp<SkImage_Gpu>(desc.fWidth, desc.fHeight, kNeedNewImageU niqueID,
511 fAlphaType, subTx, SkBudgeted::kYes); 512 fAlphaType, subTx, SkBudgeted::kYes);
512 } 513 }
513 514
514 SkSurface* onMakeTightSurface(const SkImageInfo& info) const override { 515 SkSurface* onMakeTightSurface(const SkImageInfo& info) const override {
515 return SkSurface::NewRenderTarget(fTexture->getContext(), SkBudgeted::kY es, info); 516 return SkSurface::NewRenderTarget(fTexture->getContext(), SkBudgeted::kY es, info);
(...skipping 19 matching lines...) Expand all
535 536
536 sk_sp<SkSpecialImage> SkSpecialImage::MakeFromGpu(SkImageFilter::Proxy* proxy, 537 sk_sp<SkSpecialImage> SkSpecialImage::MakeFromGpu(SkImageFilter::Proxy* proxy,
537 const SkIRect& subset, 538 const SkIRect& subset,
538 uint32_t uniqueID, 539 uint32_t uniqueID,
539 GrTexture* tex, 540 GrTexture* tex,
540 SkAlphaType at) { 541 SkAlphaType at) {
541 return nullptr; 542 return nullptr;
542 } 543 }
543 544
544 #endif 545 #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