summaryrefslogtreecommitdiffstats
path: root/gfx/angle/checkout/src/libANGLE/MemoryObject.h
diff options
context:
space:
mode:
Diffstat (limited to 'gfx/angle/checkout/src/libANGLE/MemoryObject.h')
-rw-r--r--gfx/angle/checkout/src/libANGLE/MemoryObject.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/gfx/angle/checkout/src/libANGLE/MemoryObject.h b/gfx/angle/checkout/src/libANGLE/MemoryObject.h
new file mode 100644
index 0000000000..1bc1d40145
--- /dev/null
+++ b/gfx/angle/checkout/src/libANGLE/MemoryObject.h
@@ -0,0 +1,45 @@
+//
+// Copyright 2019 The ANGLE Project Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+// MemoryObject.h: Defines the gl::MemoryObject class [EXT_external_objects]
+
+#ifndef LIBANGLE_MEMORYOBJECT_H_
+#define LIBANGLE_MEMORYOBJECT_H_
+
+#include "angle_gl.h"
+#include "common/PackedEnums.h"
+#include "common/angleutils.h"
+#include "libANGLE/Error.h"
+#include "libANGLE/RefCountObject.h"
+
+namespace rx
+{
+class GLImplFactory;
+class MemoryObjectImpl;
+} // namespace rx
+
+namespace gl
+{
+class Context;
+
+class MemoryObject final : public RefCountObject
+{
+ public:
+ MemoryObject(rx::GLImplFactory *factory, GLuint id);
+ ~MemoryObject() override;
+
+ void onDestroy(const Context *context) override;
+
+ rx::MemoryObjectImpl *getImplementation() const { return mImplementation.get(); }
+
+ angle::Result importFd(Context *context, GLuint64 size, HandleType handleType, GLint fd);
+
+ private:
+ std::unique_ptr<rx::MemoryObjectImpl> mImplementation;
+};
+
+} // namespace gl
+
+#endif // LIBANGLE_MEMORYOBJECT_H_