Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(166)

Side by Side Diff: gpu/command_buffer/service/async_pixel_transfer_manager_share_group.h

Issue 16175005: GPU: Replace AsyncPixelTransferState with AsyncPixelTransferDelegate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_SHARE_GROUP_H_ 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_ 6 #define GPU_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_MANAGER_SHARE_GROUP_H_
7 7
8 #include "gpu/command_buffer/service/async_pixel_transfer_manager.h" 8 #include "gpu/command_buffer/service/async_pixel_transfer_manager.h"
9 9
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
11 #include "base/memory/scoped_ptr.h"
12 11
13 namespace gfx { 12 namespace gfx {
14 class GLContext; 13 class GLContext;
15 } 14 }
16 15
17 namespace gpu { 16 namespace gpu {
18 class AsyncPixelTransferDelegateShareGroup; 17 class AsyncPixelTransferDelegateShareGroup;
19 class AsyncPixelTransferUploadStats; 18 class AsyncPixelTransferUploadStats;
20 19
21 class AsyncPixelTransferManagerShareGroup : public AsyncPixelTransferManager { 20 class AsyncPixelTransferManagerShareGroup : public AsyncPixelTransferManager {
22 public: 21 public:
23 explicit AsyncPixelTransferManagerShareGroup(gfx::GLContext* context); 22 explicit AsyncPixelTransferManagerShareGroup(gfx::GLContext* context);
24 virtual ~AsyncPixelTransferManagerShareGroup(); 23 virtual ~AsyncPixelTransferManagerShareGroup();
25 24
26 // AsyncPixelTransferManager implementation: 25 // AsyncPixelTransferManager implementation:
27 virtual void BindCompletedAsyncTransfers() OVERRIDE; 26 virtual void BindCompletedAsyncTransfers() OVERRIDE;
28 virtual void AsyncNotifyCompletion( 27 virtual void AsyncNotifyCompletion(
29 const AsyncMemoryParams& mem_params, 28 const AsyncMemoryParams& mem_params,
30 const CompletionCallback& callback) OVERRIDE; 29 const CompletionCallback& callback) OVERRIDE;
31 virtual uint32 GetTextureUploadCount() OVERRIDE; 30 virtual uint32 GetTextureUploadCount() OVERRIDE;
32 virtual base::TimeDelta GetTotalTextureUploadTime() OVERRIDE; 31 virtual base::TimeDelta GetTotalTextureUploadTime() OVERRIDE;
33 virtual void ProcessMorePendingTransfers() OVERRIDE; 32 virtual void ProcessMorePendingTransfers() OVERRIDE;
34 virtual bool NeedsProcessMorePendingTransfers() OVERRIDE; 33 virtual bool NeedsProcessMorePendingTransfers() OVERRIDE;
35 virtual AsyncPixelTransferDelegate* GetAsyncPixelTransferDelegate() OVERRIDE;
36 34
37 // State shared between Managers and Delegates. 35 // State shared between Managers and Delegates.
38 struct SharedState { 36 struct SharedState {
39 SharedState(); 37 SharedState();
40 ~SharedState(); 38 ~SharedState();
41 39
42 scoped_refptr<AsyncPixelTransferUploadStats> texture_upload_stats; 40 scoped_refptr<AsyncPixelTransferUploadStats> texture_upload_stats;
43 typedef std::list<base::WeakPtr<AsyncPixelTransferState> > TransferQueue; 41 typedef std::list<base::WeakPtr<AsyncPixelTransferDelegateShareGroup> >
42 TransferQueue;
44 TransferQueue pending_allocations; 43 TransferQueue pending_allocations;
45 }; 44 };
46 45
47 private: 46 private:
47 // AsyncPixelTransferManager implementation:
48 virtual AsyncPixelTransferDelegate* CreatePixelTransferDelegateImpl(
49 gles2::TextureRef* ref,
50 const AsyncTexImage2DParams& define_params) OVERRIDE;
51
48 SharedState shared_state_; 52 SharedState shared_state_;
49 scoped_ptr<AsyncPixelTransferDelegateShareGroup> delegate_;
50 53
51 DISALLOW_COPY_AND_ASSIGN(AsyncPixelTransferManagerShareGroup); 54 DISALLOW_COPY_AND_ASSIGN(AsyncPixelTransferManagerShareGroup);
52 }; 55 };
53 56
54 } // namespace gpu 57 } // namespace gpu
55 58
56 #endif // GPU_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_MANAGER_SHARE_GROUP_H _ 59 #endif // GPU_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_MANAGER_SHARE_GROUP_H _
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698