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

Side by Side 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: Address review feedback and make BindFinishedAsyncPixelTransfers() handle out of order async upload… 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 unified diff | Download patch | Annotate | Revision Log
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 #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 555 matching lines...) Expand 10 before | Expand all | Expand 10 after
566 virtual void RestoreFramebufferBindings() const OVERRIDE; 566 virtual void RestoreFramebufferBindings() const OVERRIDE;
567 virtual void RestoreTextureState(unsigned service_id) const OVERRIDE; 567 virtual void RestoreTextureState(unsigned service_id) const OVERRIDE;
568 568
569 virtual QueryManager* GetQueryManager() OVERRIDE { 569 virtual QueryManager* GetQueryManager() OVERRIDE {
570 return query_manager_.get(); 570 return query_manager_.get();
571 } 571 }
572 virtual VertexArrayManager* GetVertexArrayManager() OVERRIDE { 572 virtual VertexArrayManager* GetVertexArrayManager() OVERRIDE {
573 return vertex_array_manager_.get(); 573 return vertex_array_manager_.get();
574 } 574 }
575 virtual bool ProcessPendingQueries() OVERRIDE; 575 virtual bool ProcessPendingQueries() OVERRIDE;
576 virtual bool HasMoreWork() OVERRIDE;
577 virtual bool PerformIdleWork() OVERRIDE;
576 578
577 virtual void SetResizeCallback( 579 virtual void SetResizeCallback(
578 const base::Callback<void(gfx::Size)>& callback) OVERRIDE; 580 const base::Callback<void(gfx::Size)>& callback) OVERRIDE;
579 581
580 virtual void SetMsgCallback(const MsgCallback& callback) OVERRIDE; 582 virtual void SetMsgCallback(const MsgCallback& callback) OVERRIDE;
581 virtual void SetWaitSyncPointCallback( 583 virtual void SetWaitSyncPointCallback(
582 const WaitSyncPointCallback& callback) OVERRIDE; 584 const WaitSyncPointCallback& callback) OVERRIDE;
583 585
584 virtual void SetStreamTextureManager(StreamTextureManager* manager) OVERRIDE; 586 virtual void SetStreamTextureManager(StreamTextureManager* manager) OVERRIDE;
585 587
(...skipping 8522 matching lines...) Expand 10 before | Expand all | Expand 10 after
9108 bool GLES2DecoderImpl::ProcessPendingQueries() { 9110 bool GLES2DecoderImpl::ProcessPendingQueries() {
9109 if (query_manager_.get() == NULL) { 9111 if (query_manager_.get() == NULL) {
9110 return false; 9112 return false;
9111 } 9113 }
9112 if (!query_manager_->ProcessPendingQueries()) { 9114 if (!query_manager_->ProcessPendingQueries()) {
9113 current_decoder_error_ = error::kOutOfBounds; 9115 current_decoder_error_ = error::kOutOfBounds;
9114 } 9116 }
9115 return query_manager_->HavePendingQueries(); 9117 return query_manager_->HavePendingQueries();
9116 } 9118 }
9117 9119
9120 bool GLES2DecoderImpl::HasMoreWork() {
9121 return ProcessPendingQueries() ||
9122 async_pixel_transfer_delegate_->CanProcessPendingTransfers();
9123 }
9124
9125 bool GLES2DecoderImpl::PerformIdleWork() {
9126 if (!async_pixel_transfer_delegate_->CanProcessPendingTransfers())
9127 return false;
9128 async_pixel_transfer_delegate_->ProcessPendingTransfers();
9129 RestoreCurrentTexture2DBindings();
greggman 2013/03/08 21:06:21 What do think about moving RestoreCurrentTexture2D
reveman 2013/03/12 00:31:42 Makes sense. The latest patch calls ProcessFinishe
9130 return async_pixel_transfer_delegate_->CanProcessPendingTransfers();
9131 }
9132
9118 error::Error GLES2DecoderImpl::HandleBeginQueryEXT( 9133 error::Error GLES2DecoderImpl::HandleBeginQueryEXT(
9119 uint32 immediate_data_size, const cmds::BeginQueryEXT& c) { 9134 uint32 immediate_data_size, const cmds::BeginQueryEXT& c) {
9120 GLenum target = static_cast<GLenum>(c.target); 9135 GLenum target = static_cast<GLenum>(c.target);
9121 GLuint client_id = static_cast<GLuint>(c.id); 9136 GLuint client_id = static_cast<GLuint>(c.id);
9122 int32 sync_shm_id = static_cast<int32>(c.sync_data_shm_id); 9137 int32 sync_shm_id = static_cast<int32>(c.sync_data_shm_id);
9123 uint32 sync_shm_offset = static_cast<uint32>(c.sync_data_shm_offset); 9138 uint32 sync_shm_offset = static_cast<uint32>(c.sync_data_shm_offset);
9124 9139
9125 switch (target) { 9140 switch (target) {
9126 case GL_COMMANDS_ISSUED_CHROMIUM: 9141 case GL_COMMANDS_ISSUED_CHROMIUM:
9127 case GL_LATENCY_QUERY_CHROMIUM: 9142 case GL_LATENCY_QUERY_CHROMIUM:
(...skipping 1044 matching lines...) Expand 10 before | Expand all | Expand 10 after
10172 return error::kNoError; 10187 return error::kNoError;
10173 } 10188 }
10174 10189
10175 // Include the auto-generated part of this file. We split this because it means 10190 // Include the auto-generated part of this file. We split this because it means
10176 // we can easily edit the non-auto generated parts right here in this file 10191 // we can easily edit the non-auto generated parts right here in this file
10177 // instead of having to edit some template or the code generator. 10192 // instead of having to edit some template or the code generator.
10178 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" 10193 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h"
10179 10194
10180 } // namespace gles2 10195 } // namespace gles2
10181 } // namespace gpu 10196 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698