OLD | NEW |
| (Empty) |
1 // Copyright (c) 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. | |
4 | |
5 #ifndef GPU_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_DELEGATE_SYNC_H_ | |
6 #define GPU_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_DELEGATE_SYNC_H_ | |
7 | |
8 #include "gpu/command_buffer/service/async_pixel_transfer_delegate.h" | |
9 | |
10 namespace gpu { | |
11 | |
12 // Class which handles async pixel transfers synchronously. | |
13 class AsyncPixelTransferDelegateSync : public AsyncPixelTransferDelegate { | |
14 public: | |
15 AsyncPixelTransferDelegateSync(); | |
16 virtual ~AsyncPixelTransferDelegateSync(); | |
17 | |
18 // Implement AsyncPixelTransferDelegate: | |
19 virtual AsyncPixelTransferState* CreatePixelTransferState( | |
20 GLuint texture_id, | |
21 const AsyncTexImage2DParams& define_params) OVERRIDE; | |
22 virtual void BindCompletedAsyncTransfers() OVERRIDE; | |
23 virtual void AsyncNotifyCompletion( | |
24 const AsyncMemoryParams& mem_params, | |
25 const CompletionCallback& callback) OVERRIDE; | |
26 virtual void AsyncTexImage2D( | |
27 AsyncPixelTransferState* state, | |
28 const AsyncTexImage2DParams& tex_params, | |
29 const AsyncMemoryParams& mem_params, | |
30 const base::Closure& bind_callback) OVERRIDE; | |
31 virtual void AsyncTexSubImage2D( | |
32 AsyncPixelTransferState* transfer_state, | |
33 const AsyncTexSubImage2DParams& tex_params, | |
34 const AsyncMemoryParams& mem_params) OVERRIDE; | |
35 virtual void WaitForTransferCompletion( | |
36 AsyncPixelTransferState* state) OVERRIDE; | |
37 virtual uint32 GetTextureUploadCount() OVERRIDE; | |
38 virtual base::TimeDelta GetTotalTextureUploadTime() OVERRIDE; | |
39 virtual void ProcessMorePendingTransfers() OVERRIDE; | |
40 virtual bool NeedsProcessMorePendingTransfers() OVERRIDE; | |
41 | |
42 private: | |
43 int texture_upload_count_; | |
44 base::TimeDelta total_texture_upload_time_; | |
45 | |
46 DISALLOW_COPY_AND_ASSIGN(AsyncPixelTransferDelegateSync); | |
47 }; | |
48 | |
49 } // namespace gpu | |
50 | |
51 #endif // GPU_COMMAND_BUFFER_SERVICE_ASYNC_PIXEL_TRANSFER_DELEGATE_SYNC_H_ | |
OLD | NEW |