| OLD | NEW |
| (Empty) |
| 1 // Copyright 2014 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_GLES2_MOJO_BUFFER_BACKING_H_ | |
| 6 #define COMPONENTS_MUS_GLES2_MOJO_BUFFER_BACKING_H_ | |
| 7 | |
| 8 #include <stddef.h> | |
| 9 | |
| 10 #include <memory> | |
| 11 | |
| 12 #include "base/macros.h" | |
| 13 #include "gpu/command_buffer/common/buffer.h" | |
| 14 #include "mojo/public/cpp/system/core.h" | |
| 15 | |
| 16 namespace mus { | |
| 17 | |
| 18 class MojoBufferBacking : public gpu::BufferBacking { | |
| 19 public: | |
| 20 MojoBufferBacking(mojo::ScopedSharedBufferHandle handle, | |
| 21 void* memory, | |
| 22 size_t size); | |
| 23 ~MojoBufferBacking() override; | |
| 24 | |
| 25 static std::unique_ptr<gpu::BufferBacking> Create( | |
| 26 mojo::ScopedSharedBufferHandle handle, | |
| 27 size_t size); | |
| 28 | |
| 29 void* GetMemory() const override; | |
| 30 size_t GetSize() const override; | |
| 31 | |
| 32 private: | |
| 33 mojo::ScopedSharedBufferHandle handle_; | |
| 34 void* memory_; | |
| 35 size_t size_; | |
| 36 | |
| 37 DISALLOW_COPY_AND_ASSIGN(MojoBufferBacking); | |
| 38 }; | |
| 39 | |
| 40 } // namespace mus | |
| 41 | |
| 42 #endif // COMPONENTS_MUS_GLES2_MOJO_BUFFER_BACKING_H_ | |
| OLD | NEW |