OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 GPU_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_DELEGATE_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_DELEGATE_H_ |
6 #define GPU_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_DELEGATE_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_DELEGATE_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 private: | 89 private: |
90 friend class base::RefCounted<AsyncPixelTransferState>; | 90 friend class base::RefCounted<AsyncPixelTransferState>; |
91 | 91 |
92 DISALLOW_COPY_AND_ASSIGN(AsyncPixelTransferState); | 92 DISALLOW_COPY_AND_ASSIGN(AsyncPixelTransferState); |
93 }; | 93 }; |
94 | 94 |
95 class GPU_EXPORT AsyncPixelTransferDelegate { | 95 class GPU_EXPORT AsyncPixelTransferDelegate { |
96 public: | 96 public: |
97 typedef base::Callback<void(const AsyncMemoryParams&)> CompletionCallback; | 97 typedef base::Callback<void(const AsyncMemoryParams&)> CompletionCallback; |
98 | 98 |
99 static AsyncPixelTransferDelegate* Create(gfx::GLContext* context); | |
100 | |
101 virtual ~AsyncPixelTransferDelegate(); | 99 virtual ~AsyncPixelTransferDelegate(); |
102 | 100 |
103 virtual AsyncPixelTransferState* CreatePixelTransferState( | 101 virtual AsyncPixelTransferState* CreatePixelTransferState( |
104 GLuint texture_id, | 102 GLuint texture_id, |
105 const AsyncTexImage2DParams& define_params) = 0; | 103 const AsyncTexImage2DParams& define_params) = 0; |
106 | 104 |
107 virtual void BindCompletedAsyncTransfers() = 0; | 105 virtual void BindCompletedAsyncTransfers() = 0; |
108 | 106 |
109 // There's no guarantee that callback will run on the caller thread. | 107 // There's no guarantee that callback will run on the caller thread. |
110 virtual void AsyncNotifyCompletion( | 108 virtual void AsyncNotifyCompletion( |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 AsyncPixelTransferDelegate(); | 148 AsyncPixelTransferDelegate(); |
151 | 149 |
152 private: | 150 private: |
153 DISALLOW_COPY_AND_ASSIGN(AsyncPixelTransferDelegate); | 151 DISALLOW_COPY_AND_ASSIGN(AsyncPixelTransferDelegate); |
154 }; | 152 }; |
155 | 153 |
156 } // namespace gpu | 154 } // namespace gpu |
157 | 155 |
158 #endif // GPU_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_DELEGATE_H_ | 156 #endif // GPU_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_DELEGATE_H_ |
159 | 157 |
OLD | NEW |