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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 const AsyncTexSubImage2DParams& tex_params, | 105 const AsyncTexSubImage2DParams& tex_params, |
106 const AsyncMemoryParams& mem_params) = 0; | 106 const AsyncMemoryParams& mem_params) = 0; |
107 | 107 |
108 // Block until the specified transfer completes. | 108 // Block until the specified transfer completes. |
109 virtual void WaitForTransferCompletion( | 109 virtual void WaitForTransferCompletion( |
110 AsyncPixelTransferState* state) = 0; | 110 AsyncPixelTransferState* state) = 0; |
111 | 111 |
112 virtual uint32 GetTextureUploadCount() = 0; | 112 virtual uint32 GetTextureUploadCount() = 0; |
113 virtual base::TimeDelta GetTotalTextureUploadTime() = 0; | 113 virtual base::TimeDelta GetTotalTextureUploadTime() = 0; |
114 | 114 |
| 115 // ProcessMorePendingTransfers() will be called at a good time |
| 116 // to process a small amount of pending transfer work while |
| 117 // NeedsProcessMorePendingTransfers() returns true. Implementations |
| 118 // that can't dispatch work to separate threads should use |
| 119 // this to avoid blocking the caller thread inappropriately. |
| 120 // ProcessMorePendingTransfers() returns true iff a texture was |
| 121 // bound to texture-unit zero. |
| 122 virtual bool ProcessMorePendingTransfers() = 0; |
| 123 virtual bool NeedsProcessMorePendingTransfers() = 0; |
| 124 |
115 protected: | 125 protected: |
116 AsyncPixelTransferDelegate() {} | 126 AsyncPixelTransferDelegate() {} |
117 // For testing, as returning scoped_ptr wouldn't work with MOCK_METHOD. | 127 // For testing, as returning scoped_ptr wouldn't work with MOCK_METHOD. |
118 virtual AsyncPixelTransferState* | 128 virtual AsyncPixelTransferState* |
119 CreateRawPixelTransferState(GLuint tex_id, | 129 CreateRawPixelTransferState(GLuint tex_id, |
120 const AsyncTexImage2DParams& define_params) = 0; | 130 const AsyncTexImage2DParams& define_params) = 0; |
121 | 131 |
122 private: | 132 private: |
123 DISALLOW_COPY_AND_ASSIGN(AsyncPixelTransferDelegate); | 133 DISALLOW_COPY_AND_ASSIGN(AsyncPixelTransferDelegate); |
124 }; | 134 }; |
125 | 135 |
126 } // namespace gfx | 136 } // namespace gfx |
127 | 137 |
128 #endif // UI_GL_ASYNC_TASK_DELEGATE_H_ | 138 #endif // UI_GL_ASYNC_TASK_DELEGATE_H_ |
129 | 139 |
OLD | NEW |