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

Side by Side Diff: components/mus/gles2/mojo_gpu_memory_buffer.h

Issue 1857243005: Scan-out capable buffers (aka ui::NativePixmap) for Mus (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: build fix for windows Created 4 years, 8 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
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 COMPONENTS_MUS_GLES2_MOJO_GPU_MEMORY_BUFFER_H_ 5 #ifndef COMPONENTS_MUS_GLES2_MOJO_GPU_MEMORY_BUFFER_H_
6 #define COMPONENTS_MUS_GLES2_MOJO_GPU_MEMORY_BUFFER_H_ 6 #define COMPONENTS_MUS_GLES2_MOJO_GPU_MEMORY_BUFFER_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 #include "components/mus/gles2/gpu_memory_buffer_impl.h"
12 #include "ui/gfx/geometry/size.h" 13 #include "ui/gfx/geometry/size.h"
13 #include "ui/gfx/gpu_memory_buffer.h" 14 #include "ui/gfx/gpu_memory_buffer.h"
14 15
15 namespace mus { 16 namespace mus {
16 17
17 class MojoGpuMemoryBufferImpl : public gfx::GpuMemoryBuffer { 18 class MojoGpuMemoryBufferImpl : public mus::GpuMemoryBufferImpl {
18 public: 19 public:
19 MojoGpuMemoryBufferImpl(const gfx::Size& size, 20 MojoGpuMemoryBufferImpl(const gfx::Size& size,
20 gfx::BufferFormat format, 21 gfx::BufferFormat format,
21 scoped_ptr<base::SharedMemory> shared_memory); 22 scoped_ptr<base::SharedMemory> shared_memory);
22 ~MojoGpuMemoryBufferImpl() override; 23 ~MojoGpuMemoryBufferImpl() override;
23 24
24 static scoped_ptr<gfx::GpuMemoryBuffer> Create(const gfx::Size& size, 25 static scoped_ptr<gfx::GpuMemoryBuffer> Create(const gfx::Size& size,
25 gfx::BufferFormat format, 26 gfx::BufferFormat format,
26 gfx::BufferUsage usage); 27 gfx::BufferUsage usage);
27 28
28 static MojoGpuMemoryBufferImpl* FromClientBuffer(ClientBuffer buffer); 29 static MojoGpuMemoryBufferImpl* FromClientBuffer(ClientBuffer buffer);
29 30
30 const unsigned char* GetMemory() const; 31 const unsigned char* GetMemory() const;
31 32
32 // Overridden from gfx::GpuMemoryBuffer: 33 // Overridden from gfx::GpuMemoryBuffer:
33 bool Map() override; 34 bool Map() override;
34 void* memory(size_t plane) override; 35 void* memory(size_t plane) override;
35 void Unmap() override; 36 void Unmap() override;
36 gfx::Size GetSize() const override;
37 gfx::BufferFormat GetFormat() const override;
38 int stride(size_t plane) const override; 37 int stride(size_t plane) const override;
39 gfx::GpuMemoryBufferId GetId() const override;
40 gfx::GpuMemoryBufferHandle GetHandle() const override; 38 gfx::GpuMemoryBufferHandle GetHandle() const override;
41 ClientBuffer AsClientBuffer() override; 39
40 // Overridden from gfx::GpuMemoryBufferImpl
41 gfx::GpuMemoryBufferType GetBufferType() const override;
42 42
43 private: 43 private:
44 const gfx::Size size_;
45 gfx::BufferFormat format_;
46 scoped_ptr<base::SharedMemory> shared_memory_; 44 scoped_ptr<base::SharedMemory> shared_memory_;
47 bool mapped_;
48 45
49 DISALLOW_COPY_AND_ASSIGN(MojoGpuMemoryBufferImpl); 46 DISALLOW_COPY_AND_ASSIGN(MojoGpuMemoryBufferImpl);
50 }; 47 };
51 48
52 } // namespace mus 49 } // namespace mus
53 50
54 #endif // COMPONENTS_MUS_GLES2_MOJO_GPU_MEMORY_BUFFER_H_ 51 #endif // COMPONENTS_MUS_GLES2_MOJO_GPU_MEMORY_BUFFER_H_
OLDNEW
« no previous file with comments | « components/mus/gles2/gpu_memory_buffer_impl.cc ('k') | components/mus/gles2/mojo_gpu_memory_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698