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

Side by Side Diff: services/ui/common/mojo_gpu_memory_buffer.h

Issue 2184943002: services/ui: Move some files into the client lib. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@chrome-gpu-in-mus-windows
Patch Set: . Created 4 years, 4 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
« no previous file with comments | « services/ui/common/mojo_buffer_backing.cc ('k') | services/ui/common/mojo_gpu_memory_buffer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef SERVICES_UI_COMMON_MOJO_GPU_MEMORY_BUFFER_H_
6 #define SERVICES_UI_COMMON_MOJO_GPU_MEMORY_BUFFER_H_
7
8 #include <stddef.h>
9
10 #include <memory>
11
12 #include "base/macros.h"
13 #include "services/ui/common/gpu_memory_buffer_impl.h"
14 #include "services/ui/common/mus_common_export.h"
15 #include "ui/gfx/geometry/size.h"
16 #include "ui/gfx/gpu_memory_buffer.h"
17
18 namespace ui {
19
20 class MUS_COMMON_EXPORT MojoGpuMemoryBufferImpl
21 : public ui::GpuMemoryBufferImpl {
22 public:
23 MojoGpuMemoryBufferImpl(const gfx::Size& size,
24 gfx::BufferFormat format,
25 std::unique_ptr<base::SharedMemory> shared_memory);
26 ~MojoGpuMemoryBufferImpl() override;
27
28 static std::unique_ptr<gfx::GpuMemoryBuffer> Create(const gfx::Size& size,
29 gfx::BufferFormat format,
30 gfx::BufferUsage usage);
31
32 static MojoGpuMemoryBufferImpl* FromClientBuffer(ClientBuffer buffer);
33
34 const unsigned char* GetMemory() const;
35
36 // Overridden from gfx::GpuMemoryBuffer:
37 bool Map() override;
38 void* memory(size_t plane) override;
39 void Unmap() override;
40 int stride(size_t plane) const override;
41 gfx::GpuMemoryBufferHandle GetHandle() const override;
42
43 // Overridden from gfx::GpuMemoryBufferImpl
44 gfx::GpuMemoryBufferType GetBufferType() const override;
45
46 private:
47 std::unique_ptr<base::SharedMemory> shared_memory_;
48
49 DISALLOW_COPY_AND_ASSIGN(MojoGpuMemoryBufferImpl);
50 };
51
52 } // namespace ui
53
54 #endif // SERVICES_UI_COMMON_MOJO_GPU_MEMORY_BUFFER_H_
OLDNEW
« no previous file with comments | « services/ui/common/mojo_buffer_backing.cc ('k') | services/ui/common/mojo_gpu_memory_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698