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

Unified Diff: gpu/command_buffer/client/transfer_buffer.cc

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/command_buffer/client/transfer_buffer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/client/transfer_buffer.cc
diff --git a/gpu/command_buffer/client/transfer_buffer.cc b/gpu/command_buffer/client/transfer_buffer.cc
index cb02f15144e0eda9327edb867a9c2516670da09a..3ff257da5ad7c09aa1f448b1194783910a48acdf 100644
--- a/gpu/command_buffer/client/transfer_buffer.cc
+++ b/gpu/command_buffer/client/transfer_buffer.cc
@@ -73,6 +73,10 @@ RingBuffer::Offset TransferBuffer::GetOffset(void* pointer) const {
return ring_buffer_->GetOffset(pointer);
}
+void TransferBuffer::DiscardBlock(void* p) {
+ ring_buffer_->DiscardBlock(p);
+}
+
void TransferBuffer::FreePendingToken(void* p, unsigned int token) {
ring_buffer_->FreePendingToken(p, token);
if (bytes_since_last_flush_ >= size_to_flush_ && size_to_flush_ > 0) {
@@ -188,6 +192,14 @@ void ScopedTransferBufferPtr::Release() {
}
}
+void ScopedTransferBufferPtr::Discard() {
+ if (buffer_) {
+ transfer_buffer_->DiscardBlock(buffer_);
+ buffer_ = NULL;
+ size_ = 0;
+ }
+}
+
void ScopedTransferBufferPtr::Reset(unsigned int new_size) {
Release();
// NOTE: we allocate buffers of size 0 so that HaveBuffer will be true, so
« no previous file with comments | « gpu/command_buffer/client/transfer_buffer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698