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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
55 : public gles2::TextureManager::DestructionObserver { | 55 : public gles2::TextureManager::DestructionObserver { |
56 public: | 56 public: |
57 static AsyncPixelTransferManager* Create(gfx::GLContext* context); | 57 static AsyncPixelTransferManager* Create(gfx::GLContext* context); |
58 | 58 |
59 virtual ~AsyncPixelTransferManager(); | 59 virtual ~AsyncPixelTransferManager(); |
60 | 60 |
61 void Initialize(gles2::TextureManager* texture_manager); | 61 void Initialize(gles2::TextureManager* texture_manager); |
62 | 62 |
63 virtual void BindCompletedAsyncTransfers() = 0; | 63 virtual void BindCompletedAsyncTransfers() = 0; |
64 | 64 |
65 // Run the given callback when all already queued tasks has been processed. | |
66 // This includes asynchronous upload tasks. | |
piman
2014/02/07 22:58:20
I'm not the biggest fan of this pattern, because i
jadahl
2014/02/08 09:18:25
Sounds reasonable to pass the callback to AsyncTex
jadahl
2014/02/09 11:54:52
Reconsidering this, I think we still need somethin
| |
67 virtual void AsyncRun(const base::Closure& callback) = 0; | |
epennerAtGoogle
2014/02/07 20:43:58
This leads to duplicate work happening here where
jadahl
2014/02/08 09:18:25
I'm thinking, can't we just handle those queries c
| |
68 | |
65 // There's no guarantee that callback will run on the caller thread. | 69 // There's no guarantee that callback will run on the caller thread. |
66 virtual void AsyncNotifyCompletion( | 70 virtual void AsyncNotifyCompletion( |
67 const AsyncMemoryParams& mem_params, | 71 const AsyncMemoryParams& mem_params, |
68 AsyncPixelTransferCompletionObserver* observer) = 0; | 72 AsyncPixelTransferCompletionObserver* observer) = 0; |
69 | 73 |
70 virtual uint32 GetTextureUploadCount() = 0; | 74 virtual uint32 GetTextureUploadCount() = 0; |
71 virtual base::TimeDelta GetTotalTextureUploadTime() = 0; | 75 virtual base::TimeDelta GetTotalTextureUploadTime() = 0; |
72 | 76 |
73 // ProcessMorePendingTransfers() will be called at a good time | 77 // ProcessMorePendingTransfers() will be called at a good time |
74 // to process a small amount of pending transfer work while | 78 // to process a small amount of pending transfer work while |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
110 virtual AsyncPixelTransferDelegate* CreatePixelTransferDelegateImpl( | 114 virtual AsyncPixelTransferDelegate* CreatePixelTransferDelegateImpl( |
111 gles2::TextureRef* ref, | 115 gles2::TextureRef* ref, |
112 const AsyncTexImage2DParams& define_params) = 0; | 116 const AsyncTexImage2DParams& define_params) = 0; |
113 | 117 |
114 DISALLOW_COPY_AND_ASSIGN(AsyncPixelTransferManager); | 118 DISALLOW_COPY_AND_ASSIGN(AsyncPixelTransferManager); |
115 }; | 119 }; |
116 | 120 |
117 } // namespace gpu | 121 } // namespace gpu |
118 | 122 |
119 #endif // GPU_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_MANAGER_H_ | 123 #endif // GPU_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_MANAGER_H_ |
OLD | NEW |