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 34 virtual angle::Result importFd(gl::Context *context, 35 GLuint64 size, 36 gl::HandleType handleType, 37 GLint fd) = 0; 38 virtual angle::Result importZirconHandle(gl::Context *context, 39 GLuint64 size, 40 gl::HandleType handleType, 41 GLuint handle) = 0; 42 }; 43 44 } // namespace rx 45 46 #endif // LIBANGLE_RENDERER_MEMORYOBJECTIMPL_H_ 47