OLD | NEW |
(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 #ifndef SERVICES_GFX_COMPOSITOR_GRAPH_SCENE_LABEL_H_ |
| 6 #define SERVICES_GFX_COMPOSITOR_GRAPH_SCENE_LABEL_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 namespace compositor { |
| 11 |
| 12 // Convenience class for formatting descriptive labels for diagnostics. |
| 13 class SceneLabel { |
| 14 public: |
| 15 SceneLabel(uint32_t token, const std::string& label); |
| 16 SceneLabel(const SceneLabel& other); |
| 17 ~SceneLabel(); |
| 18 |
| 19 // Gets the scene token. |
| 20 uint32_t token() const { return token_; } |
| 21 |
| 22 // Gets the user-supplied label of the scene. |
| 23 const std::string& label() const { return label_; } |
| 24 |
| 25 // Gets a descriptive label including optional version and node information. |
| 26 std::string FormattedLabel() const; |
| 27 std::string FormattedLabelForVersion(uint32_t version) const; |
| 28 std::string FormattedLabelForNode(uint32_t version, uint32_t node_id) const; |
| 29 |
| 30 private: |
| 31 uint32_t const token_; |
| 32 std::string const label_; |
| 33 }; |
| 34 |
| 35 } // namespace compositor |
| 36 |
| 37 #endif // SERVICES_GFX_COMPOSITOR_GRAPH_SCENE_LABEL_H_ |
OLD | NEW |