| 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 "base/synchronization/waitable_event_watcher.h" |
| 10 #include "gpu/command_buffer/service/async_pixel_transfer_manager.h" | 11 #include "gpu/command_buffer/service/async_pixel_transfer_manager.h" |
| 11 | 12 |
| 12 namespace gpu { | 13 namespace gpu { |
| 13 | 14 |
| 14 class AsyncPixelTransferManagerIdle : public AsyncPixelTransferManager { | 15 class AsyncPixelTransferManagerIdle : public AsyncPixelTransferManager { |
| 15 public: | 16 public: |
| 16 AsyncPixelTransferManagerIdle(); | 17 AsyncPixelTransferManagerIdle(); |
| 17 ~AsyncPixelTransferManagerIdle() override; | 18 ~AsyncPixelTransferManagerIdle() override; |
| 18 | 19 |
| 19 // AsyncPixelTransferManager implementation: | 20 // AsyncPixelTransferManager implementation: |
| (...skipping 26 matching lines...) Expand all Loading... |
| 46 SharedState(); | 47 SharedState(); |
| 47 ~SharedState(); | 48 ~SharedState(); |
| 48 void ProcessNotificationTasks(); | 49 void ProcessNotificationTasks(); |
| 49 | 50 |
| 50 int texture_upload_count; | 51 int texture_upload_count; |
| 51 base::TimeDelta total_texture_upload_time; | 52 base::TimeDelta total_texture_upload_time; |
| 52 std::list<Task> tasks; | 53 std::list<Task> tasks; |
| 53 }; | 54 }; |
| 54 | 55 |
| 55 private: | 56 private: |
| 57 friend class AsyncPixelTransferManagerCompressed; |
| 58 |
| 59 // Used by AsyncPixelTransferManagerCompressed. |
| 60 void SuspendUploads(base::WaitableEvent* waitable); |
| 61 void SignalWhenUploadsCompleted(base::WaitableEvent* waitable); |
| 62 |
| 63 void DoSuspendUploads(scoped_ptr<base::WaitableEvent> waitable); |
| 64 |
| 56 // AsyncPixelTransferManager implementation: | 65 // AsyncPixelTransferManager implementation: |
| 57 AsyncPixelTransferDelegate* CreatePixelTransferDelegateImpl( | 66 AsyncPixelTransferDelegate* CreatePixelTransferDelegateImpl( |
| 58 gles2::TextureRef* ref, | 67 gles2::TextureRef* ref, |
| 59 const AsyncTexImage2DParams& define_params) override; | 68 const AsyncTexImage2DParams& define_params) override; |
| 69 virtual AsyncPixelTransferDelegate* CreatePixelTransferDelegateImpl( |
| 70 gles2::TextureRef* ref, |
| 71 const AsyncCompressedTexImage2DParams& define_params) override; |
| 60 | 72 |
| 61 SharedState shared_state_; | 73 SharedState shared_state_; |
| 74 ScopedVector<base::WaitableEvent> suspend_waitables_; |
| 62 | 75 |
| 63 DISALLOW_COPY_AND_ASSIGN(AsyncPixelTransferManagerIdle); | 76 DISALLOW_COPY_AND_ASSIGN(AsyncPixelTransferManagerIdle); |
| 64 }; | 77 }; |
| 65 | 78 |
| 66 } // namespace gpu | 79 } // namespace gpu |
| 67 | 80 |
| 68 #endif // GPU_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_MANAGER_IDLE_H_ | 81 #endif // GPU_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_MANAGER_IDLE_H_ |
| OLD | NEW |