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_SHARE_GROUP_H_
6 #define GPU_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_MANAGER_SHARE_GROUP_H_
8 #include "gpu/command_buffer/service/async_pixel_transfer_manager.h"
10 #include "base/memory/ref_counted.h"
17 class AsyncPixelTransferDelegateShareGroup
;
18 class AsyncPixelTransferUploadStats
;
20 class AsyncPixelTransferManagerShareGroup
: public AsyncPixelTransferManager
{
22 explicit AsyncPixelTransferManagerShareGroup(gfx::GLContext
* context
);
23 virtual ~AsyncPixelTransferManagerShareGroup();
25 // AsyncPixelTransferManager implementation:
26 virtual void BindCompletedAsyncTransfers() OVERRIDE
;
27 virtual void AsyncNotifyCompletion(
28 const AsyncMemoryParams
& mem_params
,
29 AsyncPixelTransferCompletionObserver
* observer
) OVERRIDE
;
30 virtual uint32
GetTextureUploadCount() OVERRIDE
;
31 virtual base::TimeDelta
GetTotalTextureUploadTime() OVERRIDE
;
32 virtual void ProcessMorePendingTransfers() OVERRIDE
;
33 virtual bool NeedsProcessMorePendingTransfers() OVERRIDE
;
34 virtual void WaitAllAsyncTexImage2D() OVERRIDE
;
36 // State shared between Managers and Delegates.
41 scoped_refptr
<AsyncPixelTransferUploadStats
> texture_upload_stats
;
42 typedef std::list
<base::WeakPtr
<AsyncPixelTransferDelegateShareGroup
> >
44 TransferQueue pending_allocations
;
48 // AsyncPixelTransferManager implementation:
49 virtual AsyncPixelTransferDelegate
* CreatePixelTransferDelegateImpl(
50 gles2::TextureRef
* ref
,
51 const AsyncTexImage2DParams
& define_params
) OVERRIDE
;
53 SharedState shared_state_
;
55 DISALLOW_COPY_AND_ASSIGN(AsyncPixelTransferManagerShareGroup
);
60 #endif // GPU_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_MANAGER_SHARE_GROUP_H_