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

Side by Side Diff: services/gfx/compositor/graph/scene_label.cc

Issue 1749063002: Mozart: Improve internal scene graph representation. (Closed) Base URL: git@github.com:domokit/mojo.git@moz-0
Patch Set: avoid unnecessary hashtable lookups Created 4 years, 9 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 | « services/gfx/compositor/graph/scene_label.h ('k') | services/gfx/compositor/graph/snapshot.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "services/gfx/compositor/graph/scene_label.h"
6
7 #include "base/strings/stringprintf.h"
8
9 namespace compositor {
10
11 SceneLabel::SceneLabel(uint32_t token, const std::string& label)
12 : token_(token), label_(label) {}
13
14 SceneLabel::SceneLabel(const SceneLabel& other)
15 : token_(other.token_), label_(other.label_) {}
16
17 SceneLabel::~SceneLabel() {}
18
19 std::string SceneLabel::FormattedLabel() const {
20 return label_.empty() ? base::StringPrintf("<%d>", token_)
21 : base::StringPrintf("<%d:%s>", token_, label_.c_str());
22 }
23
24 std::string SceneLabel::FormattedLabelForVersion(uint32_t version) const {
25 return label_.empty() ? base::StringPrintf("<%d/%d>", token_, version)
26 : base::StringPrintf("<%d:%s/%d>", token_,
27 label_.c_str(), version);
28 }
29
30 std::string SceneLabel::FormattedLabelForNode(uint32_t version,
31 uint32_t node_id) const {
32 return label_.empty()
33 ? base::StringPrintf("<%d/%d>[%d]", token_, version, node_id)
34 : base::StringPrintf("<%d:%s/%d>[%d]", token_, label_.c_str(),
35 version, node_id);
36 }
37
38 } // namespace compositor
OLDNEW
« no previous file with comments | « services/gfx/compositor/graph/scene_label.h ('k') | services/gfx/compositor/graph/snapshot.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698