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

Side by Side Diff: services/ui/surfaces/mus_gpu_memory_buffer_manager.h

Issue 2534663002: mus: Move MusGpuMemoryBufferManager into common. (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
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 SERVICES_UI_SURFACES_MUS_GPU_MEMORY_BUFFER_MANAGER_H_
6 #define SERVICES_UI_SURFACES_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 #include "services/ui/gpu/interfaces/gpu_service_internal.mojom.h"
14
15 namespace ui {
16
17 // This GpuMemoryBufferManager is for establishing a GpuChannelHost used by
18 // mus locally.
19 class MusGpuMemoryBufferManager : public gpu::GpuMemoryBufferManager {
20 public:
21 MusGpuMemoryBufferManager(mojom::GpuServiceInternalPtr gpu_service,
22 int client_id);
23 ~MusGpuMemoryBufferManager() override;
24
25 // Overridden from gpu::GpuMemoryBufferManager:
26 std::unique_ptr<gfx::GpuMemoryBuffer> CreateGpuMemoryBuffer(
27 const gfx::Size& size,
28 gfx::BufferFormat format,
29 gfx::BufferUsage usage,
30 gpu::SurfaceHandle surface_handle) override;
31 std::unique_ptr<gfx::GpuMemoryBuffer> CreateGpuMemoryBufferFromHandle(
32 const gfx::GpuMemoryBufferHandle& handle,
33 const gfx::Size& size,
34 gfx::BufferFormat format) override;
35 void SetDestructionSyncToken(gfx::GpuMemoryBuffer* buffer,
36 const gpu::SyncToken& sync_token) override;
37
38 private:
39 DISALLOW_COPY_AND_ASSIGN(MusGpuMemoryBufferManager);
40
41 void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id,
42 int client_id,
43 bool is_native,
44 const gpu::SyncToken& sync_token);
45
46 mojom::GpuServiceInternalPtr gpu_service_;
47 const int client_id_;
48 base::WeakPtrFactory<MusGpuMemoryBufferManager> weak_factory_;
49 };
50
51 } // namespace ui
52
53 #endif // SERVICES_UI_SURFACES_MUS_GPU_MEMORY_BUFFER_MANAGER_H_
OLDNEW
« no previous file with comments | « services/ui/surfaces/display_compositor.cc ('k') | services/ui/surfaces/mus_gpu_memory_buffer_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698