1 // 2 // Copyright 2015 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 7 // ImageImpl.h: Defines the rx::ImageImpl class representing the EGLimage object. 8 9 #ifndef LIBANGLE_RENDERER_IMAGEIMPL_H_ 10 #define LIBANGLE_RENDERER_IMAGEIMPL_H_ 11 12 #include "common/angleutils.h" 13 #include "libANGLE/Error.h" 14 #include "libANGLE/formatutils.h" 15 #include "libANGLE/renderer/FramebufferAttachmentObjectImpl.h" 16 17 namespace gl 18 { 19 class Context; 20 } // namespace gl 21 22 namespace egl 23 { 24 class Display; 25 class ImageSibling; 26 struct ImageState; 27 } // namespace egl 28 29 namespace rx 30 { 31 class ExternalImageSiblingImpl : public FramebufferAttachmentObjectImpl 32 { 33 public: ~ExternalImageSiblingImpl()34 ~ExternalImageSiblingImpl() override {} 35 36 virtual egl::Error initialize(const egl::Display *display) = 0; onDestroy(const egl::Display * display)37 virtual void onDestroy(const egl::Display *display) {} 38 39 virtual gl::Format getFormat() const = 0; 40 virtual bool isRenderable(const gl::Context *context) const = 0; 41 virtual bool isTexturable(const gl::Context *context) const = 0; 42 virtual bool isYUV() const = 0; 43 virtual gl::Extents getSize() const = 0; 44 virtual size_t getSamples() const = 0; 45 }; 46 47 class ImageImpl : angle::NonCopyable 48 { 49 public: ImageImpl(const egl::ImageState & state)50 ImageImpl(const egl::ImageState &state) : mState(state) {} ~ImageImpl()51 virtual ~ImageImpl() {} onDestroy(const egl::Display * display)52 virtual void onDestroy(const egl::Display *display) {} 53 54 virtual egl::Error initialize(const egl::Display *display) = 0; 55 56 virtual angle::Result orphan(const gl::Context *context, egl::ImageSibling *sibling) = 0; 57 58 protected: 59 const egl::ImageState &mState; 60 }; 61 } // namespace rx 62 63 #endif // LIBANGLE_RENDERER_IMAGEIMPL_H_ 64