tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

ImageImpl.h (1975B)


      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:
     34    ~ExternalImageSiblingImpl() override {}
     35 
     36    virtual egl::Error initialize(const egl::Display *display) = 0;
     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 bool isCubeMap() const;
     44    virtual bool hasProtectedContent() const = 0;
     45    virtual gl::Extents getSize() const      = 0;
     46    virtual size_t getSamples() const        = 0;
     47    virtual uint32_t getLevelCount() const;
     48 };
     49 
     50 class ImageImpl : angle::NonCopyable
     51 {
     52  public:
     53    ImageImpl(const egl::ImageState &state) : mState(state) {}
     54    virtual ~ImageImpl() {}
     55    virtual void onDestroy(const egl::Display *display) {}
     56 
     57    virtual egl::Error initialize(const egl::Display *display) = 0;
     58 
     59    virtual angle::Result orphan(const gl::Context *context, egl::ImageSibling *sibling) = 0;
     60 
     61    virtual egl::Error exportVkImage(void *vkImage, void *vkImageCreateInfo);
     62 
     63  protected:
     64    const egl::ImageState &mState;
     65 };
     66 }  // namespace rx
     67 
     68 #endif  // LIBANGLE_RENDERER_IMAGEIMPL_H_