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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 scoped_ptr<AsyncPixelTransferState> | 89 scoped_ptr<AsyncPixelTransferState> |
90 CreatePixelTransferState(GLuint texture_id) { | 90 CreatePixelTransferState(GLuint texture_id) { |
91 return make_scoped_ptr(CreateRawPixelTransferState(texture_id)); | 91 return make_scoped_ptr(CreateRawPixelTransferState(texture_id)); |
92 } | 92 } |
93 | 93 |
94 // There's no guarantee that callback will run on the caller thread. | 94 // There's no guarantee that callback will run on the caller thread. |
95 virtual void AsyncNotifyCompletion( | 95 virtual void AsyncNotifyCompletion( |
96 const AsyncMemoryParams& mem_params, | 96 const AsyncMemoryParams& mem_params, |
97 const CompletionCallback& callback) = 0; | 97 const CompletionCallback& callback) = 0; |
98 | 98 |
| 99 // Wait on all previous uploads completing. |
| 100 virtual void WaitOnUploadCompletion() = 0; |
| 101 |
99 virtual void AsyncTexImage2D( | 102 virtual void AsyncTexImage2D( |
100 AsyncPixelTransferState* state, | 103 AsyncPixelTransferState* state, |
101 const AsyncTexImage2DParams& tex_params, | 104 const AsyncTexImage2DParams& tex_params, |
102 const AsyncMemoryParams& mem_params) = 0; | 105 const AsyncMemoryParams& mem_params) = 0; |
103 | 106 |
104 virtual void AsyncTexSubImage2D( | 107 virtual void AsyncTexSubImage2D( |
105 AsyncPixelTransferState* state, | 108 AsyncPixelTransferState* state, |
106 const AsyncTexSubImage2DParams& tex_params, | 109 const AsyncTexSubImage2DParams& tex_params, |
107 const AsyncMemoryParams& mem_params) = 0; | 110 const AsyncMemoryParams& mem_params) = 0; |
108 | 111 |
109 virtual uint32 GetTextureUploadCount() = 0; | 112 virtual uint32 GetTextureUploadCount() = 0; |
110 virtual base::TimeDelta GetTotalTextureUploadTime() = 0; | 113 virtual base::TimeDelta GetTotalTextureUploadTime() = 0; |
111 | 114 |
112 protected: | 115 protected: |
113 AsyncPixelTransferDelegate() {} | 116 AsyncPixelTransferDelegate() {} |
114 // For testing, as returning scoped_ptr wouldn't work with MOCK_METHOD. | 117 // For testing, as returning scoped_ptr wouldn't work with MOCK_METHOD. |
115 virtual AsyncPixelTransferState* | 118 virtual AsyncPixelTransferState* |
116 CreateRawPixelTransferState(GLuint texture_id) = 0; | 119 CreateRawPixelTransferState(GLuint texture_id) = 0; |
117 | 120 |
118 private: | 121 private: |
119 DISALLOW_COPY_AND_ASSIGN(AsyncPixelTransferDelegate); | 122 DISALLOW_COPY_AND_ASSIGN(AsyncPixelTransferDelegate); |
120 }; | 123 }; |
121 | 124 |
122 } // namespace gfx | 125 } // namespace gfx |
123 | 126 |
124 #endif // UI_GL_ASYNC_TASK_DELEGATE_H_ | 127 #endif // UI_GL_ASYNC_TASK_DELEGATE_H_ |
125 | 128 |
OLD | NEW |