Revert "Reland c91b178b07b0d - Delete dead signin code (SigninGlobalError)"
[chromium-blink-merge.git] / gpu / command_buffer / common / debug_marker_manager.h
blob65e0cd011d6fc5fad7ca6b2baf867c92813842e8
1 // Copyright (c) 2012 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.
5 #ifndef GPU_COMMAND_BUFFER_SERVICE_DEBUG_MARKER_MANAGER_H_
6 #define GPU_COMMAND_BUFFER_SERVICE_DEBUG_MARKER_MANAGER_H_
8 #include <stack>
9 #include <string>
10 #include "gpu/gpu_export.h"
12 namespace gpu {
13 namespace gles2 {
15 // Tracks debug marker.
16 class GPU_EXPORT DebugMarkerManager {
17 public:
18 DebugMarkerManager();
19 ~DebugMarkerManager();
21 // Gets the current marker on the top group.
22 const std::string& GetMarker() const;
23 // Sets the current marker on the top group.
24 void SetMarker(const std::string& marker);
25 // Pushes a new group.
26 void PushGroup(const std::string& name);
27 // Removes the top group. This is safe to call even when stack is empty.
28 void PopGroup(void);
30 private:
31 // Info about Buffers currently in the system.
32 class Group {
33 public:
34 explicit Group(const std::string& name);
35 ~Group();
37 const std::string& name() const {
38 return name_;
41 void SetMarker(const std::string& marker);
43 const std::string& marker() const {
44 return marker_;
47 private:
48 std::string name_;
49 std::string marker_;
52 typedef std::stack<Group> GroupStack;
54 GroupStack group_stack_;
55 std::string empty_;
58 } // namespace gles2
59 } // namespace gpu
61 #endif // GPU_COMMAND_BUFFER_SERVICE_DEBUG_MARKER_MANAGER_H_