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/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "skia/ext/refptr.h" | 9 #include "skia/ext/refptr.h" |
10 #include "third_party/skia/include/utils/SkNWayCanvas.h" | 10 #include "third_party/skia/include/utils/SkNWayCanvas.h" |
11 #include "third_party/skia/src/utils/debugger/SkDebugCanvas.h" | 11 #include "third_party/skia/src/utils/debugger/SkDebugCanvas.h" |
12 | 12 |
13 namespace skia { | 13 namespace skia { |
14 | 14 |
15 class TimingCanvas; | 15 class TimingCanvas; |
16 | 16 |
17 class SK_API BenchmarkingCanvas : public SkNWayCanvas { | 17 class SK_API BenchmarkingCanvas : public SkNWayCanvas { |
18 public: | 18 public: |
19 BenchmarkingCanvas(int width, int height); | 19 BenchmarkingCanvas(int width, int height); |
20 virtual ~BenchmarkingCanvas(); | 20 ~BenchmarkingCanvas() override; |
21 | 21 |
22 // Returns the number of draw commands executed on this canvas. | 22 // Returns the number of draw commands executed on this canvas. |
23 size_t CommandCount() const; | 23 size_t CommandCount() const; |
24 | 24 |
25 // Get draw command info for a given index. | 25 // Get draw command info for a given index. |
26 SkDrawCommand* GetCommand(size_t index); | 26 SkDrawCommand* GetCommand(size_t index); |
27 | 27 |
28 // Return the recorded render time (milliseconds) for a draw command index. | 28 // Return the recorded render time (milliseconds) for a draw command index. |
29 double GetTime(size_t index); | 29 double GetTime(size_t index); |
30 | 30 |
(...skipping 10 matching lines...) Expand all Loading... |
41 // updating content::SkiaTimingCanvas to accurately override all new methods | 41 // updating content::SkiaTimingCanvas to accurately override all new methods |
42 // (to avoid timing info indices from getting out of sync), as SkDebugCanvas | 42 // (to avoid timing info indices from getting out of sync), as SkDebugCanvas |
43 // already does that for us. | 43 // already does that for us. |
44 | 44 |
45 skia::RefPtr<SkDebugCanvas> debug_canvas_; | 45 skia::RefPtr<SkDebugCanvas> debug_canvas_; |
46 skia::RefPtr<TimingCanvas> timing_canvas_; | 46 skia::RefPtr<TimingCanvas> timing_canvas_; |
47 }; | 47 }; |
48 | 48 |
49 } | 49 } |
50 #endif // SKIA_EXT_BENCHMARKING_CANVAS_H | 50 #endif // SKIA_EXT_BENCHMARKING_CANVAS_H |
OLD | NEW |