Handle account removal correctly on all platforms.
[chromium-blink-merge.git] / gpu / command_buffer / service / async_pixel_transfer_manager_idle.h
blobaf3262f2889b76bd26853ca4745cb49f05028b6d
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_
8 #include <list>
10 #include "gpu/command_buffer/service/async_pixel_transfer_manager.h"
12 namespace gpu {
14 class AsyncPixelTransferManagerIdle : public AsyncPixelTransferManager {
15 public:
16 AsyncPixelTransferManagerIdle();
17 virtual ~AsyncPixelTransferManagerIdle();
19 // AsyncPixelTransferManager implementation:
20 virtual void BindCompletedAsyncTransfers() OVERRIDE;
21 virtual void AsyncNotifyCompletion(
22 const AsyncMemoryParams& mem_params,
23 AsyncPixelTransferCompletionObserver* observer) OVERRIDE;
24 virtual uint32 GetTextureUploadCount() OVERRIDE;
25 virtual base::TimeDelta GetTotalTextureUploadTime() OVERRIDE;
26 virtual void ProcessMorePendingTransfers() OVERRIDE;
27 virtual bool NeedsProcessMorePendingTransfers() OVERRIDE;
28 virtual void WaitAllAsyncTexImage2D() OVERRIDE;
30 struct Task {
31 Task(uint64 transfer_id,
32 AsyncPixelTransferDelegate* delegate,
33 const base::Closure& task);
34 ~Task();
36 // This is non-zero if pixel transfer task.
37 uint64 transfer_id;
39 AsyncPixelTransferDelegate* delegate;
41 base::Closure task;
44 // State shared between Managers and Delegates.
45 struct SharedState {
46 SharedState();
47 ~SharedState();
48 void ProcessNotificationTasks();
50 int texture_upload_count;
51 base::TimeDelta total_texture_upload_time;
52 std::list<Task> tasks;
55 private:
56 // AsyncPixelTransferManager implementation:
57 virtual AsyncPixelTransferDelegate* CreatePixelTransferDelegateImpl(
58 gles2::TextureRef* ref,
59 const AsyncTexImage2DParams& define_params) OVERRIDE;
61 SharedState shared_state_;
63 DISALLOW_COPY_AND_ASSIGN(AsyncPixelTransferManagerIdle);
66 } // namespace gpu
68 #endif // GPU_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_MANAGER_IDLE_H_