| 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 // ProcessPendingTransfers() will be called at a good time |
| 116 // to process a small amount of pending transfer work while |
| 117 // NeedsProcessPendingTransfers() returns true. Implementations |
| 118 // that can't dispatch work to separate threads should use |
| 119 // this to avoid blocking the caller thread inappropriately. |
| 120 virtual void ProcessPendingTransfers() = 0; |
| 121 virtual bool NeedsProcessPendingTransfers() = 0; |
| 122 |
| 115 protected: | 123 protected: |
| 116 AsyncPixelTransferDelegate() {} | 124 AsyncPixelTransferDelegate() {} |
| 117 // For testing, as returning scoped_ptr wouldn't work with MOCK_METHOD. | 125 // For testing, as returning scoped_ptr wouldn't work with MOCK_METHOD. |
| 118 virtual AsyncPixelTransferState* | 126 virtual AsyncPixelTransferState* |
| 119 CreateRawPixelTransferState(GLuint tex_id, | 127 CreateRawPixelTransferState(GLuint tex_id, |
| 120 const AsyncTexImage2DParams& define_params) = 0; | 128 const AsyncTexImage2DParams& define_params) = 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 |