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 gl::Extents getSize() const override; 33 size_t getSamples() const override; 34 35 // FramebufferAttachmentObjectImpl interface 36 angle::Result getAttachmentRenderTarget(const gl::Context *context, 37 GLenum binding, 38 const gl::ImageIndex &imageIndex, 39 GLsizei samples, 40 FramebufferAttachmentRenderTarget **rtOut) override; 41 angle::Result initializeContents(const gl::Context *context, 42 const gl::ImageIndex &imageIndex) override; 43 44 private: 45 angle::Result createRenderTarget(const gl::Context *context); 46 47 Renderer11 *mRenderer; 48 EGLClientBuffer mBuffer; 49 egl::AttributeMap mAttribs; 50 51 TextureHelper11 mTexture; 52 53 gl::Format mFormat = gl::Format::Invalid(); 54 bool mIsRenderable = false; 55 bool mIsTexturable = false; 56 EGLint mWidth = 0; 57 EGLint mHeight = 0; 58 GLsizei mSamples = 0; 59 60 std::unique_ptr<RenderTargetD3D> mRenderTarget; 61 }; 62 63 } // namespace rx 64 65 #endif // LIBANGLE_RENDERER_D3D_D3D11_EXTERNALIMAGESIBLINGIMPL11_H_ 66