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
3 // found in the LICENSE file.
5 #ifndef GPU_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_MANAGER_IDLE_H_
6 #define GPU_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_MANAGER_IDLE_H_
10 #include "gpu/command_buffer/service/async_pixel_transfer_manager.h"
14 class AsyncPixelTransferManagerIdle
: public AsyncPixelTransferManager
{
16 explicit AsyncPixelTransferManagerIdle(
17 bool use_teximage2d_over_texsubimage2d
);
18 ~AsyncPixelTransferManagerIdle() override
;
20 // AsyncPixelTransferManager implementation:
21 void BindCompletedAsyncTransfers() override
;
22 void AsyncNotifyCompletion(
23 const AsyncMemoryParams
& mem_params
,
24 AsyncPixelTransferCompletionObserver
* observer
) override
;
25 uint32
GetTextureUploadCount() override
;
26 base::TimeDelta
GetTotalTextureUploadTime() override
;
27 void ProcessMorePendingTransfers() override
;
28 bool NeedsProcessMorePendingTransfers() override
;
29 void WaitAllAsyncTexImage2D() override
;
32 Task(uint64 transfer_id
,
33 AsyncPixelTransferDelegate
* delegate
,
34 const base::Closure
& task
);
37 // This is non-zero if pixel transfer task.
40 AsyncPixelTransferDelegate
* delegate
;
45 // State shared between Managers and Delegates.
47 explicit SharedState(bool use_teximage2d_over_texsubimage2d
);
49 void ProcessNotificationTasks();
51 const bool use_teximage2d_over_texsubimage2d
;
52 int texture_upload_count
;
53 base::TimeDelta total_texture_upload_time
;
54 std::list
<Task
> tasks
;
58 // AsyncPixelTransferManager implementation:
59 AsyncPixelTransferDelegate
* CreatePixelTransferDelegateImpl(
60 gles2::TextureRef
* ref
,
61 const AsyncTexImage2DParams
& define_params
) override
;
63 SharedState shared_state_
;
65 DISALLOW_COPY_AND_ASSIGN(AsyncPixelTransferManagerIdle
);
70 #endif // GPU_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_MANAGER_IDLE_H_