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

Unified Diff: gpu/command_buffer/service/async_pixel_transfer_manager.h

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/async_pixel_transfer_manager.h
diff --git a/gpu/command_buffer/service/async_pixel_transfer_manager.h b/gpu/command_buffer/service/async_pixel_transfer_manager.h
index 9dc9c67922ddf1a574d182c01112788f8321d40b..1d8786df6f9e5aa4780340aec45402bcaee8b34f 100644
--- a/gpu/command_buffer/service/async_pixel_transfer_manager.h
+++ b/gpu/command_buffer/service/async_pixel_transfer_manager.h
@@ -10,7 +10,7 @@
#include "base/basictypes.h"
#include "base/callback.h"
#include "base/containers/hash_tables.h"
-#include "base/memory/ref_counted.h"
+#include "base/memory/linked_ptr.h"
#include "gpu/command_buffer/service/texture_manager.h"
#include "gpu/gpu_export.h"
@@ -31,7 +31,6 @@ class GLContext;
namespace gpu {
class AsyncPixelTransferDelegate;
-class AsyncPixelTransferState;
struct AsyncMemoryParams;
struct AsyncTexImage2DParams;
@@ -64,16 +63,14 @@ class GPU_EXPORT AsyncPixelTransferManager
virtual void ProcessMorePendingTransfers() = 0;
virtual bool NeedsProcessMorePendingTransfers() = 0;
- virtual AsyncPixelTransferDelegate* GetAsyncPixelTransferDelegate() = 0;
-
- AsyncPixelTransferState* CreatePixelTransferState(
+ AsyncPixelTransferDelegate* CreatePixelTransferDelegate(
gles2::TextureRef* ref,
const AsyncTexImage2DParams& define_params);
- AsyncPixelTransferState* GetPixelTransferState(
+ AsyncPixelTransferDelegate* GetPixelTransferDelegate(
gles2::TextureRef* ref);
- void ClearPixelTransferStateForTest(gles2::TextureRef* ref);
+ void ClearPixelTransferDelegateForTest(gles2::TextureRef* ref);
bool AsyncTransferIsInProgress(gles2::TextureRef* ref);
@@ -89,9 +86,15 @@ class GPU_EXPORT AsyncPixelTransferManager
gles2::TextureManager* manager_;
typedef base::hash_map<gles2::TextureRef*,
- scoped_refptr<AsyncPixelTransferState> >
- TextureToStateMap;
- TextureToStateMap state_map_;
+ linked_ptr<AsyncPixelTransferDelegate> >
+ TextureToDelegateMap;
+ TextureToDelegateMap delegate_map_;
+
+ // A factory method called by CreatePixelTransferDelegate that is overriden
+ // by each implementation.
+ virtual AsyncPixelTransferDelegate* CreatePixelTransferDelegateImpl(
+ gles2::TextureRef* ref,
+ const AsyncTexImage2DParams& define_params) = 0;
DISALLOW_COPY_AND_ASSIGN(AsyncPixelTransferManager);
};

Powered by Google App Engine
This is Rietveld 408576698