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

Side by Side Diff: services/ui/ws/mus_gpu_memory_buffer_manager.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "services/ui/ws/mus_gpu_memory_buffer_manager.h" 5 #include "services/ui/ws/mus_gpu_memory_buffer_manager.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "gpu/ipc/client/gpu_memory_buffer_impl.h" 8 #include "gpu/ipc/client/gpu_memory_buffer_impl.h"
9 #include "gpu/ipc/client/gpu_memory_buffer_impl_shared_memory.h" 9 #include "gpu/ipc/client/gpu_memory_buffer_impl_shared_memory.h"
10 #include "gpu/ipc/common/gpu_memory_buffer_support.h" 10 #include "gpu/ipc/common/gpu_memory_buffer_support.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 53
54 std::unique_ptr<gfx::GpuMemoryBuffer> 54 std::unique_ptr<gfx::GpuMemoryBuffer>
55 MusGpuMemoryBufferManager::CreateGpuMemoryBufferFromHandle( 55 MusGpuMemoryBufferManager::CreateGpuMemoryBufferFromHandle(
56 const gfx::GpuMemoryBufferHandle& handle, 56 const gfx::GpuMemoryBufferHandle& handle,
57 const gfx::Size& size, 57 const gfx::Size& size,
58 gfx::BufferFormat format) { 58 gfx::BufferFormat format) {
59 NOTIMPLEMENTED(); 59 NOTIMPLEMENTED();
60 return nullptr; 60 return nullptr;
61 } 61 }
62 62
63 gfx::GpuMemoryBuffer*
64 MusGpuMemoryBufferManager::GpuMemoryBufferFromClientBuffer(
65 ClientBuffer buffer) {
66 return gpu::GpuMemoryBufferImpl::FromClientBuffer(buffer);
67 }
68
69 void MusGpuMemoryBufferManager::SetDestructionSyncToken( 63 void MusGpuMemoryBufferManager::SetDestructionSyncToken(
70 gfx::GpuMemoryBuffer* buffer, 64 gfx::GpuMemoryBuffer* buffer,
71 const gpu::SyncToken& sync_token) { 65 const gpu::SyncToken& sync_token) {
72 static_cast<gpu::GpuMemoryBufferImpl*>(buffer)->set_destruction_sync_token( 66 static_cast<gpu::GpuMemoryBufferImpl*>(buffer)->set_destruction_sync_token(
73 sync_token); 67 sync_token);
74 } 68 }
75 69
76 void MusGpuMemoryBufferManager::DestroyGpuMemoryBuffer( 70 void MusGpuMemoryBufferManager::DestroyGpuMemoryBuffer(
77 gfx::GpuMemoryBufferId id, 71 gfx::GpuMemoryBufferId id,
78 int client_id, 72 int client_id,
79 bool is_native, 73 bool is_native,
80 const gpu::SyncToken& sync_token) { 74 const gpu::SyncToken& sync_token) {
81 if (is_native) { 75 if (is_native) {
82 gpu_service_->DestroyGpuMemoryBuffer(id, client_id, sync_token); 76 gpu_service_->DestroyGpuMemoryBuffer(id, client_id, sync_token);
83 } 77 }
84 } 78 }
85 79
86 } // namespace ws 80 } // namespace ws
87 } // namespace ui 81 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/ws/mus_gpu_memory_buffer_manager.h ('k') | ui/aura/mus/mojo_gpu_memory_buffer_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698