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