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

Side by Side Diff: services/ui/public/cpp/mojo_gpu_memory_buffer_manager.h

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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #ifndef SERVICES_UI_PUBLIC_CPP_MOJO_GPU_MEMORY_BUFFER_MANAGER_H_ 5 #ifndef SERVICES_UI_PUBLIC_CPP_MOJO_GPU_MEMORY_BUFFER_MANAGER_H_
6 #define SERVICES_UI_PUBLIC_CPP_MOJO_GPU_MEMORY_BUFFER_MANAGER_H_ 6 #define SERVICES_UI_PUBLIC_CPP_MOJO_GPU_MEMORY_BUFFER_MANAGER_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 // Overridden from gpu::GpuMemoryBufferManager: 48 // Overridden from gpu::GpuMemoryBufferManager:
49 std::unique_ptr<gfx::GpuMemoryBuffer> AllocateGpuMemoryBuffer( 49 std::unique_ptr<gfx::GpuMemoryBuffer> AllocateGpuMemoryBuffer(
50 const gfx::Size& size, 50 const gfx::Size& size,
51 gfx::BufferFormat format, 51 gfx::BufferFormat format,
52 gfx::BufferUsage usage, 52 gfx::BufferUsage usage,
53 gpu::SurfaceHandle surface_handle) override; 53 gpu::SurfaceHandle surface_handle) override;
54 std::unique_ptr<gfx::GpuMemoryBuffer> CreateGpuMemoryBufferFromHandle( 54 std::unique_ptr<gfx::GpuMemoryBuffer> CreateGpuMemoryBufferFromHandle(
55 const gfx::GpuMemoryBufferHandle& handle, 55 const gfx::GpuMemoryBufferHandle& handle,
56 const gfx::Size& size, 56 const gfx::Size& size,
57 gfx::BufferFormat format) override; 57 gfx::BufferFormat format) override;
58 gfx::GpuMemoryBuffer* GpuMemoryBufferFromClientBuffer(
59 ClientBuffer buffer) override;
60 void SetDestructionSyncToken(gfx::GpuMemoryBuffer* buffer, 58 void SetDestructionSyncToken(gfx::GpuMemoryBuffer* buffer,
61 const gpu::SyncToken& sync_token) override; 59 const gpu::SyncToken& sync_token) override;
62 int counter_ = 0; 60 int counter_ = 0;
63 // TODO(sad): Explore the option of doing this from an existing thread. 61 // TODO(sad): Explore the option of doing this from an existing thread.
64 base::Thread thread_; 62 base::Thread thread_;
65 mojom::GpuServicePtr gpu_service_; 63 mojom::GpuServicePtr gpu_service_;
66 std::unique_ptr<service_manager::Connector> connector_; 64 std::unique_ptr<service_manager::Connector> connector_;
67 base::WeakPtrFactory<MojoGpuMemoryBufferManager> weak_ptr_factory_; 65 base::WeakPtrFactory<MojoGpuMemoryBufferManager> weak_ptr_factory_;
68 66
69 DISALLOW_COPY_AND_ASSIGN(MojoGpuMemoryBufferManager); 67 DISALLOW_COPY_AND_ASSIGN(MojoGpuMemoryBufferManager);
70 }; 68 };
71 69
72 } // namespace ui 70 } // namespace ui
73 71
74 #endif // SERVICES_UI_PUBLIC_CPP_MOJO_GPU_MEMORY_BUFFER_MANAGER_H_ 72 #endif // SERVICES_UI_PUBLIC_CPP_MOJO_GPU_MEMORY_BUFFER_MANAGER_H_
OLDNEW
« no previous file with comments | « gpu/ipc/client/gpu_memory_buffer_impl.cc ('k') | services/ui/public/cpp/mojo_gpu_memory_buffer_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698