OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef SKIA_EXT_BENCHMARKING_CANVAS_H_ | 5 #ifndef SKIA_EXT_BENCHMARKING_CANVAS_H_ |
6 #define SKIA_EXT_BENCHMARKING_CANVAS_H_ | 6 #define SKIA_EXT_BENCHMARKING_CANVAS_H_ |
7 | 7 |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "third_party/skia/include/utils/SkNWayCanvas.h" | 9 #include "third_party/skia/include/utils/SkNWayCanvas.h" |
10 | 10 |
11 namespace skia { | 11 namespace skia { |
12 | 12 |
13 class SK_API BenchmarkingCanvas : public SkNWayCanvas { | 13 class SK_API BenchmarkingCanvas : public SkNWayCanvas { |
14 public: | 14 public: |
15 BenchmarkingCanvas(SkCanvas* canvas, unsigned flags = 0); | 15 BenchmarkingCanvas(SkCanvas* canvas, unsigned flags = 0); |
16 ~BenchmarkingCanvas() override; | 16 ~BenchmarkingCanvas() override; |
17 | 17 |
18 enum Flags { | 18 enum Flags { |
19 // TODO(fmalita): add overdraw visualization support | |
20 // (http://crbug.com/461534) | |
21 kOverdrawVisualization_Flag = 0x01, | 19 kOverdrawVisualization_Flag = 0x01, |
22 }; | 20 }; |
23 | 21 |
24 // Returns the number of draw commands executed on this canvas. | 22 // Returns the number of draw commands executed on this canvas. |
25 size_t CommandCount() const; | 23 size_t CommandCount() const; |
26 | 24 |
27 // Returns the list of executed draw commands. | 25 // Returns the list of executed draw commands. |
28 const base::ListValue& Commands() const; | 26 const base::ListValue& Commands() const; |
29 | 27 |
30 // Return the recorded render time (milliseconds) for a draw command index. | 28 // Return the recorded render time (milliseconds) for a draw command index. |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 typedef SkNWayCanvas INHERITED; | 80 typedef SkNWayCanvas INHERITED; |
83 | 81 |
84 class AutoOp; | 82 class AutoOp; |
85 | 83 |
86 base::ListValue op_records_; | 84 base::ListValue op_records_; |
87 unsigned flags_; | 85 unsigned flags_; |
88 }; | 86 }; |
89 | 87 |
90 } | 88 } |
91 #endif // SKIA_EXT_BENCHMARKING_CANVAS_H | 89 #endif // SKIA_EXT_BENCHMARKING_CANVAS_H |
OLD | NEW |