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 ed4c8c9ec02254113648115bbf9c9d5be8fa5cea..a20322cb61c919fc6ba5a45a25ed4fa3e4375e1d 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,30 @@ class GPU_EXPORT TextureManager { |
return stream_texture_; |
} |
+ bool IsAsyncTransferTexture() { |
+ return !!async_transfer_state_; |
+ } |
+ |
+ bool AsyncTransferIsInProgress() { |
+ return async_transfer_state_ |
+ && async_transfer_state_->TransferIsInProgress(); |
+ } |
+ |
+ void BindAsyncTransferTexture(GLenum target) { |
+ DCHECK(async_transfer_state_); |
+ if (async_transfer_state_) |
+ async_transfer_state_->BindTexture(target); |
+ } |
+ |
+ gfx::AsyncPixelTransferState* AsyncTransferState() { |
+ DCHECK(service_id_ != 0); |
+ if (!async_transfer_state_) |
apatrick_chromium
2012/12/04 20:59:22
nit: chromium style is to use braces for body of i
epennerAtGoogle
2012/12/06 06:23:21
Done.
|
+ async_transfer_state_ = |
+ gfx::AsyncPixelTransferDelegate::Get()-> |
+ CreatePixelTransferState(service_id_); |
+ return async_transfer_state_.get(); |
+ } |
+ |
void SetImmutable(bool immutable) { |
immutable_ = immutable; |
} |
@@ -337,6 +362,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_; |