OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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_MANAGER_IDLE_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_MANAGER_IDLE_H_ |
6 #define GPU_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_MANAGER_IDLE_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_MANAGER_IDLE_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 | 9 |
10 #include "gpu/command_buffer/service/async_pixel_transfer_manager.h" | 10 #include "gpu/command_buffer/service/async_pixel_transfer_manager.h" |
11 | 11 |
12 namespace gpu { | 12 namespace gpu { |
13 class AsyncPixelTransferDelegateIdle; | |
14 | 13 |
15 class AsyncPixelTransferManagerIdle : public AsyncPixelTransferManager { | 14 class AsyncPixelTransferManagerIdle : public AsyncPixelTransferManager { |
16 public: | 15 public: |
17 AsyncPixelTransferManagerIdle(); | 16 AsyncPixelTransferManagerIdle(); |
18 virtual ~AsyncPixelTransferManagerIdle(); | 17 virtual ~AsyncPixelTransferManagerIdle(); |
19 | 18 |
20 // AsyncPixelTransferManager implementation: | 19 // AsyncPixelTransferManager implementation: |
21 virtual void BindCompletedAsyncTransfers() OVERRIDE; | 20 virtual void BindCompletedAsyncTransfers() OVERRIDE; |
22 virtual void AsyncNotifyCompletion( | 21 virtual void AsyncNotifyCompletion( |
23 const AsyncMemoryParams& mem_params, | 22 const AsyncMemoryParams& mem_params, |
24 const CompletionCallback& callback) OVERRIDE; | 23 const CompletionCallback& callback) OVERRIDE; |
25 virtual uint32 GetTextureUploadCount() OVERRIDE; | 24 virtual uint32 GetTextureUploadCount() OVERRIDE; |
26 virtual base::TimeDelta GetTotalTextureUploadTime() OVERRIDE; | 25 virtual base::TimeDelta GetTotalTextureUploadTime() OVERRIDE; |
27 virtual void ProcessMorePendingTransfers() OVERRIDE; | 26 virtual void ProcessMorePendingTransfers() OVERRIDE; |
28 virtual bool NeedsProcessMorePendingTransfers() OVERRIDE; | 27 virtual bool NeedsProcessMorePendingTransfers() OVERRIDE; |
29 virtual AsyncPixelTransferDelegate* GetAsyncPixelTransferDelegate() OVERRIDE; | |
30 | 28 |
31 struct Task { | 29 struct Task { |
32 Task(uint64 transfer_id, const base::Closure& task); | 30 Task(uint64 transfer_id, const base::Closure& task); |
33 ~Task(); | 31 ~Task(); |
34 | 32 |
35 // This is non-zero if pixel transfer task. | 33 // This is non-zero if pixel transfer task. |
36 uint64 transfer_id; | 34 uint64 transfer_id; |
37 | 35 |
38 base::Closure task; | 36 base::Closure task; |
39 }; | 37 }; |
40 | 38 |
41 // State shared between Managers and Delegates. | 39 // State shared between Managers and Delegates. |
42 struct SharedState { | 40 struct SharedState { |
43 SharedState(); | 41 SharedState(); |
44 ~SharedState(); | 42 ~SharedState(); |
45 void ProcessNotificationTasks(); | 43 void ProcessNotificationTasks(); |
46 | 44 |
47 int texture_upload_count; | 45 int texture_upload_count; |
48 base::TimeDelta total_texture_upload_time; | 46 base::TimeDelta total_texture_upload_time; |
49 std::list<Task> tasks; | 47 std::list<Task> tasks; |
50 }; | 48 }; |
51 | 49 |
52 private: | 50 private: |
| 51 // AsyncPixelTransferManager implementation: |
| 52 virtual AsyncPixelTransferDelegate* CreatePixelTransferDelegateImpl( |
| 53 gles2::TextureRef* ref, |
| 54 const AsyncTexImage2DParams& define_params) OVERRIDE; |
| 55 |
53 SharedState shared_state_; | 56 SharedState shared_state_; |
54 scoped_ptr<AsyncPixelTransferDelegateIdle> delegate_; | |
55 | 57 |
56 DISALLOW_COPY_AND_ASSIGN(AsyncPixelTransferManagerIdle); | 58 DISALLOW_COPY_AND_ASSIGN(AsyncPixelTransferManagerIdle); |
57 }; | 59 }; |
58 | 60 |
59 } // namespace gpu | 61 } // namespace gpu |
60 | 62 |
61 #endif // GPU_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_MANAGER_IDLE_H_ | 63 #endif // GPU_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_MANAGER_IDLE_H_ |
OLD | NEW |