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

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

Issue 116863003: gpu: Reuse transfer buffers more aggresively (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Unset texture and texture_ref after deleting Created 6 years, 9 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
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_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 "gpu/command_buffer/service/async_pixel_transfer_manager.h" 10 #include "gpu/command_buffer/service/async_pixel_transfer_manager.h"
11 11
12 namespace gpu { 12 namespace gpu {
13 13
14 class AsyncPixelTransferManagerIdle : public AsyncPixelTransferManager { 14 class AsyncPixelTransferManagerIdle : public AsyncPixelTransferManager {
15 public: 15 public:
16 AsyncPixelTransferManagerIdle(); 16 AsyncPixelTransferManagerIdle();
17 virtual ~AsyncPixelTransferManagerIdle(); 17 virtual ~AsyncPixelTransferManagerIdle();
18 18
19 // AsyncPixelTransferManager implementation: 19 // AsyncPixelTransferManager implementation:
20 virtual void BindCompletedAsyncTransfers() OVERRIDE; 20 virtual void BindCompletedAsyncTransfers() OVERRIDE;
21 virtual void AsyncNotifyCompletion( 21 virtual void AsyncNotifyCompletion(
22 const AsyncMemoryParams& mem_params, 22 const AsyncMemoryParams& mem_params,
23 AsyncPixelTransferCompletionObserver* observer) OVERRIDE; 23 AsyncPixelTransferCompletionObserver* observer) OVERRIDE;
24 virtual uint32 GetTextureUploadCount() OVERRIDE; 24 virtual uint32 GetTextureUploadCount() OVERRIDE;
25 virtual base::TimeDelta GetTotalTextureUploadTime() OVERRIDE; 25 virtual base::TimeDelta GetTotalTextureUploadTime() OVERRIDE;
26 virtual void ProcessMorePendingTransfers() OVERRIDE; 26 virtual void ProcessMorePendingTransfers() OVERRIDE;
27 virtual bool NeedsProcessMorePendingTransfers() OVERRIDE; 27 virtual bool NeedsProcessMorePendingTransfers() OVERRIDE;
28 virtual void WaitAllAsyncTexImage2D() OVERRIDE;
28 29
29 struct Task { 30 struct Task {
30 Task(uint64 transfer_id, const base::Closure& task); 31 Task(uint64 transfer_id,
32 AsyncPixelTransferDelegate* delegate,
33 const base::Closure& task);
31 ~Task(); 34 ~Task();
32 35
33 // This is non-zero if pixel transfer task. 36 // This is non-zero if pixel transfer task.
34 uint64 transfer_id; 37 uint64 transfer_id;
35 38
39 AsyncPixelTransferDelegate* delegate;
40
36 base::Closure task; 41 base::Closure task;
37 }; 42 };
38 43
39 // State shared between Managers and Delegates. 44 // State shared between Managers and Delegates.
40 struct SharedState { 45 struct SharedState {
41 SharedState(); 46 SharedState();
42 ~SharedState(); 47 ~SharedState();
43 void ProcessNotificationTasks(); 48 void ProcessNotificationTasks();
44 49
45 int texture_upload_count; 50 int texture_upload_count;
46 base::TimeDelta total_texture_upload_time; 51 base::TimeDelta total_texture_upload_time;
47 std::list<Task> tasks; 52 std::list<Task> tasks;
48 }; 53 };
49 54
50 private: 55 private:
51 // AsyncPixelTransferManager implementation: 56 // AsyncPixelTransferManager implementation:
52 virtual AsyncPixelTransferDelegate* CreatePixelTransferDelegateImpl( 57 virtual AsyncPixelTransferDelegate* CreatePixelTransferDelegateImpl(
53 gles2::TextureRef* ref, 58 gles2::TextureRef* ref,
54 const AsyncTexImage2DParams& define_params) OVERRIDE; 59 const AsyncTexImage2DParams& define_params) OVERRIDE;
55 60
56 SharedState shared_state_; 61 SharedState shared_state_;
57 62
58 DISALLOW_COPY_AND_ASSIGN(AsyncPixelTransferManagerIdle); 63 DISALLOW_COPY_AND_ASSIGN(AsyncPixelTransferManagerIdle);
59 }; 64 };
60 65
61 } // namespace gpu 66 } // namespace gpu
62 67
63 #endif // GPU_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_MANAGER_IDLE_H_ 68 #endif // GPU_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_MANAGER_IDLE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698