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 angle::Result setProtectedMemory(const gl::Context *context, bool protectedMemory) override; 26 27 angle::Result importFd(gl::Context *context, 28 GLuint64 size, 29 gl::HandleType handleType, 30 GLint fd) override; 31 32 angle::Result importZirconHandle(gl::Context *context, 33 GLuint64 size, 34 gl::HandleType handleType, 35 GLuint handle) override; 36 37 GLuint getMemoryObjectID() const; 38 39 private: 40 GLuint mMemoryObject; 41 }; 42 43 } // namespace rx 44 45 #endif // LIBANGLE_RENDERER_GL_MEMORYOBJECTGL_H_ 46