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 "skia/ext/benchmarking_canvas.h" | 5 #include "skia/ext/benchmarking_canvas.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 std::string str() const { | 40 std::string str() const { |
41 return oss_.str(); | 41 return oss_.str(); |
42 } | 42 } |
43 | 43 |
44 private: | 44 private: |
45 char separator_; | 45 char separator_; |
46 std::ostringstream oss_; | 46 std::ostringstream oss_; |
47 }; | 47 }; |
48 | 48 |
49 std::unique_ptr<base::Value> AsValue(bool b) { | 49 std::unique_ptr<base::Value> AsValue(bool b) { |
50 std::unique_ptr<base::FundamentalValue> val(new base::FundamentalValue(b)); | 50 std::unique_ptr<base::Value> val(new base::Value(b)); |
51 | 51 |
52 return val; | 52 return val; |
53 } | 53 } |
54 | 54 |
55 std::unique_ptr<base::Value> AsValue(SkScalar scalar) { | 55 std::unique_ptr<base::Value> AsValue(SkScalar scalar) { |
56 std::unique_ptr<base::FundamentalValue> val( | 56 std::unique_ptr<base::Value> val(new base::Value(scalar)); |
57 new base::FundamentalValue(scalar)); | |
58 | 57 |
59 return val; | 58 return val; |
60 } | 59 } |
61 | 60 |
62 std::unique_ptr<base::Value> AsValue(const SkSize& size) { | 61 std::unique_ptr<base::Value> AsValue(const SkSize& size) { |
63 std::unique_ptr<base::DictionaryValue> val(new base::DictionaryValue()); | 62 std::unique_ptr<base::DictionaryValue> val(new base::DictionaryValue()); |
64 val->Set("width", AsValue(size.width())); | 63 val->Set("width", AsValue(size.width())); |
65 val->Set("height", AsValue(size.height())); | 64 val->Set("height", AsValue(size.height())); |
66 | 65 |
67 return std::move(val); | 66 return std::move(val); |
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
714 DCHECK(blob); | 713 DCHECK(blob); |
715 AutoOp op(this, "DrawTextBlob", &paint); | 714 AutoOp op(this, "DrawTextBlob", &paint); |
716 op.addParam("blob", AsValue(*blob)); | 715 op.addParam("blob", AsValue(*blob)); |
717 op.addParam("x", AsValue(x)); | 716 op.addParam("x", AsValue(x)); |
718 op.addParam("y", AsValue(y)); | 717 op.addParam("y", AsValue(y)); |
719 | 718 |
720 INHERITED::onDrawTextBlob(blob, x, y, *op.paint()); | 719 INHERITED::onDrawTextBlob(blob, x, y, *op.paint()); |
721 } | 720 } |
722 | 721 |
723 } // namespace skia | 722 } // namespace skia |
OLD | NEW |