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

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

Issue 16175005: GPU: Replace AsyncPixelTransferState with AsyncPixelTransferDelegate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 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
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 8ce9a6241ed8218effacc8e4829dda3729b2922d..9cc4cea957e04e36748cbc41bf584e8af73eedd2 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -575,8 +575,6 @@ class GLES2DecoderImpl : public GLES2Decoder {
virtual void SetStreamTextureManager(StreamTextureManager* manager) OVERRIDE;
- virtual AsyncPixelTransferDelegate*
- GetAsyncPixelTransferDelegate() OVERRIDE;
virtual AsyncPixelTransferManager*
GetAsyncPixelTransferManager() OVERRIDE;
virtual void ResetAsyncPixelTransferManagerForTest() OVERRIDE;
@@ -3048,11 +3046,6 @@ void GLES2DecoderImpl::SetStreamTextureManager(StreamTextureManager* manager) {
stream_texture_manager_ = manager;
}
-AsyncPixelTransferDelegate*
- GLES2DecoderImpl::GetAsyncPixelTransferDelegate() {
- return async_pixel_transfer_manager_->GetAsyncPixelTransferDelegate();
-}
-
AsyncPixelTransferManager*
GLES2DecoderImpl::GetAsyncPixelTransferManager() {
return async_pixel_transfer_manager_.get();
@@ -10181,13 +10174,12 @@ error::Error GLES2DecoderImpl::HandleAsyncTexImage2DCHROMIUM(
// Set up the async state if needed, and make the texture
// immutable so the async state stays valid. The level info
// is set up lazily when the transfer completes.
- AsyncPixelTransferState* state =
- async_pixel_transfer_manager_->CreatePixelTransferState(texture_ref,
- tex_params);
+ AsyncPixelTransferDelegate* delegate =
+ async_pixel_transfer_manager_->CreatePixelTransferDelegate(texture_ref,
+ tex_params);
texture->SetImmutable(true);
- GetAsyncPixelTransferDelegate()->AsyncTexImage2D(
- state,
+ delegate->AsyncTexImage2D(
tex_params,
mem_params,
base::Bind(&TextureManager::SetLevelInfoFromParams,
@@ -10266,9 +10258,9 @@ error::Error GLES2DecoderImpl::HandleAsyncTexSubImage2DCHROMIUM(
width, height, format, type};
AsyncMemoryParams mem_params = {shared_memory, shm_size,
shm_data_offset, shm_data_size};
- AsyncPixelTransferState* state =
- async_pixel_transfer_manager_->GetPixelTransferState(texture_ref);
- if (!state) {
+ AsyncPixelTransferDelegate* delegate =
+ async_pixel_transfer_manager_->GetPixelTransferDelegate(texture_ref);
+ if (!delegate) {
// TODO(epenner): We may want to enforce exclusive use
// of async APIs in which case this should become an error,
// (the texture should have been async defined).
@@ -10280,13 +10272,12 @@ error::Error GLES2DecoderImpl::HandleAsyncTexSubImage2DCHROMIUM(
&define_params.internal_format);
// Set up the async state if needed, and make the texture
// immutable so the async state stays valid.
- state = async_pixel_transfer_manager_->CreatePixelTransferState(
+ delegate = async_pixel_transfer_manager_->CreatePixelTransferDelegate(
texture_ref, define_params);
texture->SetImmutable(true);
}
- GetAsyncPixelTransferDelegate()->AsyncTexSubImage2D(
- state, tex_params, mem_params);
+ delegate->AsyncTexSubImage2D(tex_params, mem_params);
return error::kNoError;
}
@@ -10307,15 +10298,15 @@ error::Error GLES2DecoderImpl::HandleWaitAsyncTexImage2DCHROMIUM(
"glWaitAsyncTexImage2DCHROMIUM", "unknown texture");
return error::kNoError;
}
- AsyncPixelTransferState* state =
- async_pixel_transfer_manager_->GetPixelTransferState(texture_ref);
- if (!state) {
+ AsyncPixelTransferDelegate* delegate =
+ async_pixel_transfer_manager_->GetPixelTransferDelegate(texture_ref);
+ if (!delegate) {
LOCAL_SET_GL_ERROR(
GL_INVALID_OPERATION,
"glWaitAsyncTexImage2DCHROMIUM", "No async transfer started");
return error::kNoError;
}
- GetAsyncPixelTransferDelegate()->WaitForTransferCompletion(state);
+ delegate->WaitForTransferCompletion();
ProcessFinishedAsyncTransfers();
return error::kNoError;
}
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.h ('k') | gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698