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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 virtual ~AsyncPixelTransferDelegate() {} | 83 virtual ~AsyncPixelTransferDelegate() {} |
84 | 84 |
85 // This wouldn't work with MOCK_METHOD, so it routes through | 85 // This wouldn't work with MOCK_METHOD, so it routes through |
86 // a virtual protected version which returns a raw pointer. | 86 // a virtual protected version which returns a raw pointer. |
87 scoped_ptr<AsyncPixelTransferState> | 87 scoped_ptr<AsyncPixelTransferState> |
88 CreatePixelTransferState(GLuint texture_id) { | 88 CreatePixelTransferState(GLuint texture_id) { |
89 return make_scoped_ptr(CreateRawPixelTransferState(texture_id)); | 89 return make_scoped_ptr(CreateRawPixelTransferState(texture_id)); |
90 } | 90 } |
91 | 91 |
92 virtual void AsyncNotifyCompletion( | 92 virtual void AsyncNotifyCompletion( |
93 const base::Closure& notify_task) = 0; | 93 const AsyncMemoryParams& mem_params, |
| 94 uint32 submit_count) = 0; |
94 | 95 |
95 virtual void AsyncTexImage2D( | 96 virtual void AsyncTexImage2D( |
96 AsyncPixelTransferState* state, | 97 AsyncPixelTransferState* state, |
97 const AsyncTexImage2DParams& tex_params, | 98 const AsyncTexImage2DParams& tex_params, |
98 const AsyncMemoryParams& mem_params) = 0; | 99 const AsyncMemoryParams& mem_params) = 0; |
99 | 100 |
100 virtual void AsyncTexSubImage2D( | 101 virtual void AsyncTexSubImage2D( |
101 AsyncPixelTransferState* state, | 102 AsyncPixelTransferState* state, |
102 const AsyncTexSubImage2DParams& tex_params, | 103 const AsyncTexSubImage2DParams& tex_params, |
103 const AsyncMemoryParams& mem_params) = 0; | 104 const AsyncMemoryParams& mem_params) = 0; |
104 | 105 |
105 virtual uint32 GetTextureUploadCount() = 0; | 106 virtual uint32 GetTextureUploadCount() = 0; |
106 virtual base::TimeDelta GetTotalTextureUploadTime() = 0; | 107 virtual base::TimeDelta GetTotalTextureUploadTime() = 0; |
107 | 108 |
108 protected: | 109 protected: |
109 AsyncPixelTransferDelegate() {} | 110 AsyncPixelTransferDelegate() {} |
110 // For testing, as returning scoped_ptr wouldn't work with MOCK_METHOD. | 111 // For testing, as returning scoped_ptr wouldn't work with MOCK_METHOD. |
111 virtual AsyncPixelTransferState* | 112 virtual AsyncPixelTransferState* |
112 CreateRawPixelTransferState(GLuint texture_id) = 0; | 113 CreateRawPixelTransferState(GLuint texture_id) = 0; |
113 | 114 |
114 private: | 115 private: |
115 DISALLOW_COPY_AND_ASSIGN(AsyncPixelTransferDelegate); | 116 DISALLOW_COPY_AND_ASSIGN(AsyncPixelTransferDelegate); |
116 }; | 117 }; |
117 | 118 |
118 } // namespace gfx | 119 } // namespace gfx |
119 | 120 |
120 #endif // UI_GL_ASYNC_TASK_DELEGATE_H_ | 121 #endif // UI_GL_ASYNC_TASK_DELEGATE_H_ |
121 | 122 |
OLD | NEW |