| 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 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 515 Send(new GpuCommandBufferMsg_DestroyImage(route_id_, id)); | 515 Send(new GpuCommandBufferMsg_DestroyImage(route_id_, id)); |
| 516 } | 516 } |
| 517 | 517 |
| 518 int32_t CommandBufferProxyImpl::CreateGpuMemoryBufferImage( | 518 int32_t CommandBufferProxyImpl::CreateGpuMemoryBufferImage( |
| 519 size_t width, | 519 size_t width, |
| 520 size_t height, | 520 size_t height, |
| 521 unsigned internal_format, | 521 unsigned internal_format, |
| 522 unsigned usage) { | 522 unsigned usage) { |
| 523 CheckLock(); | 523 CheckLock(); |
| 524 std::unique_ptr<gfx::GpuMemoryBuffer> buffer( | 524 std::unique_ptr<gfx::GpuMemoryBuffer> buffer( |
| 525 channel_->gpu_memory_buffer_manager()->AllocateGpuMemoryBuffer( | 525 channel_->gpu_memory_buffer_manager()->CreateGpuMemoryBuffer( |
| 526 gfx::Size(width, height), | 526 gfx::Size(width, height), |
| 527 gpu::DefaultBufferFormatForImageFormat(internal_format), | 527 gpu::DefaultBufferFormatForImageFormat(internal_format), |
| 528 gfx::BufferUsage::SCANOUT, gpu::kNullSurfaceHandle)); | 528 gfx::BufferUsage::SCANOUT, gpu::kNullSurfaceHandle)); |
| 529 if (!buffer) | 529 if (!buffer) |
| 530 return -1; | 530 return -1; |
| 531 | 531 |
| 532 int32_t result = | 532 int32_t result = |
| 533 CreateImage(buffer->AsClientBuffer(), width, height, internal_format); | 533 CreateImage(buffer->AsClientBuffer(), width, height, internal_format); |
| 534 return result; | 534 return result; |
| 535 } | 535 } |
| (...skipping 330 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 |