xref: /aosp_15_r20/external/angle/src/libANGLE/renderer/MemoryObjectImpl.h (revision 8975f5c5ed3d1c378011245431ada316dfb6f244)
1 //
2 // Copyright 2019 The ANGLE Project Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
5 //
6 // MemoryObjectImpl.h: Implements the rx::MemoryObjectImpl class [EXT_external_objects]
7 
8 #ifndef LIBANGLE_RENDERER_MEMORYOBJECTIMPL_H_
9 #define LIBANGLE_RENDERER_MEMORYOBJECTIMPL_H_
10 
11 #include "angle_gl.h"
12 #include "common/PackedEnums.h"
13 #include "common/angleutils.h"
14 #include "libANGLE/Error.h"
15 
16 namespace gl
17 {
18 class Context;
19 class MemoryObject;
20 }  // namespace gl
21 
22 namespace rx
23 {
24 
25 class MemoryObjectImpl : angle::NonCopyable
26 {
27   public:
~MemoryObjectImpl()28     virtual ~MemoryObjectImpl() {}
29 
30     virtual void onDestroy(const gl::Context *context) = 0;
31 
32     virtual angle::Result setDedicatedMemory(const gl::Context *context, bool dedicatedMemory) = 0;
33     virtual angle::Result setProtectedMemory(const gl::Context *context, bool protectedMemory) = 0;
34 
35     virtual angle::Result importFd(gl::Context *context,
36                                    GLuint64 size,
37                                    gl::HandleType handleType,
38                                    GLint fd)                = 0;
39     virtual angle::Result importZirconHandle(gl::Context *context,
40                                              GLuint64 size,
41                                              gl::HandleType handleType,
42                                              GLuint handle) = 0;
43 };
44 
45 }  // namespace rx
46 
47 #endif  // LIBANGLE_RENDERER_MEMORYOBJECTIMPL_H_
48