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 7 #ifndef LIBANGLE_RENDERER_D3D_D3D11_EXTERNALIMAGESIBLINGIMPL11_H_ 8 #define LIBANGLE_RENDERER_D3D_D3D11_EXTERNALIMAGESIBLINGIMPL11_H_ 9 10 #include "libANGLE/renderer/ImageImpl.h" 11 #include "libANGLE/renderer/d3d/d3d11/renderer11_utils.h" 12 13 namespace rx 14 { 15 16 class Renderer11; 17 class RenderTargetD3D; 18 19 class ExternalImageSiblingImpl11 : public ExternalImageSiblingImpl 20 { 21 public: 22 ExternalImageSiblingImpl11(Renderer11 *renderer, 23 EGLClientBuffer clientBuffer, 24 const egl::AttributeMap &attribs); 25 ~ExternalImageSiblingImpl11() override; 26 27 // ExternalImageSiblingImpl interface 28 egl::Error initialize(const egl::Display *display) override; 29 gl::Format getFormat() const override; 30 bool isRenderable(const gl::Context *context) const override; 31 bool isTexturable(const gl::Context *context) const override; 32 bool isYUV() const override; 33 bool hasProtectedContent() const override; 34 gl::Extents getSize() const override; 35 size_t getSamples() const override; 36 37 // FramebufferAttachmentObjectImpl interface 38 angle::Result getAttachmentRenderTarget(const gl::Context *context, 39 GLenum binding, 40 const gl::ImageIndex &imageIndex, 41 GLsizei samples, 42 FramebufferAttachmentRenderTarget **rtOut) override; 43 angle::Result initializeContents(const gl::Context *context, 44 const gl::ImageIndex &imageIndex) override; 45 46 private: 47 angle::Result createRenderTarget(const gl::Context *context); 48 49 Renderer11 *mRenderer; 50 EGLClientBuffer mBuffer; 51 egl::AttributeMap mAttribs; 52 53 TextureHelper11 mTexture; 54 55 gl::Format mFormat = gl::Format::Invalid(); 56 bool mIsRenderable = false; 57 bool mIsTexturable = false; 58 bool mIsTextureArray = false; 59 bool mYUV = false; 60 bool mHasProtectedContent = false; 61 EGLint mWidth = 0; 62 EGLint mHeight = 0; 63 GLsizei mSamples = 0; 64 UINT mArraySlice = 0; 65 66 std::unique_ptr<RenderTargetD3D> mRenderTarget; 67 }; 68 69 } // namespace rx 70 71 #endif // LIBANGLE_RENDERER_D3D_D3D11_EXTERNALIMAGESIBLINGIMPL11_H_ 72