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 #include "base/containers/hash_tables.h" | 5 #include "base/containers/hash_tables.h" |
6 #include "base/logging.h" | 6 #include "base/logging.h" |
7 #include "base/time/time.h" | 7 #include "base/time/time.h" |
8 #include "skia/ext/benchmarking_canvas.h" | 8 #include "skia/ext/benchmarking_canvas.h" |
9 #include "third_party/skia/include/utils/SkProxyCanvas.h" | 9 #include "third_party/skia/include/utils/SkProxyCanvas.h" |
10 | 10 |
(...skipping 22 matching lines...) Expand all Loading... |
33 } | 33 } |
34 | 34 |
35 double GetTime(size_t index) { | 35 double GetTime(size_t index) { |
36 TimingsMap::const_iterator timing_info = timings_map_.find(index); | 36 TimingsMap::const_iterator timing_info = timings_map_.find(index); |
37 return timing_info != timings_map_.end() | 37 return timing_info != timings_map_.end() |
38 ? timing_info->second.InMillisecondsF() | 38 ? timing_info->second.InMillisecondsF() |
39 : 0.0; | 39 : 0.0; |
40 } | 40 } |
41 | 41 |
42 // SkCanvas overrides. | 42 // SkCanvas overrides. |
43 virtual void willSave(SaveFlags flags) OVERRIDE { | 43 virtual void willSave() OVERRIDE { |
44 AutoStamper stamper(this); | 44 AutoStamper stamper(this); |
45 SkProxyCanvas::willSave(flags); | 45 SkProxyCanvas::willSave(); |
46 } | 46 } |
47 | 47 |
48 virtual SaveLayerStrategy willSaveLayer(const SkRect* bounds, | 48 virtual SaveLayerStrategy willSaveLayer(const SkRect* bounds, |
49 const SkPaint* paint, | 49 const SkPaint* paint, |
50 SaveFlags flags) OVERRIDE { | 50 SaveFlags flags) OVERRIDE { |
51 AutoStamper stamper(this); | 51 AutoStamper stamper(this); |
52 return SkProxyCanvas::willSaveLayer(bounds, paint, flags); | 52 return SkProxyCanvas::willSaveLayer(bounds, paint, flags); |
53 } | 53 } |
54 | 54 |
55 virtual void willRestore() OVERRIDE { | 55 virtual void willRestore() OVERRIDE { |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 DCHECK_LT(index, static_cast<size_t>(debug_canvas_->getSize())); | 229 DCHECK_LT(index, static_cast<size_t>(debug_canvas_->getSize())); |
230 return debug_canvas_->getDrawCommandAt(index); | 230 return debug_canvas_->getDrawCommandAt(index); |
231 } | 231 } |
232 | 232 |
233 double BenchmarkingCanvas::GetTime(size_t index) { | 233 double BenchmarkingCanvas::GetTime(size_t index) { |
234 DCHECK_LT(index, static_cast<size_t>(debug_canvas_->getSize())); | 234 DCHECK_LT(index, static_cast<size_t>(debug_canvas_->getSize())); |
235 return timing_canvas_->GetTime(index); | 235 return timing_canvas_->GetTime(index); |
236 } | 236 } |
237 | 237 |
238 } // namespace skia | 238 } // namespace skia |
OLD | NEW |