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

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

Issue 12040049: gpu: Implement idle async pixel transfers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add DCHECKs to ensure idle async uploads are only used with GL_TEXTURE_2D target Created 7 years, 9 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/service/gles2_cmd_decoder.h ('k') | gpu/command_buffer/service/gles2_cmd_decoder_mock.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5e3bea65d6b8fbcb2c6fa1efd37be785e09e8bcb..5fcc8d2620428557b9c1e3fadba7f60e7a8f33ec 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -635,6 +635,8 @@ class GLES2DecoderImpl : public GLES2Decoder {
return vertex_array_manager_.get();
}
virtual bool ProcessPendingQueries() OVERRIDE;
+ virtual bool HasMoreIdleWork() OVERRIDE;
+ virtual void PerformIdleWork() OVERRIDE;
virtual void SetResizeCallback(
const base::Callback<void(gfx::Size)>& callback) OVERRIDE;
@@ -2874,6 +2876,8 @@ void GLES2DecoderImpl::ProcessFinishedAsyncTransfers() {
// from the client, as the client may have recieved an async
// completion while issuing those commands.
// "DidFlushStart" would be ideal if we had such a callback.
+ // TODO(reveman): We should avoid using a bool return value to determine
+ // if we need to restore some state. crbug.com/196303
if (async_pixel_transfer_delegate_->BindCompletedAsyncTransfers())
RestoreCurrentTexture2DBindings();
}
@@ -9289,6 +9293,20 @@ bool GLES2DecoderImpl::ProcessPendingQueries() {
return query_manager_->HavePendingQueries();
}
+bool GLES2DecoderImpl::HasMoreIdleWork() {
+ return async_pixel_transfer_delegate_->NeedsProcessMorePendingTransfers();
+}
+
+void GLES2DecoderImpl::PerformIdleWork() {
+ if (!async_pixel_transfer_delegate_->NeedsProcessMorePendingTransfers())
+ return;
+ // TODO(reveman): We should avoid using a bool return value to determine
+ // if we need to restore some state. crbug.com/196303
+ if (async_pixel_transfer_delegate_->ProcessMorePendingTransfers())
+ RestoreCurrentTexture2DBindings();
+ ProcessFinishedAsyncTransfers();
+}
+
error::Error GLES2DecoderImpl::HandleBeginQueryEXT(
uint32 immediate_data_size, const cmds::BeginQueryEXT& c) {
GLenum target = static_cast<GLenum>(c.target);
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.h ('k') | gpu/command_buffer/service/gles2_cmd_decoder_mock.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698