Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(197)

Side by Side Diff: gpu/ipc/client/command_buffer_proxy_impl.cc

Issue 2531963002: gfx: Fix sending native ozone pixmaps from InProcessCommandBuffer. (Closed)
Patch Set: . Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | gpu/ipc/client/gpu_channel_host.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 455
456 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager = 456 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager =
457 channel_->gpu_memory_buffer_manager(); 457 channel_->gpu_memory_buffer_manager();
458 gfx::GpuMemoryBuffer* gpu_memory_buffer = 458 gfx::GpuMemoryBuffer* gpu_memory_buffer =
459 reinterpret_cast<gfx::GpuMemoryBuffer*>(buffer); 459 reinterpret_cast<gfx::GpuMemoryBuffer*>(buffer);
460 DCHECK(gpu_memory_buffer); 460 DCHECK(gpu_memory_buffer);
461 461
462 // This handle is owned by the GPU process and must be passed to it or it 462 // This handle is owned by the GPU process and must be passed to it or it
463 // will leak. In otherwords, do not early out on error between here and the 463 // will leak. In otherwords, do not early out on error between here and the
464 // sending of the CreateImage IPC below. 464 // sending of the CreateImage IPC below.
465 bool requires_sync_token = false;
466 gfx::GpuMemoryBufferHandle handle = 465 gfx::GpuMemoryBufferHandle handle =
467 channel_->ShareGpuMemoryBufferToGpuProcess(gpu_memory_buffer->GetHandle(), 466 channel_->IsLost()
piman 2016/11/28 23:42:36 Actually this is not necessary anymore, since now
sadrul 2016/11/29 01:53:51 Oh cool. Thanks! Removed the IsLost() check from h
468 &requires_sync_token); 467 ? gfx::GpuMemoryBufferHandle()
468 : gfx::CloneHandleForIPC(gpu_memory_buffer->GetHandle());
sadrul 2016/11/27 03:59:06 This may actually change behaviour. Right now, 'Is
469 bool requires_sync_token = handle.type == gfx::IO_SURFACE_BUFFER;
469 470
470 uint64_t image_fence_sync = 0; 471 uint64_t image_fence_sync = 0;
471 if (requires_sync_token) { 472 if (requires_sync_token) {
472 image_fence_sync = GenerateFenceSyncRelease(); 473 image_fence_sync = GenerateFenceSyncRelease();
473 474
474 // Make sure fence syncs were flushed before CreateImage() was called. 475 // Make sure fence syncs were flushed before CreateImage() was called.
475 DCHECK_EQ(image_fence_sync, flushed_fence_sync_release_ + 1); 476 DCHECK_EQ(image_fence_sync, flushed_fence_sync_release_ + 1);
476 } 477 }
477 478
478 DCHECK(gpu::IsGpuMemoryBufferFormatSupported(gpu_memory_buffer->GetFormat(), 479 DCHECK(gpu::IsGpuMemoryBufferFormatSupported(gpu_memory_buffer->GetFormat(),
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
866 return; 867 return;
867 channel_->FlushPendingStream(stream_id_); 868 channel_->FlushPendingStream(stream_id_);
868 channel_->Send(new GpuChannelMsg_DestroyCommandBuffer(route_id_)); 869 channel_->Send(new GpuChannelMsg_DestroyCommandBuffer(route_id_));
869 channel_->RemoveRoute(route_id_); 870 channel_->RemoveRoute(route_id_);
870 channel_ = nullptr; 871 channel_ = nullptr;
871 if (gpu_control_client_) 872 if (gpu_control_client_)
872 gpu_control_client_->OnGpuControlLostContext(); 873 gpu_control_client_->OnGpuControlLostContext();
873 } 874 }
874 875
875 } // namespace gpu 876 } // namespace gpu
OLDNEW
« no previous file with comments | « no previous file | gpu/ipc/client/gpu_channel_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698