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

Side by Side Diff: gpu/command_buffer/client/cmd_buffer_helper.h

Issue 162023002: Reduce internal Flush() in GL resource glGen/Delete APIs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert lock_ pattern change in IdHandler::FreeIds. Created 6 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 unified diff | Download patch
OLDNEW
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 // This file contains the command buffer helper class. 5 // This file contains the command buffer helper class.
6 6
7 #ifndef GPU_COMMAND_BUFFER_CLIENT_CMD_BUFFER_HELPER_H_ 7 #ifndef GPU_COMMAND_BUFFER_CLIENT_CMD_BUFFER_HELPER_H_
8 #define GPU_COMMAND_BUFFER_CLIENT_CMD_BUFFER_HELPER_H_ 8 #define GPU_COMMAND_BUFFER_CLIENT_CMD_BUFFER_HELPER_H_
9 9
10 #include <string.h> 10 #include <string.h>
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 } 249 }
250 250
251 CommandBuffer* command_buffer() const { 251 CommandBuffer* command_buffer() const {
252 return command_buffer_; 252 return command_buffer_;
253 } 253 }
254 254
255 Buffer get_ring_buffer() const { 255 Buffer get_ring_buffer() const {
256 return ring_buffer_; 256 return ring_buffer_;
257 } 257 }
258 258
259 uint32 flush_generation() const { return flush_generation_; }
260
259 void FreeRingBuffer(); 261 void FreeRingBuffer();
260 262
261 bool HaveRingBuffer() const { 263 bool HaveRingBuffer() const {
262 return ring_buffer_id_ != -1; 264 return ring_buffer_id_ != -1;
263 } 265 }
264 266
265 bool usable () const { 267 bool usable () const {
266 return usable_; 268 return usable_;
267 } 269 }
268 270
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 int commands_issued_; 306 int commands_issued_;
305 #endif 307 #endif
306 308
307 bool usable_; 309 bool usable_;
308 bool context_lost_; 310 bool context_lost_;
309 bool flush_automatically_; 311 bool flush_automatically_;
310 312
311 // Using C runtime instead of base because this file cannot depend on base. 313 // Using C runtime instead of base because this file cannot depend on base.
312 clock_t last_flush_time_; 314 clock_t last_flush_time_;
313 315
316 // Incremented every time the helper flushes the command buffer.
317 // Can be used to track when prior commands have been flushed.
318 uint32 flush_generation_;
319
314 friend class CommandBufferHelperTest; 320 friend class CommandBufferHelperTest;
315 DISALLOW_COPY_AND_ASSIGN(CommandBufferHelper); 321 DISALLOW_COPY_AND_ASSIGN(CommandBufferHelper);
316 }; 322 };
317 323
318 } // namespace gpu 324 } // namespace gpu
319 325
320 #endif // GPU_COMMAND_BUFFER_CLIENT_CMD_BUFFER_HELPER_H_ 326 #endif // GPU_COMMAND_BUFFER_CLIENT_CMD_BUFFER_HELPER_H_
OLDNEW
« no previous file with comments | « gpu/command_buffer/build_gles2_cmd_buffer.py ('k') | gpu/command_buffer/client/cmd_buffer_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698