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

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

Issue 116863003: gpu: Reuse transfer buffers more aggresively (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: [WIP] Introduced internal SetAsyncToken command buffer command Created 6 years, 11 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
Index: gpu/command_buffer/service/gles2_cmd_decoder.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 25509d8d7ee346ae696b01c6302758a7ad86447d..ea02fab1937b14e1b360fc9d0cdef5dbe7a38793 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -676,6 +676,12 @@ class GLES2DecoderImpl : public GLES2Decoder,
bool GenVertexArraysOESHelper(GLsizei n, const GLuint* client_ids);
void DeleteVertexArraysOESHelper(GLsizei n, const GLuint* client_ids);
+ // Callback for completed async uploads.
+ void AsyncUploadCompleted(uint32 async_token);
reveman 2014/01/22 17:30:04 This is not really a completed upload, it's the pa
+
+ // Overridden from CommonDecoder
+ virtual void OnSetAsyncToken(uint32 async_token) OVERRIDE;
+
// Workarounds
void OnFboChanged() const;
void OnUseFramebuffer() const;
@@ -3547,6 +3553,17 @@ const char* GLES2DecoderImpl::GetCommandName(unsigned int command_id) const {
return GetCommonCommandName(static_cast<cmd::CommandId>(command_id));
}
+void GLES2DecoderImpl::AsyncUploadCompleted(uint32 async_token) {
+ engine()->set_async_token(async_token);
+}
+
+void GLES2DecoderImpl::OnSetAsyncToken(uint32 async_token) {
+ GetAsyncPixelTransferManager()->AsyncRunWhenCompleted(
+ base::Bind(&GLES2DecoderImpl::AsyncUploadCompleted,
+ base::Unretained(this),
+ async_token));
+}
+
// Decode command with its arguments, and call the corresponding GL function.
// Note: args is a pointer to the command buffer. As such, it could be changed
// by a (malicious) client at any time, so if validation has to happen, it

Powered by Google App Engine
This is Rietveld 408576698