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

Unified Diff: tests/GLProgramsTest.cpp

Issue 799063005: GLPrograms leak fix (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/GLProgramsTest.cpp
diff --git a/tests/GLProgramsTest.cpp b/tests/GLProgramsTest.cpp
index 093c613b6f5852b7c094e65ee497b09981f9864c..ac50a9dc0945d6518e47ceb5a7ea09c3cc86dfcd 100644
--- a/tests/GLProgramsTest.cpp
+++ b/tests/GLProgramsTest.cpp
@@ -282,12 +282,12 @@ bool GrDrawTarget::programUnitTest(int maxStages) {
// twiddle drawstate knobs randomly
bool hasGeometryProcessor = !usePathRendering;
- const GrGeometryProcessor* gp = NULL;
- const GrPathProcessor* pathProc = NULL;
+ SkAutoTUnref<const GrGeometryProcessor> gp;
+ SkAutoTUnref<const GrPathProcessor> pathProc;
if (hasGeometryProcessor) {
- gp = get_random_gp(fContext, gpu->glCaps(), &random, dummyTextures);
+ gp.reset(get_random_gp(fContext, gpu->glCaps(), &random, dummyTextures));
} else {
- pathProc = GrPathProcessor::Create(GrColor_WHITE);
+ pathProc.reset(GrPathProcessor::Create(GrColor_WHITE));
}
set_random_color_coverage_stages(gpu,
&ds,
@@ -306,9 +306,9 @@ bool GrDrawTarget::programUnitTest(int maxStages) {
const GrPrimitiveProcessor* primProc;
if (hasGeometryProcessor) {
- primProc = gp;
+ primProc = gp.get();
} else {
- primProc = pathProc;
+ primProc = pathProc.get();
}
if (!this->setupDstReadIfNecessary(&ds, primProc, &dstCopy, NULL)) {
SkDebugf("Couldn't setup dst read texture");
« 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