 Chromium Code Reviews
 Chromium Code Reviews Issue 12040049:
  gpu: Implement idle async pixel transfers.  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/src
    
  
    Issue 12040049:
  gpu: Implement idle async pixel transfers.  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/src| OLD | NEW | 
|---|---|
| 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 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" | 
| 6 | 6 | 
| 7 #include <stdio.h> | 7 #include <stdio.h> | 
| 8 | 8 | 
| 9 #include <algorithm> | 9 #include <algorithm> | 
| 10 #include <list> | 10 #include <list> | 
| (...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 565 virtual void RestoreFramebufferBindings() const OVERRIDE; | 565 virtual void RestoreFramebufferBindings() const OVERRIDE; | 
| 566 virtual void RestoreTextureState(unsigned service_id) const OVERRIDE; | 566 virtual void RestoreTextureState(unsigned service_id) const OVERRIDE; | 
| 567 | 567 | 
| 568 virtual QueryManager* GetQueryManager() OVERRIDE { | 568 virtual QueryManager* GetQueryManager() OVERRIDE { | 
| 569 return query_manager_.get(); | 569 return query_manager_.get(); | 
| 570 } | 570 } | 
| 571 virtual VertexArrayManager* GetVertexArrayManager() OVERRIDE { | 571 virtual VertexArrayManager* GetVertexArrayManager() OVERRIDE { | 
| 572 return vertex_array_manager_.get(); | 572 return vertex_array_manager_.get(); | 
| 573 } | 573 } | 
| 574 virtual bool ProcessPendingQueries() OVERRIDE; | 574 virtual bool ProcessPendingQueries() OVERRIDE; | 
| 575 virtual bool HasMoreWork() OVERRIDE; | |
| 576 virtual bool PerformIdleWork() OVERRIDE; | |
| 575 | 577 | 
| 576 virtual void SetResizeCallback( | 578 virtual void SetResizeCallback( | 
| 577 const base::Callback<void(gfx::Size)>& callback) OVERRIDE; | 579 const base::Callback<void(gfx::Size)>& callback) OVERRIDE; | 
| 578 | 580 | 
| 579 virtual void SetMsgCallback(const MsgCallback& callback) OVERRIDE; | 581 virtual void SetMsgCallback(const MsgCallback& callback) OVERRIDE; | 
| 580 virtual void SetWaitSyncPointCallback( | 582 virtual void SetWaitSyncPointCallback( | 
| 581 const WaitSyncPointCallback& callback) OVERRIDE; | 583 const WaitSyncPointCallback& callback) OVERRIDE; | 
| 582 | 584 | 
| 583 virtual void SetStreamTextureManager(StreamTextureManager* manager) OVERRIDE; | 585 virtual void SetStreamTextureManager(StreamTextureManager* manager) OVERRIDE; | 
| 584 | 586 | 
| (...skipping 8502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 9087 bool GLES2DecoderImpl::ProcessPendingQueries() { | 9089 bool GLES2DecoderImpl::ProcessPendingQueries() { | 
| 9088 if (query_manager_.get() == NULL) { | 9090 if (query_manager_.get() == NULL) { | 
| 9089 return false; | 9091 return false; | 
| 9090 } | 9092 } | 
| 9091 if (!query_manager_->ProcessPendingQueries()) { | 9093 if (!query_manager_->ProcessPendingQueries()) { | 
| 9092 current_decoder_error_ = error::kOutOfBounds; | 9094 current_decoder_error_ = error::kOutOfBounds; | 
| 9093 } | 9095 } | 
| 9094 return query_manager_->HavePendingQueries(); | 9096 return query_manager_->HavePendingQueries(); | 
| 9095 } | 9097 } | 
| 9096 | 9098 | 
| 9099 bool GLES2DecoderImpl::HasMoreWork() { | |
| 9100 return ProcessPendingQueries() || | |
| 9101 async_pixel_transfer_delegate_->HasPendingTransfers(); | |
| 9102 } | |
| 9103 | |
| 9104 bool GLES2DecoderImpl::PerformIdleWork() { | |
| 9105 async_pixel_transfer_delegate_->ProcessPendingTransfers(); | |
| 9106 RestoreCurrentTexture2DBindings(); | |
| 
Sami
2013/03/07 16:57:19
Maybe only restore the bindings only if we actuall
 
reveman
2013/03/07 20:21:04
Done.
 | |
| 9107 return async_pixel_transfer_delegate_->HasPendingTransfers(); | |
| 9108 } | |
| 9109 | |
| 9097 error::Error GLES2DecoderImpl::HandleBeginQueryEXT( | 9110 error::Error GLES2DecoderImpl::HandleBeginQueryEXT( | 
| 9098 uint32 immediate_data_size, const cmds::BeginQueryEXT& c) { | 9111 uint32 immediate_data_size, const cmds::BeginQueryEXT& c) { | 
| 9099 GLenum target = static_cast<GLenum>(c.target); | 9112 GLenum target = static_cast<GLenum>(c.target); | 
| 9100 GLuint client_id = static_cast<GLuint>(c.id); | 9113 GLuint client_id = static_cast<GLuint>(c.id); | 
| 9101 int32 sync_shm_id = static_cast<int32>(c.sync_data_shm_id); | 9114 int32 sync_shm_id = static_cast<int32>(c.sync_data_shm_id); | 
| 9102 uint32 sync_shm_offset = static_cast<uint32>(c.sync_data_shm_offset); | 9115 uint32 sync_shm_offset = static_cast<uint32>(c.sync_data_shm_offset); | 
| 9103 | 9116 | 
| 9104 switch (target) { | 9117 switch (target) { | 
| 9105 case GL_COMMANDS_ISSUED_CHROMIUM: | 9118 case GL_COMMANDS_ISSUED_CHROMIUM: | 
| 9106 case GL_LATENCY_QUERY_CHROMIUM: | 9119 case GL_LATENCY_QUERY_CHROMIUM: | 
| (...skipping 1044 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 10151 return error::kNoError; | 10164 return error::kNoError; | 
| 10152 } | 10165 } | 
| 10153 | 10166 | 
| 10154 // Include the auto-generated part of this file. We split this because it means | 10167 // Include the auto-generated part of this file. We split this because it means | 
| 10155 // we can easily edit the non-auto generated parts right here in this file | 10168 // we can easily edit the non-auto generated parts right here in this file | 
| 10156 // instead of having to edit some template or the code generator. | 10169 // instead of having to edit some template or the code generator. | 
| 10157 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 10170 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 
| 10158 | 10171 | 
| 10159 } // namespace gles2 | 10172 } // namespace gles2 | 
| 10160 } // namespace gpu | 10173 } // namespace gpu | 
| OLD | NEW |