gfx/angle/src/libGLESv2/renderer/Image11.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gfx/angle/src/libGLESv2/renderer/Image11.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,76 @@
     1.4 +//
     1.5 +// Copyright (c) 2012 The ANGLE Project Authors. All rights reserved.
     1.6 +// Use of this source code is governed by a BSD-style license that can be
     1.7 +// found in the LICENSE file.
     1.8 +//
     1.9 +
    1.10 +// Image11.h: Defines the rx::Image11 class, which acts as the interface to
    1.11 +// the actual underlying resources of a Texture
    1.12 +
    1.13 +#ifndef LIBGLESV2_RENDERER_IMAGE11_H_
    1.14 +#define LIBGLESV2_RENDERER_IMAGE11_H_
    1.15 +
    1.16 +#include "libGLESv2/renderer/Image.h"
    1.17 +
    1.18 +#include "common/debug.h"
    1.19 +
    1.20 +namespace gl
    1.21 +{
    1.22 +class Framebuffer;
    1.23 +}
    1.24 +
    1.25 +namespace rx
    1.26 +{
    1.27 +class Renderer;
    1.28 +class Renderer11;
    1.29 +class TextureStorageInterface2D;
    1.30 +class TextureStorageInterfaceCube;
    1.31 +
    1.32 +class Image11 : public Image
    1.33 +{
    1.34 +  public:
    1.35 +    Image11();
    1.36 +    virtual ~Image11();
    1.37 +
    1.38 +    static Image11 *makeImage11(Image *img);
    1.39 +
    1.40 +    static void generateMipmap(Image11 *dest, Image11 *src);
    1.41 +
    1.42 +    virtual bool isDirty() const;
    1.43 +
    1.44 +    virtual bool updateSurface(TextureStorageInterface2D *storage, int level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height);
    1.45 +    virtual bool updateSurface(TextureStorageInterfaceCube *storage, int face, int level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height);
    1.46 +
    1.47 +    virtual bool redefine(Renderer *renderer, GLint internalformat, GLsizei width, GLsizei height, bool forceRelease);
    1.48 +
    1.49 +    virtual bool isRenderableFormat() const;
    1.50 +    DXGI_FORMAT getDXGIFormat() const;
    1.51 +    
    1.52 +    virtual void loadData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
    1.53 +                  GLint unpackAlignment, const void *input);
    1.54 +    virtual void loadCompressedData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
    1.55 +                                    const void *input);
    1.56 +
    1.57 +    virtual void copy(GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height, gl::Framebuffer *source);
    1.58 +
    1.59 +  protected:
    1.60 +    HRESULT map(D3D11_MAPPED_SUBRESOURCE *map);
    1.61 +    void unmap();
    1.62 +
    1.63 +  private:
    1.64 +    DISALLOW_COPY_AND_ASSIGN(Image11);
    1.65 +
    1.66 +    ID3D11Texture2D *getStagingTexture();
    1.67 +    unsigned int getStagingSubresource();
    1.68 +    void createStagingTexture();
    1.69 +
    1.70 +    Renderer11 *mRenderer;
    1.71 +
    1.72 +    DXGI_FORMAT mDXGIFormat;
    1.73 +    ID3D11Texture2D *mStagingTexture;
    1.74 +    unsigned int mStagingSubresource;
    1.75 +};
    1.76 +
    1.77 +}
    1.78 +
    1.79 +#endif // LIBGLESV2_RENDERER_IMAGE11_H_

mercurial