OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 UI_GL_ASYNC_TASK_DELEGATE_H_ | 5 #ifndef UI_GL_ASYNC_TASK_DELEGATE_H_ |
6 #define UI_GL_ASYNC_TASK_DELEGATE_H_ | 6 #define UI_GL_ASYNC_TASK_DELEGATE_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 const AsyncTexSubImage2DParams& tex_params, | 106 const AsyncTexSubImage2DParams& tex_params, |
107 const AsyncMemoryParams& mem_params) = 0; | 107 const AsyncMemoryParams& mem_params) = 0; |
108 | 108 |
109 // Block until the specified transfer completes. | 109 // Block until the specified transfer completes. |
110 virtual void WaitForTransferCompletion( | 110 virtual void WaitForTransferCompletion( |
111 AsyncPixelTransferState* state) = 0; | 111 AsyncPixelTransferState* state) = 0; |
112 | 112 |
113 virtual uint32 GetTextureUploadCount() = 0; | 113 virtual uint32 GetTextureUploadCount() = 0; |
114 virtual base::TimeDelta GetTotalTextureUploadTime() = 0; | 114 virtual base::TimeDelta GetTotalTextureUploadTime() = 0; |
115 | 115 |
| 116 // ProcessPendingTransfers() will be called at a good time |
| 117 // to process a small amount of pending transfer work while |
| 118 // CanProcessPendingTransfers() returns true. Implementations |
| 119 // that can't dispatch work to separate threads should use |
| 120 // this to avoid blocking the caller thread inappropriately. |
| 121 virtual void ProcessPendingTransfers() = 0; |
| 122 virtual bool CanProcessPendingTransfers() = 0; |
| 123 |
116 protected: | 124 protected: |
117 AsyncPixelTransferDelegate() {} | 125 AsyncPixelTransferDelegate() {} |
118 // For testing, as returning scoped_ptr wouldn't work with MOCK_METHOD. | 126 // For testing, as returning scoped_ptr wouldn't work with MOCK_METHOD. |
119 virtual AsyncPixelTransferState* | 127 virtual AsyncPixelTransferState* |
120 CreateRawPixelTransferState(GLuint texture_id) = 0; | 128 CreateRawPixelTransferState(GLuint texture_id) = 0; |
121 | 129 |
122 private: | 130 private: |
123 DISALLOW_COPY_AND_ASSIGN(AsyncPixelTransferDelegate); | 131 DISALLOW_COPY_AND_ASSIGN(AsyncPixelTransferDelegate); |
124 }; | 132 }; |
125 | 133 |
126 } // namespace gfx | 134 } // namespace gfx |
127 | 135 |
128 #endif // UI_GL_ASYNC_TASK_DELEGATE_H_ | 136 #endif // UI_GL_ASYNC_TASK_DELEGATE_H_ |
129 | 137 |
OLD | NEW |