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

Side by Side Diff: skia/ext/benchmarking_canvas.cc

Issue 2645073002: Inline FundamentalValue into base::Value (Closed)
Patch Set: Typedef FundamentalValue to Value Created 3 years, 11 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
« no previous file with comments | « base/values_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
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::FundamentalValue> val(new base::FundamentalValue(b));
51 51
52 return std::move(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::FundamentalValue> val(
57 new base::FundamentalValue(scalar)); 57 new base::FundamentalValue(scalar));
58 58
59 return std::move(val); 59 return val;
jdoerrie 2017/01/21 15:06:51 After the typdef this results in a compile error:
brettw 2017/01/23 05:52:50 Interesting, I wonder why it didn't complain befor
jdoerrie 2017/01/24 08:59:35 If I understand this correctly, only after the typ
60 } 60 }
61 61
62 std::unique_ptr<base::Value> AsValue(const SkSize& size) { 62 std::unique_ptr<base::Value> AsValue(const SkSize& size) {
63 std::unique_ptr<base::DictionaryValue> val(new base::DictionaryValue()); 63 std::unique_ptr<base::DictionaryValue> val(new base::DictionaryValue());
64 val->Set("width", AsValue(size.width())); 64 val->Set("width", AsValue(size.width()));
65 val->Set("height", AsValue(size.height())); 65 val->Set("height", AsValue(size.height()));
66 66
67 return std::move(val); 67 return std::move(val);
68 } 68 }
69 69
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after
716 DCHECK(blob); 716 DCHECK(blob);
717 AutoOp op(this, "DrawTextBlob", &paint); 717 AutoOp op(this, "DrawTextBlob", &paint);
718 op.addParam("blob", AsValue(*blob)); 718 op.addParam("blob", AsValue(*blob));
719 op.addParam("x", AsValue(x)); 719 op.addParam("x", AsValue(x));
720 op.addParam("y", AsValue(y)); 720 op.addParam("y", AsValue(y));
721 721
722 INHERITED::onDrawTextBlob(blob, x, y, *op.paint()); 722 INHERITED::onDrawTextBlob(blob, x, y, *op.paint());
723 } 723 }
724 724
725 } // namespace skia 725 } // namespace skia
OLDNEW
« no previous file with comments | « base/values_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698