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

Side by Side Diff: components/mus/gpu/mus_gpu_memory_buffer_manager.h

Issue 2119963002: Move mus to //services/ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 5 months 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_MUS_GPU_MUS_GPU_MEMORY_BUFFER_MANAGER_H_
6 #define COMPONENTS_MUS_GPU_MUS_GPU_MEMORY_BUFFER_MANAGER_H_
7
8 #include <memory>
9
10 #include "base/macros.h"
11 #include "base/memory/weak_ptr.h"
12 #include "gpu/command_buffer/client/gpu_memory_buffer_manager.h"
13
14 namespace mus {
15
16 class GpuServiceMus;
17
18 // This GpuMemoryBufferManager is for establishing a GpuChannelHost used by
19 // mus locally.
20 class MusGpuMemoryBufferManager : public gpu::GpuMemoryBufferManager {
21 public:
22 MusGpuMemoryBufferManager(GpuServiceMus* gpu_service, int client_id);
23 ~MusGpuMemoryBufferManager() override;
24
25 static MusGpuMemoryBufferManager* current();
26
27 // Overridden from gpu::GpuMemoryBufferManager:
28 std::unique_ptr<gfx::GpuMemoryBuffer> AllocateGpuMemoryBuffer(
29 const gfx::Size& size,
30 gfx::BufferFormat format,
31 gfx::BufferUsage usage,
32 gpu::SurfaceHandle surface_handle) override;
33 std::unique_ptr<gfx::GpuMemoryBuffer> CreateGpuMemoryBufferFromHandle(
34 const gfx::GpuMemoryBufferHandle& handle,
35 const gfx::Size& size,
36 gfx::BufferFormat format) override;
37 gfx::GpuMemoryBuffer* GpuMemoryBufferFromClientBuffer(
38 ClientBuffer buffer) override;
39 void SetDestructionSyncToken(gfx::GpuMemoryBuffer* buffer,
40 const gpu::SyncToken& sync_token) override;
41
42 private:
43 DISALLOW_COPY_AND_ASSIGN(MusGpuMemoryBufferManager);
44
45 void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id,
46 int client_id,
47 bool is_native,
48 const gpu::SyncToken& sync_token);
49
50 GpuServiceMus* gpu_service_;
51 const int client_id_;
52 base::WeakPtrFactory<MusGpuMemoryBufferManager> weak_factory_;
53 };
54
55 } // namespace mus
56
57 #endif // COMPONENTS_MUS_GPU_MUS_GPU_MEMORY_BUFFER_MANAGER_H_
OLDNEW
« no previous file with comments | « components/mus/gpu/gpu_service_mus.cc ('k') | components/mus/gpu/mus_gpu_memory_buffer_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698