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

Side by Side Diff: bench/DeferredCanvasBench.cpp

Issue 23536046: Try for better bench stability. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: tune default settings a bit more towards slower and more precise Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | bench/benchmain.cpp » ('j') | bench/benchmain.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 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 #include "SkBenchmark.h" 7 #include "SkBenchmark.h"
8 #include "SkDeferredCanvas.h" 8 #include "SkDeferredCanvas.h"
9 #include "SkDevice.h" 9 #include "SkDevice.h"
10 #include "SkString.h" 10 #include "SkString.h"
(...skipping 14 matching lines...) Expand all
25 } 25 }
26 26
27 virtual void onDraw(SkCanvas* canvas) { 27 virtual void onDraw(SkCanvas* canvas) {
28 SkBaseDevice *device = canvas->getDevice()->createCompatibleDevice( 28 SkBaseDevice *device = canvas->getDevice()->createCompatibleDevice(
29 SkBitmap::kARGB_8888_Config, CANVAS_WIDTH, CANVAS_HEIGHT, false); 29 SkBitmap::kARGB_8888_Config, CANVAS_WIDTH, CANVAS_HEIGHT, false);
30 30
31 SkAutoTUnref<SkDeferredCanvas> deferredCanvas(SkDeferredCanvas::Create(d evice)); 31 SkAutoTUnref<SkDeferredCanvas> deferredCanvas(SkDeferredCanvas::Create(d evice));
32 device->unref(); 32 device->unref();
33 33
34 initDeferredCanvas(deferredCanvas); 34 initDeferredCanvas(deferredCanvas);
35 35 drawInDeferredCanvas(deferredCanvas);
36 for (int i = 0; i < this->getLoops(); i++) {
37 drawInDeferredCanvas(deferredCanvas);
38 }
39
40 finalizeDeferredCanvas(deferredCanvas); 36 finalizeDeferredCanvas(deferredCanvas);
41 deferredCanvas->flush(); 37 deferredCanvas->flush();
42 } 38 }
43 39
44 virtual void initDeferredCanvas(SkDeferredCanvas* canvas) = 0; 40 virtual void initDeferredCanvas(SkDeferredCanvas* canvas) = 0;
45 virtual void drawInDeferredCanvas(SkDeferredCanvas* canvas) = 0; 41 virtual void drawInDeferredCanvas(SkDeferredCanvas* canvas) = 0;
46 virtual void finalizeDeferredCanvas(SkDeferredCanvas* canvas) = 0; 42 virtual void finalizeDeferredCanvas(SkDeferredCanvas* canvas) = 0;
47 43
48 SkString fName; 44 SkString fName;
49 45
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 typedef DeferredCanvasBench INHERITED; 97 typedef DeferredCanvasBench INHERITED;
102 SimpleNotificationClient fNotificationClient; 98 SimpleNotificationClient fNotificationClient;
103 }; 99 };
104 100
105 101
106 /////////////////////////////////////////////////////////////////////////////// 102 ///////////////////////////////////////////////////////////////////////////////
107 103
108 static SkBenchmark* Fact0(void* p) { return new DeferredRecordBench(p); } 104 static SkBenchmark* Fact0(void* p) { return new DeferredRecordBench(p); }
109 105
110 static BenchRegistry gReg0(Fact0); 106 static BenchRegistry gReg0(Fact0);
OLDNEW
« no previous file with comments | « no previous file | bench/benchmain.cpp » ('j') | bench/benchmain.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698