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

Side by Side Diff: bench/DeferredCanvasBench.cpp

Issue 136753016: remove (unused by chrome) SkDeferredCanvas(device) factory signature (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 | include/utils/SkDeferredCanvas.h » ('j') | 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 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"
11 11
12 class DeferredCanvasBench : public SkBenchmark { 12 class DeferredCanvasBench : public SkBenchmark {
13 public: 13 public:
14 DeferredCanvasBench(const char name[]) { 14 DeferredCanvasBench(const char name[]) {
15 fName.printf("deferred_canvas_%s", name); 15 fName.printf("deferred_canvas_%s", name);
16 } 16 }
17 17
18 enum { 18 enum {
19 CANVAS_WIDTH = 200, 19 CANVAS_WIDTH = 200,
20 CANVAS_HEIGHT = 200, 20 CANVAS_HEIGHT = 200,
21 }; 21 };
22 protected: 22 protected:
23 virtual const char* onGetName() { 23 virtual const char* onGetName() {
24 return fName.c_str(); 24 return fName.c_str();
25 } 25 }
26 26
27 virtual void onDraw(const int loops, SkCanvas* canvas) { 27 virtual void onDraw(const int loops, SkCanvas* canvas) {
28 #if 0 // what specifically are we interested in timing here?
28 SkBaseDevice *device = canvas->getDevice()->createCompatibleDevice( 29 SkBaseDevice *device = canvas->getDevice()->createCompatibleDevice(
29 SkBitmap::kARGB_8888_Config, CANVAS_WIDTH, CANVAS_HEIGHT, false); 30 SkBitmap::kARGB_8888_Config, CANVAS_WIDTH, CANVAS_HEIGHT, false);
30 31
31 SkAutoTUnref<SkDeferredCanvas> deferredCanvas(SkDeferredCanvas::Create(d evice)); 32 SkAutoTUnref<SkDeferredCanvas> deferredCanvas(SkDeferredCanvas::Create(d evice));
32 device->unref(); 33 device->unref();
33 34
34 initDeferredCanvas(deferredCanvas); 35 initDeferredCanvas(deferredCanvas);
35 drawInDeferredCanvas(loops, deferredCanvas); 36 drawInDeferredCanvas(loops, deferredCanvas);
36 finalizeDeferredCanvas(deferredCanvas); 37 finalizeDeferredCanvas(deferredCanvas);
37 deferredCanvas->flush(); 38 deferredCanvas->flush();
39 #endif
38 } 40 }
39 41
40 virtual void initDeferredCanvas(SkDeferredCanvas* canvas) = 0; 42 virtual void initDeferredCanvas(SkDeferredCanvas* canvas) = 0;
41 virtual void drawInDeferredCanvas(const int loops, SkDeferredCanvas* canvas) = 0; 43 virtual void drawInDeferredCanvas(const int loops, SkDeferredCanvas* canvas) = 0;
42 virtual void finalizeDeferredCanvas(SkDeferredCanvas* canvas) = 0; 44 virtual void finalizeDeferredCanvas(SkDeferredCanvas* canvas) = 0;
43 45
44 SkString fName; 46 SkString fName;
45 47
46 private: 48 private:
47 typedef SkBenchmark INHERITED; 49 typedef SkBenchmark INHERITED;
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 97
96 private: 98 private:
97 typedef DeferredCanvasBench INHERITED; 99 typedef DeferredCanvasBench INHERITED;
98 SimpleNotificationClient fNotificationClient; 100 SimpleNotificationClient fNotificationClient;
99 }; 101 };
100 102
101 103
102 /////////////////////////////////////////////////////////////////////////////// 104 ///////////////////////////////////////////////////////////////////////////////
103 105
104 DEF_BENCH( return new DeferredRecordBench(); ) 106 DEF_BENCH( return new DeferredRecordBench(); )
OLDNEW
« no previous file with comments | « no previous file | include/utils/SkDeferredCanvas.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698