Index: gpu/command_buffer/service/texture_manager.h |
diff --git a/gpu/command_buffer/service/texture_manager.h b/gpu/command_buffer/service/texture_manager.h |
index f2e7963e7cf3e4204c66aa4037adbc5c7d0ac9f9..fca514ca357fe72b795119bcdc2951df8f1b69fa 100644 |
--- a/gpu/command_buffer/service/texture_manager.h |
+++ b/gpu/command_buffer/service/texture_manager.h |
@@ -14,6 +14,7 @@ |
#include "gpu/command_buffer/service/feature_info.h" |
#include "gpu/command_buffer/service/gl_utils.h" |
#include "gpu/gpu_export.h" |
+#include "ui/gl/async_pixel_transfer_delegate.h" |
#include "ui/gl/gl_image.h" |
namespace gpu { |
@@ -175,6 +176,23 @@ class GPU_EXPORT TextureManager { |
return stream_texture_; |
} |
+ gfx::AsyncPixelTransferState* GetAsyncTransferState() const { |
+ return async_transfer_state_.get(); |
+ } |
+ void SetAsyncTransferState(gfx::AsyncPixelTransferState* state) { |
+ async_transfer_state_ = state; |
+ } |
+ bool AsyncTransferIsInProgress() { |
+ return async_transfer_state_ |
greggman
2012/12/12 03:51:36
style: operators want to be at the end of the line
epennerAtGoogle
2012/12/12 04:49:49
Done.
|
+ && async_transfer_state_->TransferIsInProgress(); |
+ } |
+ bool BindAsyncTransferToTexture(GLenum target) { |
+ DCHECK(async_transfer_state_); |
greggman
2012/12/12 03:51:36
It seems like this DCHECK is in conflict with the
epennerAtGoogle
2012/12/12 04:49:49
Done.
|
+ if (async_transfer_state_) |
+ return async_transfer_state_->BindAsyncTransferToTexture(target); |
+ return false; |
+ } |
+ |
void SetImmutable(bool immutable) { |
immutable_ = immutable; |
} |
@@ -337,6 +355,9 @@ class GPU_EXPORT TextureManager { |
// Whether this is a special streaming texture. |
bool stream_texture_; |
+ // State to facilitate async transfers on this texture. |
+ scoped_refptr<gfx::AsyncPixelTransferState> async_transfer_state_; |
+ |
// Whether the texture is immutable and no further changes to the format |
// or dimensions of the texture object can be made. |
bool immutable_; |