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

Unified Diff: services/gfx/compositor/graph/scene_label.h

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, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « services/gfx/compositor/graph/scene_def.cc ('k') | services/gfx/compositor/graph/scene_label.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/gfx/compositor/graph/scene_label.h
diff --git a/services/gfx/compositor/graph/scene_label.h b/services/gfx/compositor/graph/scene_label.h
new file mode 100644
index 0000000000000000000000000000000000000000..bc474c5d977443bfb04fbd05ac025011c9e4987a
--- /dev/null
+++ b/services/gfx/compositor/graph/scene_label.h
@@ -0,0 +1,37 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SERVICES_GFX_COMPOSITOR_GRAPH_SCENE_LABEL_H_
+#define SERVICES_GFX_COMPOSITOR_GRAPH_SCENE_LABEL_H_
+
+#include <string>
+
+namespace compositor {
+
+// Convenience class for formatting descriptive labels for diagnostics.
+class SceneLabel {
+ public:
+ SceneLabel(uint32_t token, const std::string& label);
+ SceneLabel(const SceneLabel& other);
+ ~SceneLabel();
+
+ // Gets the scene token.
+ uint32_t token() const { return token_; }
+
+ // Gets the user-supplied label of the scene.
+ const std::string& label() const { return label_; }
+
+ // Gets a descriptive label including optional version and node information.
+ std::string FormattedLabel() const;
+ std::string FormattedLabelForVersion(uint32_t version) const;
+ std::string FormattedLabelForNode(uint32_t version, uint32_t node_id) const;
+
+ private:
+ uint32_t const token_;
+ std::string const label_;
+};
+
+} // namespace compositor
+
+#endif // SERVICES_GFX_COMPOSITOR_GRAPH_SCENE_LABEL_H_
« no previous file with comments | « services/gfx/compositor/graph/scene_def.cc ('k') | services/gfx/compositor/graph/scene_label.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698