| 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 "gpu/ipc/client/command_buffer_proxy_impl.h" | 5 #include "gpu/ipc/client/command_buffer_proxy_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 } | 539 } |
| 540 | 540 |
| 541 int32_t CommandBufferProxyImpl::GetImageGpuMemoryBufferId(unsigned image_id) { | 541 int32_t CommandBufferProxyImpl::GetImageGpuMemoryBufferId(unsigned image_id) { |
| 542 CheckLock(); | 542 CheckLock(); |
| 543 auto it = image_gmb_ids_map_.find(image_id); | 543 auto it = image_gmb_ids_map_.find(image_id); |
| 544 if (it != image_gmb_ids_map_.end()) | 544 if (it != image_gmb_ids_map_.end()) |
| 545 return it->second; | 545 return it->second; |
| 546 return -1; | 546 return -1; |
| 547 } | 547 } |
| 548 | 548 |
| 549 uint32_t CommandBufferProxyImpl::CreateStreamTexture(uint32_t texture_id) { | 549 uint32_t CommandBufferProxyImpl::CreateStreamTexture(int32_t image_id) { |
| 550 CheckLock(); | 550 CheckLock(); |
| 551 if (last_state_.error != gpu::error::kNoError) | 551 if (last_state_.error != gpu::error::kNoError) |
| 552 return 0; | 552 return 0; |
| 553 | 553 |
| 554 int32_t stream_id = channel_->GenerateRouteID(); | 554 int32_t stream_id = channel_->GenerateRouteID(); |
| 555 bool succeeded = false; | 555 bool succeeded = false; |
| 556 Send(new GpuCommandBufferMsg_CreateStreamTexture(route_id_, texture_id, | 556 Send(new GpuCommandBufferMsg_CreateStreamTexture(route_id_, image_id, |
| 557 stream_id, &succeeded)); | 557 stream_id, &succeeded)); |
| 558 if (!succeeded) { | 558 if (!succeeded) { |
| 559 DLOG(ERROR) << "GpuCommandBufferMsg_CreateStreamTexture returned failure"; | 559 DLOG(ERROR) << "GpuCommandBufferMsg_CreateStreamTexture returned failure"; |
| 560 return 0; | 560 return 0; |
| 561 } | 561 } |
| 562 return stream_id; | 562 return stream_id; |
| 563 } | 563 } |
| 564 | 564 |
| 565 void CommandBufferProxyImpl::SetLock(base::Lock* lock) { | 565 void CommandBufferProxyImpl::SetLock(base::Lock* lock) { |
| 566 lock_ = lock; | 566 lock_ = lock; |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 866 return; | 866 return; |
| 867 channel_->FlushPendingStream(stream_id_); | 867 channel_->FlushPendingStream(stream_id_); |
| 868 channel_->Send(new GpuChannelMsg_DestroyCommandBuffer(route_id_)); | 868 channel_->Send(new GpuChannelMsg_DestroyCommandBuffer(route_id_)); |
| 869 channel_->RemoveRoute(route_id_); | 869 channel_->RemoveRoute(route_id_); |
| 870 channel_ = nullptr; | 870 channel_ = nullptr; |
| 871 if (gpu_control_client_) | 871 if (gpu_control_client_) |
| 872 gpu_control_client_->OnGpuControlLostContext(); | 872 gpu_control_client_->OnGpuControlLostContext(); |
| 873 } | 873 } |
| 874 | 874 |
| 875 } // namespace gpu | 875 } // namespace gpu |
| OLD | NEW |