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

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

Issue 1168853002: Use mapped memory for uploading large textures. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added dcheck and improved other error messages Created 5 years, 6 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 definition of the RingBuffer class. 5 // This file contains the definition of the RingBuffer class.
6 6
7 #ifndef GPU_COMMAND_BUFFER_CLIENT_RING_BUFFER_H_ 7 #ifndef GPU_COMMAND_BUFFER_CLIENT_RING_BUFFER_H_
8 #define GPU_COMMAND_BUFFER_CLIENT_RING_BUFFER_H_ 8 #define GPU_COMMAND_BUFFER_CLIENT_RING_BUFFER_H_
9 9
10 #include <deque> 10 #include <deque>
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 void* Alloc(unsigned int size); 47 void* Alloc(unsigned int size);
48 48
49 // Frees a block of memory, pending the passage of a token. That memory won't 49 // Frees a block of memory, pending the passage of a token. That memory won't
50 // be re-allocated until the token has passed through the command stream. 50 // be re-allocated until the token has passed through the command stream.
51 // 51 //
52 // Parameters: 52 // Parameters:
53 // pointer: the pointer to the memory block to free. 53 // pointer: the pointer to the memory block to free.
54 // token: the token value to wait for before re-using the memory. 54 // token: the token value to wait for before re-using the memory.
55 void FreePendingToken(void* pointer, unsigned int token); 55 void FreePendingToken(void* pointer, unsigned int token);
56 56
57 // Discards a block within the ring buffer.
58 //
59 // Parameters:
60 // pointer: the pointer to the memory block to free.
61 void DiscardBlock(void* pointer);
62
57 // Gets the size of the largest free block that is available without waiting. 63 // Gets the size of the largest free block that is available without waiting.
58 unsigned int GetLargestFreeSizeNoWaiting(); 64 unsigned int GetLargestFreeSizeNoWaiting();
59 65
60 // Gets the size of the largest free block that can be allocated if the 66 // Gets the size of the largest free block that can be allocated if the
61 // caller can wait. Allocating a block of this size will succeed, but may 67 // caller can wait. Allocating a block of this size will succeed, but may
62 // block. 68 // block.
63 unsigned int GetLargestFreeOrPendingSize() { 69 unsigned int GetLargestFreeOrPendingSize() {
64 return size_; 70 return size_;
65 } 71 }
66 72
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 134
129 // The physical address that corresponds to base_offset. 135 // The physical address that corresponds to base_offset.
130 void* base_; 136 void* base_;
131 137
132 DISALLOW_IMPLICIT_CONSTRUCTORS(RingBuffer); 138 DISALLOW_IMPLICIT_CONSTRUCTORS(RingBuffer);
133 }; 139 };
134 140
135 } // namespace gpu 141 } // namespace gpu
136 142
137 #endif // GPU_COMMAND_BUFFER_CLIENT_RING_BUFFER_H_ 143 #endif // GPU_COMMAND_BUFFER_CLIENT_RING_BUFFER_H_
OLDNEW
« no previous file with comments | « gpu/command_buffer/client/mapped_memory_unittest.cc ('k') | gpu/command_buffer/client/ring_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698