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

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

Issue 2472703005: Fix memory leak in https://skia-review.googlesource.com/c/4227/ (Back SkSpecialImage_Gpu with a GrT… (Closed)
Patch Set: Created 4 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 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 7
8 #include "GrTextureProxy.h" 8 #include "GrTextureProxy.h"
9 9
10 #include "GrTextureProvider.h" 10 #include "GrTextureProvider.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 } 58 }
59 59
60 sk_sp<GrTextureProxy> GrTextureProxy::Make(GrTextureProvider* texProvider, 60 sk_sp<GrTextureProxy> GrTextureProxy::Make(GrTextureProvider* texProvider,
61 const GrSurfaceDesc& desc, 61 const GrSurfaceDesc& desc,
62 SkBackingFit fit, 62 SkBackingFit fit,
63 SkBudgeted budgeted, 63 SkBudgeted budgeted,
64 const void* srcData, 64 const void* srcData,
65 size_t rowBytes) { 65 size_t rowBytes) {
66 if (srcData) { 66 if (srcData) {
67 // If we have srcData, for now, we create a wrapped GrTextureProxy 67 // If we have srcData, for now, we create a wrapped GrTextureProxy
68 sk_sp<GrTexture> tex = sk_ref_sp(texProvider->createTexture(desc, budget ed, 68 sk_sp<GrTexture> tex(texProvider->createTexture(desc, budgeted, srcData, rowBytes));
69 srcData, row Bytes));
70 return GrTextureProxy::Make(std::move(tex)); 69 return GrTextureProxy::Make(std::move(tex));
71 } 70 }
72 71
73 return sk_sp<GrTextureProxy>(new GrTextureProxy(desc, fit, budgeted, nullptr , 0)); 72 return sk_sp<GrTextureProxy>(new GrTextureProxy(desc, fit, budgeted, nullptr , 0));
74 } 73 }
75 74
76 sk_sp<GrTextureProxy> GrTextureProxy::Make(sk_sp<GrTexture> tex) { 75 sk_sp<GrTextureProxy> GrTextureProxy::Make(sk_sp<GrTexture> tex) {
77 return sk_sp<GrTextureProxy>(new GrTextureProxy(std::move(tex))); 76 return sk_sp<GrTextureProxy>(new GrTextureProxy(std::move(tex)));
78 } 77 }
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