OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 GPU_COMMAND_BUFFER_COMMON_COMMAND_BUFFER_H_ | 5 #ifndef GPU_COMMAND_BUFFER_COMMON_COMMAND_BUFFER_H_ |
6 #define GPU_COMMAND_BUFFER_COMMON_COMMAND_BUFFER_H_ | 6 #define GPU_COMMAND_BUFFER_COMMON_COMMAND_BUFFER_H_ |
7 | 7 |
8 #include "gpu/command_buffer/common/buffer.h" | 8 #include "gpu/command_buffer/common/buffer.h" |
9 #include "gpu/command_buffer/common/constants.h" | 9 #include "gpu/command_buffer/common/constants.h" |
10 #include "gpu/gpu_export.h" | 10 #include "gpu/gpu_export.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 static bool InRange(int32 start, int32 end, int32 value) { | 75 static bool InRange(int32 start, int32 end, int32 value) { |
76 if (start <= end) | 76 if (start <= end) |
77 return start <= value && value <= end; | 77 return start <= value && value <= end; |
78 else | 78 else |
79 return start <= value || value <= end; | 79 return start <= value || value <= end; |
80 } | 80 } |
81 | 81 |
82 // Initialize the command buffer with the given size. | 82 // Initialize the command buffer with the given size. |
83 virtual bool Initialize() = 0; | 83 virtual bool Initialize() = 0; |
84 | 84 |
85 // Returns the current status. | |
86 virtual State GetState() = 0; | |
87 | |
88 // Returns the last state without synchronizing with the service. | 85 // Returns the last state without synchronizing with the service. |
89 virtual State GetLastState() = 0; | 86 virtual State GetLastState() = 0; |
90 | 87 |
91 // Returns the last token without synchronizing with the service. Note that | 88 // Returns the last token without synchronizing with the service. Note that |
92 // while you could just call GetLastState().token, GetLastState needs to be | 89 // while you could just call GetLastState().token, GetLastState needs to be |
93 // fast as it is called for every command where GetLastToken is only called | 90 // fast as it is called for every command where GetLastToken is only called |
94 // by code that needs to know the last token so it can be slower but more up | 91 // by code that needs to know the last token so it can be slower but more up |
95 // to date than GetLastState. | 92 // to date than GetLastState. |
96 virtual int32 GetLastToken() = 0; | 93 virtual int32 GetLastToken() = 0; |
97 | 94 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 virtual error::Error GetLastError(); | 129 virtual error::Error GetLastError(); |
133 #endif | 130 #endif |
134 | 131 |
135 private: | 132 private: |
136 DISALLOW_COPY_AND_ASSIGN(CommandBuffer); | 133 DISALLOW_COPY_AND_ASSIGN(CommandBuffer); |
137 }; | 134 }; |
138 | 135 |
139 } // namespace gpu | 136 } // namespace gpu |
140 | 137 |
141 #endif // GPU_COMMAND_BUFFER_COMMON_COMMAND_BUFFER_H_ | 138 #endif // GPU_COMMAND_BUFFER_COMMON_COMMAND_BUFFER_H_ |
OLD | NEW |