| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "gpu/pgl/command_buffer_pepper.h" | 5 #include "gpu/pgl/command_buffer_pepper.h" |
| 6 | 6 |
| 7 #include "gpu/command_buffer/common/logging.h" | 7 #include "gpu/command_buffer/common/logging.h" |
| 8 | 8 |
| 9 using base::SharedMemory; | 9 using base::SharedMemory; |
| 10 using gpu::Buffer; | 10 using gpu::Buffer; |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 } | 135 } |
| 136 | 136 |
| 137 int32 CommandBufferPepper::CreateTransferBuffer(size_t size) { | 137 int32 CommandBufferPepper::CreateTransferBuffer(size_t size) { |
| 138 int32_t id; | 138 int32_t id; |
| 139 if (NPERR_NO_ERROR != device_->createBuffer(npp_, context_, size, &id)) | 139 if (NPERR_NO_ERROR != device_->createBuffer(npp_, context_, size, &id)) |
| 140 return -1; | 140 return -1; |
| 141 | 141 |
| 142 return static_cast<int32>(id); | 142 return static_cast<int32>(id); |
| 143 } | 143 } |
| 144 | 144 |
| 145 int32 CommandBufferPepper::RegisterTransferBuffer( |
| 146 base::SharedMemory* shared_memory, |
| 147 size_t size) { |
| 148 // Not implemented by proxy. |
| 149 GPU_NOTREACHED(); |
| 150 return -1; |
| 151 } |
| 152 |
| 145 void CommandBufferPepper::DestroyTransferBuffer(int32 id) { | 153 void CommandBufferPepper::DestroyTransferBuffer(int32 id) { |
| 146 device_->destroyBuffer(npp_, context_, id); | 154 device_->destroyBuffer(npp_, context_, id); |
| 147 } | 155 } |
| 148 | 156 |
| 149 Buffer CommandBufferPepper::GetTransferBuffer(int32 id) { | 157 Buffer CommandBufferPepper::GetTransferBuffer(int32 id) { |
| 150 NPDeviceBuffer np_buffer; | 158 NPDeviceBuffer np_buffer; |
| 151 if (NPERR_NO_ERROR != device_->mapBuffer(npp_, context_, id, &np_buffer)) | 159 if (NPERR_NO_ERROR != device_->mapBuffer(npp_, context_, id, &np_buffer)) |
| 152 return Buffer(); | 160 return Buffer(); |
| 153 | 161 |
| 154 Buffer buffer; | 162 Buffer buffer; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 CommandBuffer::State CommandBufferPepper::ConvertState() { | 194 CommandBuffer::State CommandBufferPepper::ConvertState() { |
| 187 CommandBuffer::State state; | 195 CommandBuffer::State state; |
| 188 state.num_entries = context_->commandBufferSize; | 196 state.num_entries = context_->commandBufferSize; |
| 189 state.get_offset = context_->getOffset; | 197 state.get_offset = context_->getOffset; |
| 190 state.put_offset = context_->putOffset; | 198 state.put_offset = context_->putOffset; |
| 191 state.token = context_->token; | 199 state.token = context_->token; |
| 192 state.error = static_cast<gpu::error::Error>( | 200 state.error = static_cast<gpu::error::Error>( |
| 193 context_->error); | 201 context_->error); |
| 194 return state; | 202 return state; |
| 195 } | 203 } |
| OLD | NEW |