Edit

kc3-lang/angle/src/libANGLE/renderer/Image.h

Branch :

  • Show log

    Commit

  • Author : Gregoire Payen de La Garanderie
    Date : 2015-01-30 11:38:21
    Hash : 32334afe
    Message : Implement the copy from a 3D texture to Image11. Fixes the generation of 3D texture mipmaps. BUG=angle:915 Change-Id: Icc0c91099f60713d511ebe1a2248a21b63efddaa Reviewed-on: https://chromium-review.googlesource.com/244720 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Gregoire Payen de La Garanderie <Gregory.Payen@imgtec.com>

  • src/libANGLE/renderer/Image.h
  • //
    // Copyright (c) 2002-2012 The ANGLE Project Authors. All rights reserved.
    // Use of this source code is governed by a BSD-style license that can be
    // found in the LICENSE file.
    //
    
    // Image.h: Defines the rx::Image class, an abstract base class for the
    // renderer-specific classes which will define the interface to the underlying
    // surfaces or resources.
    
    #ifndef LIBANGLE_RENDERER_IMAGE_H_
    #define LIBANGLE_RENDERER_IMAGE_H_
    
    #include "common/debug.h"
    #include "libANGLE/Error.h"
    
    #include <GLES2/gl2.h>
    
    namespace gl
    {
    class Framebuffer;
    struct Rectangle;
    struct Extents;
    struct Box;
    struct Offset;
    struct ImageIndex;
    }
    
    namespace rx
    {
    class RendererD3D;
    class RenderTarget;
    class TextureStorage;
    
    class Image
    {
      public:
        Image();
        virtual ~Image() {};
    
        GLsizei getWidth() const { return mWidth; }
        GLsizei getHeight() const { return mHeight; }
        GLsizei getDepth() const { return mDepth; }
        GLenum getInternalFormat() const { return mInternalFormat; }
        GLenum getTarget() const { return mTarget; }
        bool isRenderableFormat() const { return mRenderable; }
    
        void markDirty() {mDirty = true;}
        void markClean() {mDirty = false;}
        virtual bool isDirty() const = 0;
    
        virtual bool redefine(GLenum target, GLenum internalformat, const gl::Extents &size, bool forceRelease) = 0;
    
        virtual gl::Error loadData(const gl::Box &area, GLint unpackAlignment, GLenum type, const void *input) = 0;
        virtual gl::Error loadCompressedData(const gl::Box &area, const void *input) = 0;
    
        virtual gl::Error copy(const gl::Offset &destOffset, const gl::Rectangle &sourceArea, const gl::Framebuffer *source) = 0;
        virtual gl::Error copy(const gl::Offset &destOffset, const gl::Box &sourceArea,
                               const gl::ImageIndex &sourceIndex, TextureStorage *source) = 0;
    
      protected:
        GLsizei mWidth;
        GLsizei mHeight;
        GLsizei mDepth;
        GLenum mInternalFormat;
        bool mRenderable;
        GLenum mTarget;
    
        bool mDirty;
    
      private:
        DISALLOW_COPY_AND_ASSIGN(Image);
    };
    
    }
    
    #endif // LIBANGLE_RENDERER_IMAGE_H_