• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2019 The ANGLE Project 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 // MemoryObjectGL.h: Defines the class interface for MemoryObjectGL,
6 // implementing MemoryObjectImpl.
7 
8 #ifndef LIBANGLE_RENDERER_GL_MEMORYOBJECTGL_H_
9 #define LIBANGLE_RENDERER_GL_MEMORYOBJECTGL_H_
10 
11 #include "libANGLE/renderer/MemoryObjectImpl.h"
12 
13 namespace rx
14 {
15 
16 class MemoryObjectGL : public MemoryObjectImpl
17 {
18   public:
19     MemoryObjectGL(GLuint memoryObject);
20     ~MemoryObjectGL() override;
21 
22     void onDestroy(const gl::Context *context) override;
23 
24     angle::Result setDedicatedMemory(const gl::Context *context, bool dedicatedMemory) override;
25 
26     angle::Result importFd(gl::Context *context,
27                            GLuint64 size,
28                            gl::HandleType handleType,
29                            GLint fd) override;
30 
31     angle::Result importZirconHandle(gl::Context *context,
32                                      GLuint64 size,
33                                      gl::HandleType handleType,
34                                      GLuint handle) override;
35 
36     GLuint getMemoryObjectID() const;
37 
38   private:
39     GLuint mMemoryObject;
40 };
41 
42 }  // namespace rx
43 
44 #endif  // LIBANGLE_RENDERER_GL_MEMORYOBJECTGL_H_
45