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

Side by Side Diff: bench/GrMipMapBench.cpp

Issue 2032693002: Release surface between runs to avoid seg fault (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 6 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 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 "Benchmark.h" 8 #include "Benchmark.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkImage.h" 10 #include "SkImage.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 fSurface->getCanvas()->drawPoint(0, 0, SK_ColorWHITE); 52 fSurface->getCanvas()->drawPoint(0, 0, SK_ColorWHITE);
53 53
54 // Draw reduced version of surface to original canvas, to trigger mi p generation 54 // Draw reduced version of surface to original canvas, to trigger mi p generation
55 canvas->save(); 55 canvas->save();
56 canvas->scale(0.1f, 0.1f); 56 canvas->scale(0.1f, 0.1f);
57 canvas->drawImage(fSurface->makeImageSnapshot(SkBudgeted::kNo), 0, 0 , &paint); 57 canvas->drawImage(fSurface->makeImageSnapshot(SkBudgeted::kNo), 0, 0 , &paint);
58 canvas->restore(); 58 canvas->restore();
59 } 59 }
60 } 60 }
61 61
62 void onPerCanvasPostDraw(SkCanvas*) override {
63 fSurface.reset(nullptr);
64 }
65
62 private: 66 private:
63 typedef Benchmark INHERITED; 67 typedef Benchmark INHERITED;
64 }; 68 };
65 69
66 // Build variants that exercise the width and heights being even or odd at each level, as the 70 // Build variants that exercise the width and heights being even or odd at each level, as the
67 // impl specializes on each of these. 71 // impl specializes on each of these.
68 // 72 //
69 DEF_BENCH( return new GrMipMapBench(511, 1023); ) 73 DEF_BENCH( return new GrMipMapBench(511, 1023); )
70 DEF_BENCH( return new GrMipMapBench(512, 511); ) 74 DEF_BENCH( return new GrMipMapBench(512, 511); )
71 DEF_BENCH( return new GrMipMapBench(511, 512); ) 75 DEF_BENCH( return new GrMipMapBench(511, 512); )
72 DEF_BENCH( return new GrMipMapBench(512, 512); ) 76 DEF_BENCH( return new GrMipMapBench(512, 512); )
73 77
74 #endif 78 #endif
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