tor-browser

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

RenderTarget9.h (2782B)


      1 //
      2 // Copyright 2012 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 // RenderTarget9.h: Defines a D3D9-specific wrapper for IDirect3DSurface9 pointers
      8 // retained by Renderbuffers.
      9 
     10 #ifndef LIBANGLE_RENDERER_D3D_D3D9_RENDERTARGET9_H_
     11 #define LIBANGLE_RENDERER_D3D_D3D9_RENDERTARGET9_H_
     12 
     13 #include "libANGLE/renderer/d3d/RenderTargetD3D.h"
     14 
     15 namespace rx
     16 {
     17 class Renderer9;
     18 class SwapChain9;
     19 
     20 class RenderTarget9 : public RenderTargetD3D
     21 {
     22  public:
     23    RenderTarget9() {}
     24    ~RenderTarget9() override {}
     25    // Retrieve the texture that backs this render target, may be null for swap chain render
     26    // targets.
     27    virtual IDirect3DBaseTexture9 *getTexture() const = 0;
     28    virtual size_t getTextureLevel() const            = 0;
     29 
     30    virtual IDirect3DSurface9 *getSurface() const = 0;
     31 
     32    virtual D3DFORMAT getD3DFormat() const = 0;
     33 };
     34 
     35 class TextureRenderTarget9 : public RenderTarget9
     36 {
     37  public:
     38    TextureRenderTarget9(IDirect3DBaseTexture9 *texture,
     39                         size_t textureLevel,
     40                         IDirect3DSurface9 *surface,
     41                         GLenum internalFormat,
     42                         GLsizei width,
     43                         GLsizei height,
     44                         GLsizei depth,
     45                         GLsizei samples);
     46    ~TextureRenderTarget9() override;
     47 
     48    GLsizei getWidth() const override;
     49    GLsizei getHeight() const override;
     50    GLsizei getDepth() const override;
     51    GLenum getInternalFormat() const override;
     52    GLsizei getSamples() const override;
     53 
     54    IDirect3DBaseTexture9 *getTexture() const override;
     55    size_t getTextureLevel() const override;
     56    IDirect3DSurface9 *getSurface() const override;
     57 
     58    D3DFORMAT getD3DFormat() const override;
     59 
     60  private:
     61    GLsizei mWidth;
     62    GLsizei mHeight;
     63    GLsizei mDepth;
     64    GLenum mInternalFormat;
     65    D3DFORMAT mD3DFormat;
     66    GLsizei mSamples;
     67 
     68    IDirect3DBaseTexture9 *mTexture;
     69    size_t mTextureLevel;
     70    IDirect3DSurface9 *mRenderTarget;
     71 };
     72 
     73 class SurfaceRenderTarget9 : public RenderTarget9
     74 {
     75  public:
     76    SurfaceRenderTarget9(SwapChain9 *swapChain, bool depth);
     77    ~SurfaceRenderTarget9() override;
     78 
     79    GLsizei getWidth() const override;
     80    GLsizei getHeight() const override;
     81    GLsizei getDepth() const override;
     82    GLenum getInternalFormat() const override;
     83    GLsizei getSamples() const override;
     84 
     85    IDirect3DBaseTexture9 *getTexture() const override;
     86    size_t getTextureLevel() const override;
     87    IDirect3DSurface9 *getSurface() const override;
     88 
     89    D3DFORMAT getD3DFormat() const override;
     90 
     91  private:
     92    SwapChain9 *mSwapChain;
     93    bool mDepth;
     94 };
     95 
     96 }  // namespace rx
     97 
     98 #endif  // LIBANGLE_RENDERER_D3D_D3D9_RENDERTARGET9_H_