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

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

Issue 2487783003: gpu: Directly cast ClientBuffer to gfx::GpuMemoryBuffer (Closed)
Patch Set: . Created 4 years, 1 month 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
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 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 unsigned internal_format) { 449 unsigned internal_format) {
450 CheckLock(); 450 CheckLock();
451 if (last_state_.error != gpu::error::kNoError) 451 if (last_state_.error != gpu::error::kNoError)
452 return -1; 452 return -1;
453 453
454 int32_t new_id = channel_->ReserveImageId(); 454 int32_t new_id = channel_->ReserveImageId();
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 gpu_memory_buffer_manager->GpuMemoryBufferFromClientBuffer(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; 465 bool requires_sync_token = false;
466 gfx::GpuMemoryBufferHandle handle = 466 gfx::GpuMemoryBufferHandle handle =
467 channel_->ShareGpuMemoryBufferToGpuProcess(gpu_memory_buffer->GetHandle(), 467 channel_->ShareGpuMemoryBufferToGpuProcess(gpu_memory_buffer->GetHandle(),
468 &requires_sync_token); 468 &requires_sync_token);
469 469
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/in_process_command_buffer.cc ('k') | gpu/ipc/client/gpu_memory_buffer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698