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

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

Issue 2480023002: mus: Remove unnecessary GpuMemoryBuffer code from client-lib. (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
(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_PUBLIC_CPP_MOJO_GPU_MEMORY_BUFFER_H_
6 #define SERVICES_UI_PUBLIC_CPP_MOJO_GPU_MEMORY_BUFFER_H_
7
8 #include <stddef.h>
9
10 #include <memory>
11
12 #include "base/macros.h"
13 #include "services/ui/public/cpp/gpu_memory_buffer_impl.h"
14 #include "ui/gfx/geometry/size.h"
15 #include "ui/gfx/gpu_memory_buffer.h"
16
17 namespace ui {
18
19 class MojoGpuMemoryBufferImpl : public ui::GpuMemoryBufferImpl {
20 public:
21 ~MojoGpuMemoryBufferImpl() override;
22
23 static std::unique_ptr<gfx::GpuMemoryBuffer> Create(const gfx::Size& size,
24 gfx::BufferFormat format,
25 gfx::BufferUsage usage);
26 static std::unique_ptr<gfx::GpuMemoryBuffer> CreateFromHandle(
27 const gfx::GpuMemoryBufferHandle& handle,
28 const gfx::Size& size,
29 gfx::BufferFormat format,
30 gfx::BufferUsage usage);
31 static MojoGpuMemoryBufferImpl* FromClientBuffer(ClientBuffer buffer);
32
33 const unsigned char* GetMemory() const;
34
35 // Overridden from gfx::GpuMemoryBuffer:
36 bool Map() override;
37 void* memory(size_t plane) override;
38 void Unmap() override;
39 int stride(size_t plane) const override;
40 gfx::GpuMemoryBufferHandle GetHandle() const override;
41
42 // Overridden from gfx::GpuMemoryBufferImpl
43 gfx::GpuMemoryBufferType GetBufferType() const override;
44
45 private:
46 MojoGpuMemoryBufferImpl(const gfx::Size& size,
47 gfx::BufferFormat format,
48 std::unique_ptr<base::SharedMemory> shared_memory,
49 uint32_t offset,
50 int32_t stride);
51
52 std::unique_ptr<base::SharedMemory> shared_memory_;
53 const uint32_t offset_;
54 const int32_t stride_;
55
56 DISALLOW_COPY_AND_ASSIGN(MojoGpuMemoryBufferImpl);
57 };
58
59 } // namespace ui
60
61 #endif // SERVICES_UI_PUBLIC_CPP_MOJO_GPU_MEMORY_BUFFER_H_
OLDNEW
« no previous file with comments | « services/ui/public/cpp/gpu_memory_buffer_impl.cc ('k') | services/ui/public/cpp/mojo_gpu_memory_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698