| 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 size_t width, | 515 size_t width, |
| 516 size_t height, | 516 size_t height, |
| 517 unsigned internal_format, | 517 unsigned internal_format, |
| 518 unsigned usage) { | 518 unsigned usage) { |
| 519 CheckLock(); | 519 CheckLock(); |
| 520 std::unique_ptr<gfx::GpuMemoryBuffer> buffer( | 520 std::unique_ptr<gfx::GpuMemoryBuffer> buffer( |
| 521 channel_->gpu_memory_buffer_manager()->AllocateGpuMemoryBuffer( | 521 channel_->gpu_memory_buffer_manager()->AllocateGpuMemoryBuffer( |
| 522 gfx::Size(width, height), | 522 gfx::Size(width, height), |
| 523 gpu::DefaultBufferFormatForImageFormat(internal_format), | 523 gpu::DefaultBufferFormatForImageFormat(internal_format), |
| 524 gfx::BufferUsage::SCANOUT, gpu::kNullSurfaceHandle)); | 524 gfx::BufferUsage::SCANOUT, gpu::kNullSurfaceHandle)); |
| 525 if (!buffer) | 525 if (!buffer) { |
| 526 fprintf(stderr, "CommandBufferProxyImpl::CreateGpuMemoryBufferImage: no buff
er from AllocateGpuMemoryBuffer\n"); |
| 526 return -1; | 527 return -1; |
| 528 } else { |
| 529 fprintf(stderr, "CommandBufferProxyImpl::CreateGpuMemoryBufferImage: got a b
uffer\n"); |
| 530 } |
| 527 | 531 |
| 528 int32_t result = | 532 int32_t result = |
| 529 CreateImage(buffer->AsClientBuffer(), width, height, internal_format); | 533 CreateImage(buffer->AsClientBuffer(), width, height, internal_format); |
| 530 return result; | 534 return result; |
| 531 } | 535 } |
| 532 | 536 |
| 533 uint32_t CommandBufferProxyImpl::CreateStreamTexture(uint32_t texture_id) { | 537 uint32_t CommandBufferProxyImpl::CreateStreamTexture(uint32_t texture_id) { |
| 534 CheckLock(); | 538 CheckLock(); |
| 535 if (last_state_.error != gpu::error::kNoError) | 539 if (last_state_.error != gpu::error::kNoError) |
| 536 return 0; | 540 return 0; |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 851 return; | 855 return; |
| 852 channel_->FlushPendingStream(stream_id_); | 856 channel_->FlushPendingStream(stream_id_); |
| 853 channel_->Send(new GpuChannelMsg_DestroyCommandBuffer(route_id_)); | 857 channel_->Send(new GpuChannelMsg_DestroyCommandBuffer(route_id_)); |
| 854 channel_->RemoveRoute(route_id_); | 858 channel_->RemoveRoute(route_id_); |
| 855 channel_ = nullptr; | 859 channel_ = nullptr; |
| 856 if (gpu_control_client_) | 860 if (gpu_control_client_) |
| 857 gpu_control_client_->OnGpuControlLostContext(); | 861 gpu_control_client_->OnGpuControlLostContext(); |
| 858 } | 862 } |
| 859 | 863 |
| 860 } // namespace gpu | 864 } // namespace gpu |
| OLD | NEW |