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

Side by Side Diff: gm/multipicturedraw.cpp

Issue 585033002: Fix memory leak in MultiPictureDraw GM (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 3 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 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 } 400 }
401 401
402 protected: 402 protected:
403 Content fContent; 403 Content fContent;
404 Layout fLayout; 404 Layout fLayout;
405 const SkPicture* fPictures[kNumPictures]; 405 const SkPicture* fPictures[kNumPictures];
406 406
407 virtual void onOnceBeforeDraw() SK_OVERRIDE { 407 virtual void onOnceBeforeDraw() SK_OVERRIDE {
408 fPictures[0] = make_hex_plane_picture(SK_ColorWHITE); 408 fPictures[0] = make_hex_plane_picture(SK_ColorWHITE);
409 fPictures[1] = make_hex_plane_picture(SK_ColorGRAY); 409 fPictures[1] = make_hex_plane_picture(SK_ColorGRAY);
410 fPictures[2] = SkRef(make_sierpinski_picture()); 410 fPictures[2] = make_sierpinski_picture();
411 } 411 }
412 412
413 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { 413 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE {
414 SkMultiPictureDraw mpd; 414 SkMultiPictureDraw mpd;
415 SkTArray<ComposeStep> composeSteps; 415 SkTArray<ComposeStep> composeSteps;
416 416
417 // Fill up the MultiPictureDraw 417 // Fill up the MultiPictureDraw
418 (*gLayoutMthds[fLayout])(canvas, &mpd, 418 (*gLayoutMthds[fLayout])(canvas, &mpd,
419 gContentMthds[fContent], 419 gContentMthds[fContent],
420 fPictures, &composeSteps); 420 fPictures, &composeSteps);
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 MultiPictureDraw::kTiled_Layout) );) 475 MultiPictureDraw::kTiled_Layout) );)
476 DEF_GM(return SkNEW_ARGS(MultiPictureDraw, (MultiPictureDraw::kRRectClipMult i_Content, 476 DEF_GM(return SkNEW_ARGS(MultiPictureDraw, (MultiPictureDraw::kRRectClipMult i_Content,
477 MultiPictureDraw::kTiled_Layout) );) 477 MultiPictureDraw::kTiled_Layout) );)
478 DEF_GM(return SkNEW_ARGS(MultiPictureDraw, (MultiPictureDraw::kPathClipMulti _Content, 478 DEF_GM(return SkNEW_ARGS(MultiPictureDraw, (MultiPictureDraw::kPathClipMulti _Content,
479 MultiPictureDraw::kTiled_Layout) );) 479 MultiPictureDraw::kTiled_Layout) );)
480 DEF_GM(return SkNEW_ARGS(MultiPictureDraw, (MultiPictureDraw::kInvPathClipMu lti_Content, 480 DEF_GM(return SkNEW_ARGS(MultiPictureDraw, (MultiPictureDraw::kInvPathClipMu lti_Content,
481 MultiPictureDraw::kTiled_Layout) );) 481 MultiPictureDraw::kTiled_Layout) );)
482 DEF_GM(return SkNEW_ARGS(MultiPictureDraw, (MultiPictureDraw::kSierpinski_Co ntent, 482 DEF_GM(return SkNEW_ARGS(MultiPictureDraw, (MultiPictureDraw::kSierpinski_Co ntent,
483 MultiPictureDraw::kTiled_Layout) );) 483 MultiPictureDraw::kTiled_Layout) );)
484 } 484 }
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