OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef GPU_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_MANAGER_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_MANAGER_H_ |
6 #define GPU_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_MANAGER_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_MANAGER_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 // this to avoid blocking the caller thread inappropriately. | 66 // this to avoid blocking the caller thread inappropriately. |
67 virtual void ProcessMorePendingTransfers() = 0; | 67 virtual void ProcessMorePendingTransfers() = 0; |
68 virtual bool NeedsProcessMorePendingTransfers() = 0; | 68 virtual bool NeedsProcessMorePendingTransfers() = 0; |
69 | 69 |
70 // Wait for all AsyncTex(Sub)Image2D uploads to finish before returning. | 70 // Wait for all AsyncTex(Sub)Image2D uploads to finish before returning. |
71 virtual void WaitAllAsyncTexImage2D() = 0; | 71 virtual void WaitAllAsyncTexImage2D() = 0; |
72 | 72 |
73 AsyncPixelTransferDelegate* CreatePixelTransferDelegate( | 73 AsyncPixelTransferDelegate* CreatePixelTransferDelegate( |
74 gles2::TextureRef* ref, | 74 gles2::TextureRef* ref, |
75 const AsyncTexImage2DParams& define_params); | 75 const AsyncTexImage2DParams& define_params); |
| 76 AsyncPixelTransferDelegate* CreatePixelTransferDelegate( |
| 77 gles2::TextureRef* ref, |
| 78 const AsyncCompressedTexImage2DParams& define_params); |
76 | 79 |
77 AsyncPixelTransferDelegate* GetPixelTransferDelegate( | 80 AsyncPixelTransferDelegate* GetPixelTransferDelegate( |
78 gles2::TextureRef* ref); | 81 gles2::TextureRef* ref); |
79 | 82 |
80 void ClearPixelTransferDelegateForTest(gles2::TextureRef* ref); | 83 void ClearPixelTransferDelegateForTest(gles2::TextureRef* ref); |
81 | 84 |
82 bool AsyncTransferIsInProgress(gles2::TextureRef* ref); | 85 bool AsyncTransferIsInProgress(gles2::TextureRef* ref); |
83 | 86 |
84 // gles2::TextureRef::DestructionObserver implementation: | 87 // gles2::TextureRef::DestructionObserver implementation: |
85 void OnTextureManagerDestroying(gles2::TextureManager* manager) override; | 88 void OnTextureManagerDestroying(gles2::TextureManager* manager) override; |
86 void OnTextureRefDestroying(gles2::TextureRef* texture) override; | 89 void OnTextureRefDestroying(gles2::TextureRef* texture) override; |
87 | 90 |
88 protected: | 91 protected: |
89 AsyncPixelTransferManager(); | 92 AsyncPixelTransferManager(); |
90 | 93 |
91 private: | 94 private: |
92 gles2::TextureManager* manager_; | 95 gles2::TextureManager* manager_; |
93 | 96 |
94 typedef base::hash_map<gles2::TextureRef*, | 97 typedef base::hash_map<gles2::TextureRef*, |
95 linked_ptr<AsyncPixelTransferDelegate> > | 98 linked_ptr<AsyncPixelTransferDelegate> > |
96 TextureToDelegateMap; | 99 TextureToDelegateMap; |
97 TextureToDelegateMap delegate_map_; | 100 TextureToDelegateMap delegate_map_; |
98 | 101 |
99 // A factory method called by CreatePixelTransferDelegate that is overriden | 102 // A factory method called by CreatePixelTransferDelegate that is overriden |
100 // by each implementation. | 103 // by each implementation. |
101 virtual AsyncPixelTransferDelegate* CreatePixelTransferDelegateImpl( | 104 virtual AsyncPixelTransferDelegate* CreatePixelTransferDelegateImpl( |
102 gles2::TextureRef* ref, | 105 gles2::TextureRef* ref, |
103 const AsyncTexImage2DParams& define_params) = 0; | 106 const AsyncTexImage2DParams& define_params) = 0; |
| 107 virtual AsyncPixelTransferDelegate* CreatePixelTransferDelegateImpl( |
| 108 gles2::TextureRef* ref, |
| 109 const AsyncCompressedTexImage2DParams& define_params) = 0; |
104 | 110 |
105 DISALLOW_COPY_AND_ASSIGN(AsyncPixelTransferManager); | 111 DISALLOW_COPY_AND_ASSIGN(AsyncPixelTransferManager); |
106 }; | 112 }; |
107 | 113 |
108 } // namespace gpu | 114 } // namespace gpu |
109 | 115 |
110 #endif // GPU_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_MANAGER_H_ | 116 #endif // GPU_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_MANAGER_H_ |
OLD | NEW |