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

Side by Side Diff: gm/imagefiltersclipped.cpp

Issue 146193004: Fix memory leak in imagefiltersclipped GM (found by valgrind). (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 10 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 | Annotate | Revision Log
« 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 2014 Google Inc. 2 * Copyright 2014 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 "gm.h" 8 #include "gm.h"
9 #include "SkColor.h" 9 #include "SkColor.h"
10 #include "SkBitmapSource.h" 10 #include "SkBitmapSource.h"
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 canvas->translate(SkIntToScalar(16), SkIntToScalar(-32)); 119 canvas->translate(SkIntToScalar(16), SkIntToScalar(-32));
120 } 120 }
121 canvas->drawCircle(r.centerX(), r.centerY(), 121 canvas->drawCircle(r.centerX(), r.centerY(),
122 SkScalarDiv(r.width()*2, SkIntToScalar(5)), p aint); 122 SkScalarDiv(r.width()*2, SkIntToScalar(5)), p aint);
123 canvas->restore(); 123 canvas->restore();
124 canvas->translate(r.width() + margin, 0); 124 canvas->translate(r.width() + margin, 0);
125 } 125 }
126 canvas->restore(); 126 canvas->restore();
127 canvas->translate(0, r.height() + margin); 127 canvas->translate(0, r.height() + margin);
128 } 128 }
129
130 for (size_t i = 0; i < SK_ARRAY_COUNT(filters); ++i) {
131 SkSafeUnref(filters[i]);
132 }
129 } 133 }
130 134
131 private: 135 private:
132 bool fInitialized; 136 bool fInitialized;
133 SkBitmap fCheckerboard; 137 SkBitmap fCheckerboard;
134 SkBitmap fGradientCircle; 138 SkBitmap fGradientCircle;
135 typedef GM INHERITED; 139 typedef GM INHERITED;
136 }; 140 };
137 141
138 ////////////////////////////////////////////////////////////////////////////// 142 //////////////////////////////////////////////////////////////////////////////
139 143
140 static GM* MyFactory(void*) { return new ImageFiltersClippedGM; } 144 static GM* MyFactory(void*) { return new ImageFiltersClippedGM; }
141 static GMRegistry reg(MyFactory); 145 static GMRegistry reg(MyFactory);
142 146
143 } 147 }
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