OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "ui/gl/async_pixel_transfer_delegate_stub.h" | 5 #include "ui/gl/async_pixel_transfer_delegate_stub.h" |
6 | 6 |
7 #include "base/shared_memory.h" | 7 #include "base/shared_memory.h" |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #include "gpu/command_buffer/common/gles2_cmd_format.h" | |
9 #include "ui/gl/gl_bindings.h" | 10 #include "ui/gl/gl_bindings.h" |
10 | 11 |
11 using base::SharedMemory; | 12 using base::SharedMemory; |
12 using base::SharedMemoryHandle; | 13 using base::SharedMemoryHandle; |
13 | 14 |
14 namespace { | 15 namespace { |
15 // Gets the address of the data from shared memory. | 16 // Gets the address of the data from shared memory. |
16 void* GetAddress(SharedMemory* shared_memory, | 17 void* GetAddress(SharedMemory* shared_memory, |
17 uint32 shm_size, | 18 uint32 shm_size, |
18 uint32 shm_data_offset, | 19 uint32 shm_data_offset, |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
70 } | 71 } |
71 | 72 |
72 AsyncPixelTransferState* | 73 AsyncPixelTransferState* |
73 AsyncPixelTransferDelegateStub::CreateRawPixelTransferState( | 74 AsyncPixelTransferDelegateStub::CreateRawPixelTransferState( |
74 GLuint texture_id) { | 75 GLuint texture_id) { |
75 return static_cast<AsyncPixelTransferState*>( | 76 return static_cast<AsyncPixelTransferState*>( |
76 new AsyncTransferStateStub(texture_id)); | 77 new AsyncTransferStateStub(texture_id)); |
77 } | 78 } |
78 | 79 |
79 void AsyncPixelTransferDelegateStub::AsyncNotifyCompletion( | 80 void AsyncPixelTransferDelegateStub::AsyncNotifyCompletion( |
80 const base::Closure& task) { | 81 const AsyncMemoryParams& mem_params, |
81 task.Run(); | 82 uint32 submit_count) { |
83 gpu::gles2::QuerySync* sync = static_cast<gpu::gles2::QuerySync*>( | |
epenner
2013/02/07 20:22:56
See my earlier comment. I think the layering viola
| |
84 GetAddress(mem_params.shared_memory, | |
85 mem_params.shm_size, | |
86 mem_params.shm_data_offset, | |
87 mem_params.shm_data_size)); | |
88 if (!sync) | |
89 return; | |
90 sync->process_count = submit_count; | |
82 } | 91 } |
83 | 92 |
84 void AsyncPixelTransferDelegateStub::AsyncTexImage2D( | 93 void AsyncPixelTransferDelegateStub::AsyncTexImage2D( |
85 AsyncPixelTransferState* transfer_state, | 94 AsyncPixelTransferState* transfer_state, |
86 const AsyncTexImage2DParams& tex_params, | 95 const AsyncTexImage2DParams& tex_params, |
87 const AsyncMemoryParams& mem_params) { | 96 const AsyncMemoryParams& mem_params) { |
88 // Save the define params to return later during deferred | 97 // Save the define params to return later during deferred |
89 // binding of the transfer texture. | 98 // binding of the transfer texture. |
90 DCHECK(transfer_state); | 99 DCHECK(transfer_state); |
91 AsyncTransferStateStub* state = | 100 AsyncTransferStateStub* state = |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
141 uint32 AsyncPixelTransferDelegateStub::GetTextureUploadCount() { | 150 uint32 AsyncPixelTransferDelegateStub::GetTextureUploadCount() { |
142 return texture_upload_count_; | 151 return texture_upload_count_; |
143 } | 152 } |
144 | 153 |
145 base::TimeDelta AsyncPixelTransferDelegateStub::GetTotalTextureUploadTime() { | 154 base::TimeDelta AsyncPixelTransferDelegateStub::GetTotalTextureUploadTime() { |
146 return total_texture_upload_time_; | 155 return total_texture_upload_time_; |
147 } | 156 } |
148 | 157 |
149 } // namespace gfx | 158 } // namespace gfx |
150 | 159 |
OLD | NEW |