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

Side by Side Diff: gm/multipicturedraw.cpp

Issue 502493002: Fix leak in multipicturedraw GMs. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 4 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 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 9
10 #include "SkColorFilter.h" 10 #include "SkColorFilter.h"
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 SkSafeUnref(fPictures[0]); 288 SkSafeUnref(fPictures[0]);
289 SkSafeUnref(fPictures[1]); 289 SkSafeUnref(fPictures[1]);
290 } 290 }
291 291
292 protected: 292 protected:
293 Content fContent; 293 Content fContent;
294 Layout fLayout; 294 Layout fLayout;
295 const SkPicture* fPictures[2]; 295 const SkPicture* fPictures[2];
296 296
297 virtual void onOnceBeforeDraw() SK_OVERRIDE { 297 virtual void onOnceBeforeDraw() SK_OVERRIDE {
298 fPictures[0] = SkRef(make_picture(SK_ColorWHITE)); 298 fPictures[0] = make_picture(SK_ColorWHITE);
299 fPictures[1] = SkRef(make_picture(SK_ColorGRAY)); 299 fPictures[1] = make_picture(SK_ColorGRAY);
300 } 300 }
301 301
302 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE{ 302 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE{
303 SkMultiPictureDraw mpd; 303 SkMultiPictureDraw mpd;
304 SkTArray<ComposeStep> composeSteps; 304 SkTArray<ComposeStep> composeSteps;
305 305
306 // Fill up the MultiPictureDraw 306 // Fill up the MultiPictureDraw
307 (*gLayoutMthds[fLayout])(canvas, &mpd, 307 (*gLayoutMthds[fLayout])(canvas, &mpd,
308 gContentMthds[fContent], 308 gContentMthds[fContent],
309 fPictures, &composeSteps); 309 fPictures, &composeSteps);
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 MultiPictureDraw::kTiled_Layout) );) 360 MultiPictureDraw::kTiled_Layout) );)
361 DEF_GM(return SkNEW_ARGS(MultiPictureDraw, (MultiPictureDraw::kRectClipMulti _Content, 361 DEF_GM(return SkNEW_ARGS(MultiPictureDraw, (MultiPictureDraw::kRectClipMulti _Content,
362 MultiPictureDraw::kTiled_Layout) );) 362 MultiPictureDraw::kTiled_Layout) );)
363 DEF_GM(return SkNEW_ARGS(MultiPictureDraw, (MultiPictureDraw::kRRectClipMult i_Content, 363 DEF_GM(return SkNEW_ARGS(MultiPictureDraw, (MultiPictureDraw::kRRectClipMult i_Content,
364 MultiPictureDraw::kTiled_Layout) );) 364 MultiPictureDraw::kTiled_Layout) );)
365 DEF_GM(return SkNEW_ARGS(MultiPictureDraw, (MultiPictureDraw::kPathClipMulti _Content, 365 DEF_GM(return SkNEW_ARGS(MultiPictureDraw, (MultiPictureDraw::kPathClipMulti _Content,
366 MultiPictureDraw::kTiled_Layout) );) 366 MultiPictureDraw::kTiled_Layout) );)
367 DEF_GM(return SkNEW_ARGS(MultiPictureDraw, (MultiPictureDraw::kInvPathClipMu lti_Content, 367 DEF_GM(return SkNEW_ARGS(MultiPictureDraw, (MultiPictureDraw::kInvPathClipMu lti_Content,
368 MultiPictureDraw::kTiled_Layout) );) 368 MultiPictureDraw::kTiled_Layout) );)
369 } 369 }
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