| 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 "ui/gl/gl_bindings.h" | 9 #include "ui/gl/gl_bindings.h" |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 // is just DCHECKS here. | 21 // is just DCHECKS here. |
| 22 DCHECK(shared_memory); | 22 DCHECK(shared_memory); |
| 23 DCHECK(shared_memory->memory()); | 23 DCHECK(shared_memory->memory()); |
| 24 DCHECK_LE(shm_data_offset + shm_data_size, shm_size); | 24 DCHECK_LE(shm_data_offset + shm_data_size, shm_size); |
| 25 return static_cast<int8*>(shared_memory->memory()) + shm_data_offset; | 25 return static_cast<int8*>(shared_memory->memory()) + shm_data_offset; |
| 26 } | 26 } |
| 27 } // namespace | 27 } // namespace |
| 28 | 28 |
| 29 namespace gfx { | 29 namespace gfx { |
| 30 | 30 |
| 31 #if !defined(OS_ANDROID) | |
| 32 scoped_ptr<AsyncPixelTransferDelegate> | |
| 33 AsyncPixelTransferDelegate::Create(gfx::GLContext* context) { | |
| 34 return AsyncPixelTransferDelegateStub::Create(context); | |
| 35 } | |
| 36 #endif | |
| 37 | |
| 38 scoped_ptr<AsyncPixelTransferDelegate> | 31 scoped_ptr<AsyncPixelTransferDelegate> |
| 39 AsyncPixelTransferDelegateStub::Create(gfx::GLContext* context) { | 32 AsyncPixelTransferDelegateStub::Create(gfx::GLContext* context) { |
| 40 return make_scoped_ptr( | 33 return make_scoped_ptr( |
| 41 static_cast<AsyncPixelTransferDelegate*>( | 34 static_cast<AsyncPixelTransferDelegate*>( |
| 42 new AsyncPixelTransferDelegateStub())); | 35 new AsyncPixelTransferDelegateStub())); |
| 43 } | 36 } |
| 44 | 37 |
| 45 AsyncTransferStateStub::AsyncTransferStateStub(GLuint texture_id) { | 38 AsyncTransferStateStub::AsyncTransferStateStub(GLuint texture_id) { |
| 46 } | 39 } |
| 47 | 40 |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 } | 127 } |
| 135 | 128 |
| 136 uint32 AsyncPixelTransferDelegateStub::GetTextureUploadCount() { | 129 uint32 AsyncPixelTransferDelegateStub::GetTextureUploadCount() { |
| 137 return texture_upload_count_; | 130 return texture_upload_count_; |
| 138 } | 131 } |
| 139 | 132 |
| 140 base::TimeDelta AsyncPixelTransferDelegateStub::GetTotalTextureUploadTime() { | 133 base::TimeDelta AsyncPixelTransferDelegateStub::GetTotalTextureUploadTime() { |
| 141 return total_texture_upload_time_; | 134 return total_texture_upload_time_; |
| 142 } | 135 } |
| 143 | 136 |
| 137 void AsyncPixelTransferDelegateStub::ProcessPendingTransfers() {} |
| 138 |
| 139 bool AsyncPixelTransferDelegateStub::NeedsProcessPendingTransfers() { |
| 140 return false; |
| 141 } |
| 142 |
| 144 } // namespace gfx | 143 } // namespace gfx |
| 145 | 144 |
| OLD | NEW |