| 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 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 508 bool requires_sync_token = handle.type == gfx::IO_SURFACE_BUFFER; | 508 bool requires_sync_token = handle.type == gfx::IO_SURFACE_BUFFER; |
| 509 | 509 |
| 510 uint64_t image_fence_sync = 0; | 510 uint64_t image_fence_sync = 0; |
| 511 if (requires_sync_token) { | 511 if (requires_sync_token) { |
| 512 image_fence_sync = GenerateFenceSyncRelease(); | 512 image_fence_sync = GenerateFenceSyncRelease(); |
| 513 | 513 |
| 514 // Make sure fence syncs were flushed before CreateImage() was called. | 514 // Make sure fence syncs were flushed before CreateImage() was called. |
| 515 DCHECK_EQ(image_fence_sync, flushed_fence_sync_release_ + 1); | 515 DCHECK_EQ(image_fence_sync, flushed_fence_sync_release_ + 1); |
| 516 } | 516 } |
| 517 | 517 |
| 518 DCHECK(gpu::IsGpuMemoryBufferFormatSupported(gpu_memory_buffer->GetFormat(), | 518 DCHECK(gpu::IsImageFromGpuMemoryBufferFormatSupported( |
| 519 capabilities_)); | 519 gpu_memory_buffer->GetFormat(), capabilities_)); |
| 520 DCHECK(gpu::IsImageSizeValidForGpuMemoryBufferFormat( | 520 DCHECK(gpu::IsImageSizeValidForGpuMemoryBufferFormat( |
| 521 gfx::Size(width, height), gpu_memory_buffer->GetFormat())); | 521 gfx::Size(width, height), gpu_memory_buffer->GetFormat())); |
| 522 DCHECK(gpu::IsImageFormatCompatibleWithGpuMemoryBufferFormat( | 522 DCHECK(gpu::IsImageFormatCompatibleWithGpuMemoryBufferFormat( |
| 523 internal_format, gpu_memory_buffer->GetFormat())); | 523 internal_format, gpu_memory_buffer->GetFormat())); |
| 524 | 524 |
| 525 GpuCommandBufferMsg_CreateImage_Params params; | 525 GpuCommandBufferMsg_CreateImage_Params params; |
| 526 params.id = new_id; | 526 params.id = new_id; |
| 527 params.gpu_memory_buffer = handle; | 527 params.gpu_memory_buffer = handle; |
| 528 params.size = gfx::Size(width, height); | 528 params.size = gfx::Size(width, height); |
| 529 params.format = gpu_memory_buffer->GetFormat(); | 529 params.format = gpu_memory_buffer->GetFormat(); |
| (...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 947 return; | 947 return; |
| 948 channel_->FlushPendingStream(stream_id_); | 948 channel_->FlushPendingStream(stream_id_); |
| 949 channel_->Send(new GpuChannelMsg_DestroyCommandBuffer(route_id_)); | 949 channel_->Send(new GpuChannelMsg_DestroyCommandBuffer(route_id_)); |
| 950 channel_->RemoveRoute(route_id_); | 950 channel_->RemoveRoute(route_id_); |
| 951 channel_ = nullptr; | 951 channel_ = nullptr; |
| 952 if (gpu_control_client_) | 952 if (gpu_control_client_) |
| 953 gpu_control_client_->OnGpuControlLostContext(); | 953 gpu_control_client_->OnGpuControlLostContext(); |
| 954 } | 954 } |
| 955 | 955 |
| 956 } // namespace gpu | 956 } // namespace gpu |
| OLD | NEW |